全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1895 2
2015-02-27

QUESTION 111
A SAS PRINT procedure output of the WORK.LEVELS data set is listed below:
Obsname level
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
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,为什么B对呢?我遗漏了什么的?请会的大神帮忙解答一下,小女先谢谢了!!!
二维码

扫码加我 拉你入群

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

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

全部回复
2015-2-28 15:27:27
这里需要注意一下第三个if句:if level=2 or 3,这个句子相当于if level=2 or if 3而不是if level=2 or if level=3.因为if 3总为真,所以if level=2 or 3这个总为true,会执行then中的expertise='Medium',而永远不会执行到下面的else expertise='High'。
希望能对楼主有所帮助~~~
二维码

扫码加我 拉你入群

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

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

2015-3-1 07:30:35
lime_kim 发表于 2015-2-28 15:27
这里需要注意一下第三个if句:if level=2 or 3,这个句子相当于if level=2 or if 3而不是if level=2 or if  ...
有帮助,谢谢!!!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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