那就综合一下,把所有最大记录保存下来
proc sort data=a;
by id descending time;
data b;
retain max;
set a;
by id;
if first.id then do;
max=time;
output;
end;
else
if time=max then output;
drop max;
run;
我这边不能试,这个可能更简洁点
[code:b042b]proc sort data=a;
by id descending time;
data b;
set a;
by id;
if first.id or time=lag(time);
run;[/code:b042b]