proc sort data=have;
by customerID descending amount;
run;
data want;
set have;
by customerID;
if first.caseID then count=0;
count+1;
if count <= 2;
run;
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.