SAS Certified Base Programmer 50 Questions (33)
The following SAS program is submitted:
data test; input animal1 $ animal2 $ mlgrams1 mlgrams2; cards; hummingbird ostrich 54000.39 90800000.87 ; run;
Which one of the following represents the values of each variable in the output data set?
a.
animal1 animal2 mlgrams1 mlgrams2 hummingb ostrich 54000.39 90800000
b.
animal1 animal2 mlgrams1 mlgrams2 hummingb ostrich 54000.39 90800000.87
c.
animal1 animal2 mlgrams1 mlgrams2 hummingbird ostrich 54000.39 90800000
d.
animal1 animal2 mlgrams1 mlgrams2 hummingbird ostrich 54000.39 90800000.87
Topics:
SAS Base Questions |
10 Comments »
B
WHY B? NOT hummingbird?
character and numeric variable by default take 8 length
I guess it is taking only 8 as the width by default for Char variables, as we have not specified the formatted length in the input stt.
because length is not specified then it will by default as 8…correct me if i am wrong!
to guest – Because character variable truncated after 8 character (default length)
Not hummingbird because the length of animal1 was not specified so it is automatically set to 8. Anything beyond the first 8 characters is cut off.
The default length without an informat is 8 bytes – makes it 8 characters
Why not is “a”?
isn’t the default length for numeric variable is 8 bytes as well?
why 90800000.87? i thought the answer would be 90800000 cuz in this way there r 8 digits of numbers