全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3044 3
2017-10-17
大家好,

我是个新手玩家。刚做完SAS 70题,有四道题想大家请教一下。我自己很抓狂。想不明白。
======================================
Question 32: Consider the follwing data step:
data WORK.NEW;
set WORK.OLD;
    Count +1;
run;

The variable Count is created using a sum statement. Which statement regarding this variable is true?
    A. It is assigned a value 0 when the data step begins execution.
    B. It is assigned a value of missing when the data step begins execution.
    C. It is assigned a value 0 at compile time.
    D. It is assigned a value of missing at compile time.

答案是C 但是我不明白。如果这道题是C,那么53题呢?
======================================
Question 53: The following SAS program is submitted:
data WORK.TOTAL_SALARY;
    retain Total;
    set WORK.SALARY;
    by Department;
    if First.Department then Total =0;
    Total = sum(Total, Wagerate);
    if Last.Total;
Run;

What is the initial value of the variable Total?
A.   0
B.   Missing
C.   Thevalue of the first observation Wagerate
D.   Cannot be determined from the information given.

Answer B. 我觉得这两道题很像,但不知道为什么答案不一样。
======================================
Question 63: The following SAS program is submitted:

data WORK.OUTDS;
     do until(Prod GT 6);
        Prod + 1;
     end;
run;

What is the value of the variable Prod in the output data set?

A.   . (missing)
B.   6
C.   7
D.   Undetermined, infinite loop.

Answer C. 我运行程序也是7, 但do until 不是尾部判断吗?当Prod = 7 的时候,不是依然运行至尾部吗?答案不是8吗?我真的不懂了。请大家帮助。
======================================
Question 45 The following SAS program is submitted:
ods csvall file='c:\test.cvs';
proc print data = WORK.ONE;
    var Name Score Grade;
    by IDNumber;
run;
ods csvall close;

What is produced as output?

A.  A file named test.cvs that can only be opened in Excel.
B.  A text file named test.cvs that can be opened in Excel or inany text editor.
C.  A text file named test.cvs that can only be opened in a text editor.
D.  A file named test.cvs that can only be opened by SAS.

Answer C. 可是crackman网站上说这个答案是B。请大家帮我确认一下,应该是那个答案?

对不起, 一下子问了这么多问题。求高手解答。





二维码

扫码加我 拉你入群

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

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

全部回复
2017-10-17 09:47:01
好冷清啊。顶一下。
二维码

扫码加我 拉你入群

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

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

2017-10-17 13:56:04
Question 32:
data test;
   set sashelp.class;
   count+1;
run;
等价于
data test;
   set sashelp.class;
   retain count 0;
   count=count+1;
run;

Question 53:
retain total;
等价于
retain total .;

Question 63:
do until是先运行再判断条件,再运行,判断条件,运行,判断条件...直到条件不满足马上停止!
所以最后的prod是7

Question 45:
cvs(不是csv)默认是不能用excel打开的,但是硬要打开也行。
二维码

扫码加我 拉你入群

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

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

2017-10-17 21:58:54
谢谢。受教了。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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