Sas Input Methods

Submitted by: Submitted by

Views: 97

Words: 976

Pages: 4

Category: Other Topics

Date Submitted: 01/14/2014 08:28 AM

Report This Essay

Input methods;

List input method

Named input method

Advanced input method

List input method:

Data values must be separated by at least one blank space. Any character data value does not have embedded space. In these cases we use list input method.

Storage capability for list input method.

It stores 8 charecters for character variable

12 digits for numeric variable.

Length statement:

To register the variable and increase storage capability for character variable.

We can increase up to 256 charecters for character variable.

Infile Data dm;

cards;

Length name$ 13.;

Input pid name$ age gender$;

101 kirankumar 34 male

102 laxmikanth 32female

103 pavani 34 female

;

Proc print data=dm;

Run;

Named input method:

Some times in raw data, data values available with variables names. In those cases we can use named input method.

data demo;

infile cards;

length name$13;

input pid= age= name= $;

cards;

pid=123 age=34 name=kiranrao

pid=201 age=59 name=pavankumar

pid=202 age=23 name=lavakumar

;

proc print data=demo;

run;

Advanced input method;

&modifier

Colon : modifier

& Modifier:to over come the embedded spaces and specifies more than one space as a delimeter.

: colon modifier

To increase the storage capability for character variable.

Example

advnced input method

data emp2;

infile cards;

input eid name&:$13. gender$;

cards;

101 kiran kumar male

102 pavan kumar male

103 kranthi female

;

proc print data=emp2;

run;

Informant technique:

We will write in datastep block.

Using informant technique you can read non standard data into standard data.

Using informant technique we can read date values into number value (standard format).

These number otherwise calls as SAS date value.

data medi;

input pid jdate;

informat jdate ddmmyy10.;

cards;

200 01\01\1960

201 01\01\1961

202 12\12\1970

203 23\03\1989

;

proc print data=medi;

format jdate ddmmyy10.;

run;...