data banks;
input name $ rate;
cards;
First 0.0718
Direct 0.0721
Virtual 0.0728
;
run;
data newbank;
do year=1 to 3;
set banks;
capital + 5000;
end;
run;

|
楼主: nirdong
|
7510
14
[原创博文] SAS Base 求助 do loop |
|
本科生 46%
-
|
回帖推荐data newbank;
do year=1 to 3;
set banks;
capital + 5000;
end;
run;
如果不加output,是这样执行的:
1. year=1,读取banks的第一行,capital为5000;
2. year=2,读取banks的第二行,capital变为10000;
3. year=3,读取banks的第三行,capital变为15000;
4. year=4,跳出do循环,遇到run,将当前 year=4 name=Virtual rate=0.0728 capital=15000 输出到newbank,并返回到数据步data newbank语句;
5. y ...
本帖被以下文库推荐
| ||
|
|
| ||
|
和谐拯救危机
|
||
| ||
|
Let them be hard, but never unjust
|
||
| ||
|
和谐拯救危机
|
||
| ||
| ||
|
和谐拯救危机
|
||
|
Let them be hard, but never unjust
|
|
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


