全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3390 4
2007-03-08

我都不清楚这两题想考的是什么? 类似但答案不同,请大家帮忙.....

1.The contents of raw data file EMPLOYEE are listed below:
----|----10---|----20---|----30
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $1-4;
if employee_name ='Sue' then input age 7-8;
else input idnum 10-11;
run;
Which one of the following values does the variable AGE contain when the name of the employee is "Sue"?
A 30
B 33
C 40
D .(missing numeric value)

The result is C.


2.The contents of raw data file EMPLOYEE are listed below:
----|----10---|----20---|----30
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $1-4;
if employee_name ='Ruth' then input idnum 10-11;
else input age 7-8;
run;
Which one of the following values does the variable IDNUM contain when the name
of the employee is "Ruth"
A 11
B 22
C 32
D .(missing numeric value)

The result is B

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-3-8 16:33:00
First, the two programs test the same point.

Second, the test point is below:
The first input statment read one record.
And the second input statement will read next record.

If you want to read the same line, you should use trailing @, which will hold current record.
e.g: input employee_name $1-4 @;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-9 05:51:00

I am lost.

I know if no trailing @, will read next record :idnum or age, however,how to deal with next record :name? we can omit it ?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-9 21:31:00

看明白了,呵呵,谢谢啊

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-9 21:44:00
多亏这么前辈了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群