data sample;
input ID$ type income @@;
cards;
1 1 200 1 2 300 1 3 100 2 1 200 2 3 100 2 4 100
;
run;
data new_sample;
set sample;
by id;
retain new_income;
if first.id then do;
new_income=0;
new_income+income;
if last.id then out new_sample;
run;

|
楼主: 2286116865
|
10719
10
[问答] 请教retain语句 |
|
已卖:207份资源 讲师 16%
-
|
回帖推荐 | ||
|
|
| ||
| ||
| ||
| ||
| ||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


