楼主: baiduqiqi
1742 2

[问答] 关于output 的SAS程序 [推广有奖]

  • 15关注
  • 3粉丝

已卖:9份资源

博士生

23%

还不是VIP/贵宾

-

威望
0
论坛币
304 个
通用积分
0
学术水平
0 点
热心指数
2 点
信用等级
0 点
经验
4565 点
帖子
198
精华
0
在线时间
162 小时
注册时间
2012-3-17
最后登录
2024-2-22

楼主
baiduqiqi 在职认证  发表于 2012-8-12 16:57:10 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
OUTPUT我一直理解不了,又跟没有时区别;
比如
do x=1 to10;
a+x;
run;

do x=1 to10;
a+x;
output;
run;
的区别在哪里?
另外如果在加入retain 情况又将如何呢?
再比如书上例子:
1、In the data set Work.Invest, what would be the stored value for Year?
data work.invest;
do year=1990 to 2004;
Capital+5000;
capital+(capital*.10);
end;
run;
a. missing
b. 1990
c. 2004
d. 2005
这个答案为D
2、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.
这个答案为B,这不是与上面的正好相反吗?!求大神解答!
二维码

扫码加我 拉你入群

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

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

关键词:output sas程序 outpu Out put 程序

沙发
chenys625 发表于 2012-8-13 14:51:33
答案没有问题! output相当于把循环当条的观察输出出来,没有output就不输出。因此没有output时,year读到2005不满足条件然后停了。有output就是当满足循环条件的时候都输出。

藤椅
chenys625 发表于 2012-8-13 14:52:17
对了 retain就是保留变量上一个的观测值

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

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