SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 762|回复: 1
打印 上一主题 下一主题

请教一个关于Do-loop的问题

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2012-4-21 11:12:29 | 只看该作者

请教一个关于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)
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2012-4-21 20:09:48 | 只看该作者

Re: 请教一个关于Do-loop的问题

i run the statements seperately and found that the anwsers are right.
so weird.
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-5-6 14:03 , Processed in 0.085477 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表