41.A raw data file is listed below.
1---+----10---+----20---+---
01/05/1989 Frank 11
12/25/1987 June 13
01/05/1991 Sally 9
The following SAS program is submitted using the raw data file as input:
data work.family;
infile 'file-specification';
input @1 date_of_birth mmddyy10.
@15 first_name $5.
@25 age 3;
run;
proc print data=work.family noobs;
run;
Which one of the following is the result?
a. The program executes, but the age values are missing in the output.
b. The program executes, but the date values are missing in the output.
c. The program fails to execute because the age informat is coded incorrectly.
d. The program fails to execute because the date informat is coded incorrectly.
Correct answer: a
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)
Answer: A
这两个题都是input format 缺少一个. ,为什么结果不一样(上机测试结果证明答案没错),为什么@25 age 3; age的值是missing 而不是3?请高手解惑,谢谢!
测试用code:
data work.family;
input @1 date_of_birth mmddyy10.
@15 first_name $5.
@25 age 3;
cards;
01/05/1989 Frank 11
12/25/1987 June 13
01/05/1991 Sally 9
;
run;
proc print data = family;
run;
data test;
infile cards;
input @1 height 2. @4 weight 2;
cards;
72 95
;
run;
proc print data = test;
run;