SAS (Base SAS)+
data CLASS;
infile datalines dlm='|' dsd missover;
input Name : $8. Sex : $1. Age : best32. Height : best32. Weight : best32.;
datalines;
Alfred|M|14|69|112.5
Alice|F|13|56.5|84
Barbara|F|13|65.3|98
;
run;
- To create an inline dataset in SAS, we use a
DATAstep followed byinfile datalinesand aninputstatement describing each variable. dlm='|'tells SAS the values are pipe-separated.dsdactivates delimiter-sensitive data handling so empty fields are treated as missing.missoverprevents SAS from reading past the end of a short line.- The
inputstatement declares each variable with its informat —$8.for an 8-character name,$1.for sex,best32.for flexible numeric reads. - After the
datalines;statement we list the raw rows, terminated by a bare semicolon. run;executes the step and writes the resulting CLASS dataset to the WORK library.