data have;
input ClassID;
datalines;
1
1
1
2
2
2
3
3
3
3
;
run;
data want;
set have;
by ClassID;
retain ID;
if first.ClassID then ID = 1;
else ID = ID + 1;
output;
run;
Note: I am assuming your input data is sorted by ClassID.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and save with the early bird rate—just $795!