b******s 发帖数: 345 | 1 The contents of CALENDAR are listed below:
----|----10---|----20---|----30
01012000
The following SAS program is submitted:
data test;
infile 'calendar';
input @1 date mmddyy10.;
if date='01012000'd then event='january 1st';
run;
Which one of the following is the value of the EVENT variable?
A. 01012000
B. January 1st
C. .(missing numeric value)
D. The value can not be determined as the program fails to execute due to
errors.
Answer: D
程序运行后与D所说一致。不过我不知道这道题的考点是什么? 如果改动 date值,才
能使程序运行呢? 请指教,谢谢! |
s******r 发帖数: 1524 | 2 if date='01Jan2000'd then event='january 1st';
【在 b******s 的大作中提到】 : The contents of CALENDAR are listed below: : ----|----10---|----20---|----30 : 01012000 : The following SAS program is submitted: : data test; : infile 'calendar'; : input @1 date mmddyy10.; : if date='01012000'd then event='january 1st'; : run; : Which one of the following is the value of the EVENT variable?
|
b******s 发帖数: 345 | 3 我这样改动Date运行后,得到: SAS went to a new line when INPUT statement
reached past the end of a line
得不到event='january 1st'。谢谢回复!
【在 s******r 的大作中提到】 : if date='01Jan2000'd then event='january 1st';
|
s******r 发帖数: 1524 | 4 It looks like your file has problem.
data test;
input @1 date mmddyy10.;
if date='01jan2000'd then event='january 1st';
datalines;
01012000
;
run;
no error.
【在 b******s 的大作中提到】 : 我这样改动Date运行后,得到: SAS went to a new line when INPUT statement : reached past the end of a line : 得不到event='january 1st'。谢谢回复!
|
b******s 发帖数: 345 | 5 谢谢!
【在 s******r 的大作中提到】 : It looks like your file has problem. : data test; : input @1 date mmddyy10.; : if date='01jan2000'd then event='january 1st'; : datalines; : 01012000 : ; : run; : no error.
|