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.
|