全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2195 3
2016-11-18
代友转发,请教论坛各位大拿SAS ADV的一些题目难点,请多多指点。手上还有几个论坛币,可以略表心意。谢谢!!


7.  Why D?  I think A and D are both wrong.

Which one of the following programs contains a syntax error?
A.      proc sql;
select product.*, cost.unitcost, sales.quantity
from product p, cost c, sale s
where p.item = c.item and p.item = s.item;
quit;
B.      proc sql;
select product.*, cost.unitcost, sales.quantity
from product , cost , sale
where product.item = cost.item and product.item = sales.item;
quit;
C.      proc sql;
select p.*, cost.unitcost, sales.quantity
from product as p , cost as c , sale as s
where p.item = c.item and p.item = s.item;
quit;
D.      proc sql;
select p.*, cost.unitcost, sales.quantity
from product , cost , sale
where product.item = cost.item and product.item = sales.item;
quit;


14.  Why D?
Consider the following SAS log:
229 data sasuser.ranch sasuser.condo / view = sasuser.ranch;
230 set sasuser.houses;
231 if style='RANCH' then output sauser.ranch;
232 else if style='CONDO' then output sasuser.condo;
233 run;
NOTE: DATA STEP view saved on file SASUSER.RANCH. NOTE:
A stored DATA STEP view cannot run under a different operating system.
234 235 proc print data = sasuser.condo;
ERROR: File sasuser.condo data does not exist.
236 run;
NOTE: The SAS system stopped processing this step because of errors.

Which one of the following explains why the PRINT procedure fails?
A. sasuser.condo is a stored DATA STEP program.
B. A SAS data file and SAS data view cannot be created in the same DATA STEP.
C. A second VIEW= sasuser.condo OPTION was omitted on the DATA statement.
D. The view sasuser.ranch must be processed before sasuser.condo is created.

21. Why D not C?
The following SAS program is submitted:
%let lib = %upcase (sasuser);
pro sql;
select nvar from dictonary.tables
where libname = "&lib";
quit;
Given that several SAS data sets exist in the SASUSER library, which one of the following is generated as output?
A.      no result set
B.      a syntax error in the log
C.      a report showing the names of each table in SASUSER
D.      a report showing the number of columns in each table in SASUSER

22. Why A?
Given the following SAS data set ONE:
ONE GROUP SUM
A 765
B 123
C 564
The following SAS program is submitted:
data _null_;
set one;
call symput (group, sum);
run;
Which one of the following is the result when the program finishes execution?
A.      Macro variable C has a value of 564.
B.      Macro variable C has a value of 1452.
C.      Macro variable GROUP has a value of 564.

D.      Macro variable GROUP has a value of 1452.
二维码

扫码加我 拉你入群

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

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

全部回复
2016-11-24 22:27:04
第7题,D的错误很明显。
from product,没有把 product命名为 p,前面直接写“select p.*”肯定会报错,计算机怎么知道 p指的是哪张表?
二维码

扫码加我 拉你入群

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

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

2016-11-24 22:36:28
第22题。
symput要生成的宏变量名字是group,但是SAS同时处理的数据集中有个变量名也是group,所以symput真正生成的宏变量的名字是“group变量当前的value"。最终是不存在宏变量group的。
data步每处理一条观测,宏变量"group的value"的值就会被刷新一次。data步处理的最后一条观测是C 564,
所以最后生成一个宏变量C,它的值是当前观测中sum的值564.
Macro variable C has a value of 564。
二维码

扫码加我 拉你入群

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

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

2016-11-25 17:16:47
512002855 发表于 2016-11-24 22:36
第22题。
symput要生成的宏变量名字是group,但是SAS同时处理的数据集中有个变量名也是group,所以symput真 ...
谢谢回复指点
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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