Hello
In following example there are 2 missing values in observation2 and 1 missing value in observation1.
There are 5 observations.
SAS fail to read it correctly.
May anyone correct the code below and explain
data weight3;
infile datalines missover;
input IDnumber $ Week1 Week16;
WeightLoss2=Week1-Week16;
cards;
2477 195 163
2431
2456 173 155
2412 135 116
148 143
;
Run;
Add an exact pointer to the IDNumber variable like this
data weight3;
infile datalines missover;
input IDnumber $ 1-4 Week1 Week16;
WeightLoss2=Week1-Week16;
cards;
2477 195 163
2431
2456 173 155
2412 135 116
148 143
;
Run;
Add an exact pointer to the IDNumber variable like this
data weight3;
infile datalines missover;
input IDnumber $ 1-4 Week1 Week16;
WeightLoss2=Week1-Week16;
cards;
2477 195 163
2431
2456 173 155
2412 135 116
148 143
;
Run;
data weight3;
input IDnumber $ 1-4 Week1 6-8 Week16 11-13;
WeightLoss2=Week1-Week16;
cards;
2477 195 163
2431
2456 173 155
2412 135 116
148 143
;
Run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.