Somethings wrong about the code above.
The correct syntax would be.
proc sort data = yourdata; /* arrange data by id, and descending date */
by id descending date;
run;
proc sort nodupkey; /* keep first id of each group */
by id;
run;
OR:
proc sort data = yourdata; /* arrange data by id, and descending date */
by id descending date;
run;
data yourdata; /* keep first id of each group */
set yourdata;
by id;
if first.id;
run;
both do the same.
Greetings from Portugal.
Daniel Santos at
www.cgd.pt.