data test1;
set test;
by group;
if first.group then count=0;
count + 1;
if last.group then output;
run;
proc sort data=test;
by group;
run;
proc sort data=test1;
by group;
run;
data test;
merge test test1;
by group;
run;
这样呢?不过外面加了proc sort和新的data step,
