*Copyright @ www.mycsg.in;
Preparatory steps
*null value representation in sas for character and numeric variables;
*two automatic variables in sas: _error_ and _n_;
*Another automatic variable in sas: _infile_;
Basic code
usage of put statement
Notice the usage of keyword '_all_', which is used to display all the variables'
values in log
Single put statement: after agemon variable
*Single put statement: before agemon variable;
*notice that agemon variable has a missing value in log file;
*Two put statements: before and after agemon variable;
*notice that agemon variable has a missing value in log file in 'before' put but has a value
in 'after' put statement;
*Two put statements: before input and after agemon variable;
*notice that agemon variable has a missing value in log file in 'before' put but has a value
in 'after' put statement;
*Three put statements: before input, after input and after agemon variable;
*notice that agemon variable has a missing value in log file in 'before' put but has a value
in 'after' put statement;
data pdv02;
infile cards;
put "Before input statment: " _all_ /;
input subjid age sex$;
put "After input statment: " _all_ ;
agemon=age*12;
put "After Creating agemon variable: " _all_ /;
cards;
1015 63 F
1023 64 M
1028 71 M
;
run;