Friday, 7 October 2011

Infile options:

These are used in list input method only.
    1. Dlm
    2.Dsd: data separated delimiter or data sensitive delimiter.
    3.Flowover
    4.Stopover
    5.Missover
    6.Turnover
    7.Firstobs
    8.Obs

Dlm: Enable to specify delimiter in raw data.

Data mh1;
Infile Cards dlm= ',&';
Input pid visit $ drug $;
cards;
101,VIsit1,05mg
102,Visit1,10mg
103,Visit1,15mg
101&Visit2&05mg
102&Visit2&10mg
;

Note: Whenever use dlm option in application then should be mention all delimiters including spaces.


Dsd: Data separated delimiter: In raw data, data values are seperated by comma (,) then can be used dsd instead of dlm option.

Data sensitive delimiter: It removes quotations from the character data reading into SAS dataset.

Note: dlm is more efficient why because it controls any delimiter in raw data.


Data mh2;
Infile Cards dsd;
Input pid visit $ drug $;
cards;
101,VIsit1,05mg
102,Visit1,10mg
103,Visit1,"15mg"
;
/*or*/

Data mh2;
Infile Cards dsd dlm= '&,';
Input pid visit $ drug $;
cards;
101&Visit2&05mg
102&Visit2&10mg
103&Visit &"15mg"
;

Flowover: It's a defualt nature of the SAS. It controls the SAS system to read only one observation per line.

Stopover: It is a defualt nature of the SAS. It stops the reading at the last observation.

No comments:

Post a Comment