Specification for data reading
source: \\sasserver\sas\source\dlm\data3.txt
Dataset: dm
Variables : name char, age num, gender char.
Delimiter: &
Application.
Data dm;
Infile '\\sasserver\sas\source\dlm\data1.txt' dlm='&';
Input name $ age gender $;
Run;
Double traling method : Using double trailing method can be captured more than one observation it is run input statement multiple times per line.
Data medi;
Infile cards;
Input pid visit dose @@;
Cards;
101 1 0.05 101 2 0.10 101 3 0.15
102 1 0.05 102 2 0.10 102 3 0.15
103 1 0.05 103 2 0.10 103 3 0.15
;
Advanced list input method:
& modifer: It controls the SAS system data values are separated by more than one space.
colon (:) modifier: specifies length and informat technique for requested variable
Syntax: (:n)
Data demo;
Infile cards;
Input pid name &:$ 12. age gender $;
Cards;
101 kiran kumar 45 male
102 kumar 56 male
103 laxmi kanth 34 female
;
source: \\sasserver\sas\source\dlm\data3.txt
Dataset: dm
Variables : name char, age num, gender char.
Delimiter: &
Application.
Data dm;
Infile '\\sasserver\sas\source\dlm\data1.txt' dlm='&';
Input name $ age gender $;
Run;
Double traling method : Using double trailing method can be captured more than one observation it is run input statement multiple times per line.
Data medi;
Infile cards;
Input pid visit dose @@;
Cards;
101 1 0.05 101 2 0.10 101 3 0.15
102 1 0.05 102 2 0.10 102 3 0.15
103 1 0.05 103 2 0.10 103 3 0.15
;
Advanced list input method:
& modifer: It controls the SAS system data values are separated by more than one space.
colon (:) modifier: specifies length and informat technique for requested variable
Syntax: (:n)
Data demo;
Infile cards;
Input pid name &:$ 12. age gender $;
Cards;
101 kiran kumar 45 male
102 kumar 56 male
103 laxmi kanth 34 female
;
No comments:
Post a Comment