Proc sort data=have;
by id date;
run;
data want;
set have;
by id;
if first.id;
run;
When you use By processing in a data step SAS provides automatic variables that indicate whether a specific record is the first or last of a by group.
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.