SAS Certified Base Programmer 123 Questions (112)
The contents of the raw data file SIZE are listed below:
----|----10---|----20---|----30 72 95
The following SAS program is submitted:
data test; infile 'size'; input@ 1 height 2. @ 4 weight 2; run;
Which one of the following is the value of the variable WEIGHT in the output data set?
A. 2
B. 72
C. 95
D. . (missing numeric value)
Topics:
SAS Base Questions |
10 Comments »
A
Can you give some explanation?
Weight is assigned value of 2, instead of using a 2. informat. try it.
above explaination is worng…its is not assigning value 2…but it is selecting column 2 value from raw file which is 2…try with the different numbers….
james is correct
@3, I think your explanation is wrong, weight 2 means column input, so input value of 2, you can try weight 1, then you will find the value of weight is 7.
D is the correct answer try it
wrong explanation James, the 2 is read from the second column of the raw data file. Please check.
data testwe;
input@ 1 height 2. @ 4 weight 2;
cards;
72 95
;
run;
i tried this program but it is giving me value for both height and weight as a missing…could you please explain why the answer is 2 for the weight?
1 is “7”2 95 =7
2 is 7″2″ 95 =2
3 is 72″ “95 =.
4 is 72 “9”5 =9
5 is 72 9″5″ =5
am i clear? haha.