70.PROGRAM TO CREATE DATES DATASET

                         PROGRAM TO CREATE DATES DATASET 


--->To Create Sas Dataset Called Dates:

 data dates;

informat Date1 Date2 date9.;

input Date1 Date2;

format Date1 Date2 date9.;

datalines;

01JAN1960 15JAN1960

02MAR1961 18FEB1962

25DEC2000 03JAN2001

01FEB2002 31MAR2002

;

title "Listing of Data Set DATES";

proc print data=dates noobs;

run;


Explanation:

This is not a function example program, one feature should be explained: Since the

INPUT statement is reading list input (i.e., one or more spaces between the data values) and

since you need to supply an informat so that the values will be read as SAS date values, an

INFORMAT statement precedes the INPUT statement, indicating that both variables,

DATE1 and DATE2, should be read with the DATE9. informat.


Output:

    
                                                            Listing of Data Set DATES


Date1 Date2
01JAN1960 15JAN1960
02MAR1961 18FEB1962
25DEC2000 03JAN2001
01FEB2002 31MAR2002

TRY THIS AND COMMENT ...


-->PLEASE READ AND COMMENT THE BLOG...

--PLEASE FOLLOW THE BLOG FOR MORE UPDATES...

--FOLLOW US IN FACEBOOK SASALL4YOU AND JOIN ...

--JOIN US IN FACEBOOK AND TELEGRAM  CHANNEL FOR MORE UPDATES

   CLICK HERE: https://t.me/SasAll4You






Comments