由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 问道 SAS BASE 的 Sample Questions
相关主题
SAS Base 123题再一问...请教一个SAS Macro的问题
Base 70 第35题怎么理解? 谢谢。请教 sas base 70题 第46题
a SAS Code issueSAS Base 70题 第20题求教
考完Base SAS,汇报一下where is error in SAS
请问熟悉SAS IML的about Q70 of sas base
why this error in %if statementApril 22/ 2014 SAS BASE PASS
请教SAS BASE 11月真题18题SAS code error?
问个SAS BASE 中有关_ERROR_的问题SAS base question
相关话题的讨论汇总
话题: bmi话题: where话题: sas话题: statement话题: error
进入Statistics版参与讨论
1 (共1页)
b******s
发帖数: 345
1
不懂这道题的考点在哪?知道的请说说。
Item 9
Given the following SAS error log
44 data WORK.OUTPUT;
45 set SASHELP.CLASS;
46 BMI=(Weight*703)/Height**2;
47 where bmi ge 20;
ERROR: Variable bmi is not on file SASHELP.CLASS.
48 run;
What change to the program will correct the error?
A.Replace the WHERE statement with an IF statement
B.Change the ** in the BMI formula to a single *
C.Change bmi to BMI in the WHERE statement
D.Add a (Keep=BMI) option to the SET statement
correct_answer = "A"
不明白为什么换成if就可以了?请指教,谢谢!
b******s
发帖数: 345
2
自己顶一下

【在 b******s 的大作中提到】
: 不懂这道题的考点在哪?知道的请说说。
: Item 9
: Given the following SAS error log
: 44 data WORK.OUTPUT;
: 45 set SASHELP.CLASS;
: 46 BMI=(Weight*703)/Height**2;
: 47 where bmi ge 20;
: ERROR: Variable bmi is not on file SASHELP.CLASS.
: 48 run;
: What change to the program will correct the error?

d******9
发帖数: 404
3
There is a big difference between IF and WHERE:
WHERE functions at compile stage, but IF is at the execution stage.
So,
BMI=(Weight*703)/Height**2;
where bmi ge 20;
The var BMI is created after the execution, thus SAS can not find this var
when it is referenced in WHERE clause.
b******s
发帖数: 345
4
谢谢!

【在 d******9 的大作中提到】
: There is a big difference between IF and WHERE:
: WHERE functions at compile stage, but IF is at the execution stage.
: So,
: BMI=(Weight*703)/Height**2;
: where bmi ge 20;
: The var BMI is created after the execution, thus SAS can not find this var
: when it is referenced in WHERE clause.

1 (共1页)
进入Statistics版参与讨论
相关主题
SAS base question请问熟悉SAS IML的
SAS base 123 question 38 疑问why this error in %if statement
最近有人考Adv没??请教SAS BASE 11月真题18题
a SAS question in base 70问个SAS BASE 中有关_ERROR_的问题
SAS Base 123题再一问...请教一个SAS Macro的问题
Base 70 第35题怎么理解? 谢谢。请教 sas base 70题 第46题
a SAS Code issueSAS Base 70题 第20题求教
考完Base SAS,汇报一下where is error in SAS
相关话题的讨论汇总
话题: bmi话题: where话题: sas话题: statement话题: error