The contents of the raw data file FURNITURE are listed below:
--------10-------20-------30
chair,,table
chair,couch,table
The following SAS program is submitted:
data stock;
infile 'furniture' dsd;
input item1 $ item2 $ item3 $;
run;
Which one of the following is the value of the variable named ITEM2 in the first observation of the output data set?
A. table
B. ,table
C. . (missing numeric value)
D. ' ' (missing character value)
Click Comment link to get answer
'D'
ReplyDeletecan some one please explain why it is D
ReplyDeletethanks
with DSD option two consecutive delimiters are not consider as one, so missing value is assigned to item2 and as item2 is character variable it has missing character value " ". Without DSD Item2 will be table. Hopefully that helps.
ReplyDeletehi..without dsd it should be error...
ReplyDeleteyes.without dsd it will be error.else you should use dlm=',' option.then consecutive commas will be considered as one.the dataset will have only one observation.for the second reord it will go past the record.
ReplyDeleteD
ReplyDelete