全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3163 10
2010-01-13
Consider the following data step:
data WORK.NEW /debug;
    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.

My amswer is A.
Please give any comment.
二维码

扫码加我 拉你入群

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

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

全部回复
2010-1-13 17:11:26
C .

the SUM statement is a compile-time instruction exactly equivalent to using the SUM function and the RETAIN statement:
   retain variable 0;
  variable=sum(variable,expression);

so.....
data WORK.NEW /debug;
    set WORK.OLD;
  retain count 0;
    count=sum(Count,1);
run;
二维码

扫码加我 拉你入群

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

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

2010-1-13 21:58:12
请问这是今天的考题吗?我15号考试,能加我吗?MSN:benwan2009@hotmail.cm。QQ:913348978
二维码

扫码加我 拉你入群

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

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

2010-1-13 22:11:09
c,昨天我考的时候有这一题
二维码

扫码加我 拉你入群

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

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

2010-1-14 00:16:45
It seems not  work in SAS with  "/debug".
二维码

扫码加我 拉你入群

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

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

2010-1-14 08:21:13
lqyrendajinji 发表于 2010-1-13 15:05
Consider the following data step:
data WORK.NEW /debug;
    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.

My amswer is A.
Please give any comment.
Here is a way to see.

206  data t1;
207    x=1;
208    output; output; output;
209    run;

NOTE: The data set WORK.T1 has 3 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


210
211  data _null_;
212    put '0>>> ' _all_;
213    stop;
214    do until(end);
215    put '1>>> ' _all_;
216    set t1 end=end nobs=nobs;
217     put '2>>>' _all_;
218    c+1;
219     put '3>>>' _all_;
220     end;
221   run ;

0>>> end=0 nobs=3 x=. c=0 _ERROR_=0 _N_=1
NOTE: There were 1 observations read from the data set WORK.T1.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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