SAS中文论坛

标题: 请教一个关于Do-loop的问题 [打印本页]

作者: shiyiming    时间: 2012-4-21 11:12
标题: 请教一个关于Do-loop的问题
[b:2f174cx5]In the data set Work.Invest, what would be the stored value for Year?[/b:2f174cx5]     

Data work.invest;
        Do year=1990 to 2004;
        capital+5000;
        capital+(capital*.10);
       end;
run;
a.missing    b.1990   c.2004    d.2005

这个时候year的值是怎么变化的(答案是D)?

Which of the following statements is false regarding the program shown below?
data work.invest;
do year=1990 to 2004;
Capital+5000;
capital+(capital*.10);
output;
end;
run;
a. The OUTPUT statement writes current values to the data set immediately.
b. The stored value for Year is 2005.
c. The OUTPUT statement overrides the automatic output at the end of the DATA step.
d. The DO loop performs 15 iterations.

题干相近增加了output产生了什么样的变化呢?(答案选B)
作者: shiyiming    时间: 2012-4-21 20:09
标题: Re: 请教一个关于Do-loop的问题
i run the statements seperately and found that the anwsers are right.
so weird.




欢迎光临 SAS中文论坛 (http://www.mysas.net/forum/) Powered by Discuz! X3.2