楼主: cngd1
2252 3

[问答] 请教SAS ADV问题 [推广有奖]

  • 0关注
  • 0粉丝

本科生

41%

还不是VIP/贵宾

-

威望
0
论坛币
24 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
12897 点
帖子
58
精华
0
在线时间
108 小时
注册时间
2013-5-6
最后登录
2016-11-25

楼主
cngd1 发表于 2016-11-18 17:29:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
代友转发,请教论坛各位大拿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.
二维码

扫码加我 拉你入群

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

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

关键词:Processing following Data step Procedure operating following programs product error 大拿

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

藤椅
512002855 发表于 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。

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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 16:12