全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1782 2
2018-08-23
程序及报错信息如下:
32         data invest;
33         do year=2010 to 2018;
34         capital+5000;
35         capital*(1+4.5%);
           _______
           180
ERROR 180-322: Statement is not valid or it is used out of proper order.
36         end;
37         run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.INVEST may be incomplete.  When this step was stopped there were 0 observations and 2 variables.
WARNING: Data set WORK.INVEST was not replaced because this step was stopped.

上面是程序报错信息,修改后的程序如下,能正确显示结果。
data invest;
do year=2010 to 2018;
capital+5000;
capital+capital*0.045;
end;
run;

我的疑惑有3点:
      1、我知道%好像是宏代码的时候用的,但体现具体数字4.5%的时候也不能用吗?
      2、颜色标记的地方为什么不能合并呢?
      3、循环计算的时候,代码都是表达式,为什么不是等式呢?比如capital=capital+5000?
我是新手,目前在自学SAS,恳请各位大大帮忙解惑,谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2018-8-23 16:02:47
当你使用 capital+5000; 的时候,SAS会自动给captital加retain
二维码

扫码加我 拉你入群

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

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

2018-8-24 08:58:05
能详细一点嘛?有点点不太懂
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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