proc sort data=a1;
by patient number date;
run;
data a2;
set a1;
by patient number date;
if last.patient then output;
run;作者: shiyiming 时间: 2008-12-1 21:00 标题: Re: 请教一个数据筛选的问题 data a;
input id $ doctor$ times;
cards;
1 aa 1
1 bb 1
1 cc 1
1 dd 1
2 ee 3
2 ff 1
2 gg 2
3 hh 5
;
run;
proc sort data=a;
by id times;
data d;
set a;
by id;
if last.id then output;
run;
这个程序应该可以实现啦,注意这里
data d;
set a;
by id;
by后面只有id就可以拉,如果在加上其他变量就是错误的拉作者: shiyiming 时间: 2008-12-1 22:17 标题: Re: 请教一个数据筛选的问题 谢谢回复!作者: shiyiming 时间: 2008-12-2 16:13 标题: Re: 请教一个数据筛选的问题 如果考虑时间,则
proc sort data=a;
by patient number date;
run;
data b;
set a;
by patient ;
if last.patient then output;
run;