data1为
rq mc mr
2009-01-06 1111 1233
2009-01-07 1611 1293
2009-01-08 1311 1933
2009-01-09 1121 1203
2009-01-12 1115 1663
data2为
rq mc mr
2009-01-15 1111 1233
2009-01-17 1211 1263
2009-01-18 1311 1953
请问如何提取每个数据集的最后一行,生成一个新的数据集test?谢谢!

|
楼主: 人生海海
|
3485
3
[原创博文] (求助)如何提取每个数据集的最后一行,生成一个新的数据集 |
|
硕士生 32%
-
|
回帖推荐losttemple 发表于2楼 查看完整内容 常规当然是用macro咯,用call execute也是蛮好玩的
proc sql;
create table dd as
select memname
from dictionary.tables
where libname='WORK'/* or a permanent libref */ & memname like 'DATA%';
quit;
data _null_;
set dd;
call execute('data '||'_'||strip(memname)||'; set '||memname||' end=eof; if eof then output; run;');
run;
data _null_;
set dd end=eof;
if _n_=1 then cal ...
本帖被以下文库推荐
| ||
|
|
| ||
|
|
||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


