由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请问base(123题)的第114题
相关主题
请教两个关于SAS的问题大家给我提个醒吧,sas问题。
请教大家一个SAS问题请问sas中一个变量的内容被两个左斜杠(/)分成了三部分
sas读入数据时的一个问题请教SAS 问题
SAS 编程问题 (有包子)问SAS code怎么写
question about SAS BASE 123 NO.110新手问个简单的sas问题
Quick Question请教一个SAS问题
请教一个sas的sort date变量问题请教一个SAS问题
sas date variable exchangeask SAS code
相关话题的讨论汇总
话题: 01012000话题: date话题: january话题: event话题: 1st
进入Statistics版参与讨论
1 (共1页)
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.

1 (共1页)
进入Statistics版参与讨论
相关主题
ask SAS codequestion about SAS BASE 123 NO.110
请教SAS Base50中的41题Quick Question
也问几道SAS base 题目请教一个sas的sort date变量问题
请教SAS BASE 70题里的第17题sas date variable exchange
请教两个关于SAS的问题大家给我提个醒吧,sas问题。
请教大家一个SAS问题请问sas中一个变量的内容被两个左斜杠(/)分成了三部分
sas读入数据时的一个问题请教SAS 问题
SAS 编程问题 (有包子)问SAS code怎么写
相关话题的讨论汇总
话题: 01012000话题: date话题: january话题: event话题: 1st