全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4442 8
2008-08-25
109. The contents of the 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)
Answer: C(不知道怎末得出

110. The contents of the 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)
Answer: B(不知道怎末得出的)


111. A SAS PRINT procedure output of the WORK.LEVELS data set is listed
below:
Obs name level
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
A00-211
- 34 - http://www.ePlanetLabs.com
5 Burt 4
6 Kelly .
7 Juan 1
The following SAS program is submitted:
data work.expertise;
set work.levels;
if level = . then
expertise = 'Unknown';
else if level = 1 then
expertise = 'Low';
else if level = 2 or 3 then
expertise = 'Medium';
else
expertise = 'High';
run;
Which of the following values does the variable EXPERTISE contain?
A. Low, Medium, and High only
B. Low, Medium, and Unknown only
C. Low, Medium, High, and Unknown only
D. Low, Medium, High, Unknown, and ' ' (missing character value)
Answer:B(为何不是C呢)

谢谢

二维码

扫码加我 拉你入群

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

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

全部回复
2008-8-25 14:40:00

先给你回答第一个问题

input employee_name $ 1-4 @@;

这是input读取数据的时候,前后两个如果不加 @@,就读成两条了,

[em01]
二维码

扫码加我 拉你入群

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

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

2008-8-25 15:36:00

第二题 跟第一个是一个问题。

第三题:else if level = 2 or 3 then

编译的时候,会自动将这个式子自动判断为 TRUE.所以,不会出来High 这一项

你可以写 else if level =2 or level = 3 then 或者 else if level = in(2:3) then

good luck

[em01]
二维码

扫码加我 拉你入群

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

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

2008-8-25 22:45:00
但是109/110还是不明白,如果不加@@的话,在109题为何读出40呢? 谢谢
二维码

扫码加我 拉你入群

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

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

2008-8-26 00:14:00

他的结果是

Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44

input 你只是读入了name这个变量,而对于这一行后面的 你想要继续读的话 就要加 @@了,不然他会另起一行的。

[em01]
二维码

扫码加我 拉你入群

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

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

2009-6-8 14:26:00
[em17][em17]
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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