@komalbatra wrote: i think there is 3 spaces between next code that was reason for 2 missing value coming in the output .if i try with 2 spaces its coming fine. Thank you.
DSD treats 2 consecutive delimiters as one missing, when you have 3 as the example data shows then the result is 2 missing variables.
The blanks at column 2 and 3 are the first pair and then at columns 3 and 4 are a second pair.
If possible determine why the data source is placing a space for a missing value and see if it may be corrected there, especially if this is going to be a process repeated on files going forward such as every week or
If the problem is regular enough this edit to the input line before inputting the variables may fix the problem:
data demo;
infile datalines dlm=' ' dsd;
input @;
_infile_= tranwrd(_infile_,' ',' ');
input gender $ age height weight;
datalines;
M 50 68 155
F 60 101
M 65 72 220
F 35 65 133
M 15 71 166
;
run;
... View more