Friday, 7 October 2011

Capture nonstandard data:

Date, time, date&time, amount.
Nonstandard data can be read in standard format i.e. Numeric.
Informat technique: Capture nonstandard data into standard format in numeric  values this value is SAS date value.

SAS date value: Number of days difference between input date to system specification date (01JAN1960).

Before         01 Jan 1960           After
-ve                     0                      +ve


Format statement : 
Convert standard data in nonstandard data in reporting

Informat statement can be used in dataset block .

Format statement can be used in dataset block and procedure block.

01Jan1961-> Informat -> Standard -> numeric -> SAS data value -> format -> nonstandard -> 01Jan1961

Syntax: Informat <variable> <informat technique>;
Format <variable> <format technique>;

Data mh;
Infile cards;
Input pis sdate edate;
Informat sdate edate ddmmyy10.;
cards;
101 01/01/1960 01/01/1961
102 01/01/1959 13/04/1980
;

Proc print data=mh;
Format sdate edate ddmmyy10.;
Run;

No comments:

Post a Comment