Try this:
Code:data student; input student mark; datalines; 01 15 01 04 01 11 02 09 02 02 02 15 03 01 03 15 03 24 run; proc sort data=student; by student mark; run; data student2; set student; by student; if first.student then do; seq0 = 1; output; end; run; data student3; merge student (in=a) student2 (in=b); by student mark; if a; if a and not b then seq0=0; run; data student_final; set student3; retain seq; if seq0 ne 0 then seq=seq0; else seq=seq+1; drop seq0; run;





Reply With Quote
