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.
Missed SAS Innovate in Orlando?
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.