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;
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)
A. table
B. ,table
C. . (missing numeric value)
D. ' ' (missing character value)
6 comments:
Answer D
Item2 is defined as character and the dsd option will assign missing value to it as there are two commas.
In the following program, the answer is D. This is
because, you are using a 'dsd' condition
at the end of infile. The 'dsd' allows the SAS
to read consecutive commas which have no space
between them.
data stock;
infile cards dsd;
input item1 $ item2 $ item3 $;
cards;
chair,,table
chair,couch,table
;
run;
However if a dlm=',' is used then the result is
Chair Table Chair. The comma is not accepted. Only
observations is obtained.
If there is a gap between the commas in the first
observation, then you can use dsd or dlm to give
you answer- D.
yes the answer is D as dsd option is used. Also, Item2 is a character variable.
D
A BLANK SPACE FOR MISSING CHARACTER VALUE
A(.) PERIOD FOR MISSING NUMERIC
ApplY Online for DSE Nagaland Recruitment
HPPSC Recruitment Notification 2017 Download Here
Click Here PGCIL Executive Trainee Recruitment Notification
This unique representation extends computational possibilities and data encoding, Having Games Bad contributing to niche applications that demand intricate and efficient numerical encoding.
Post a Comment