SO For example I have data like this,
KEY first count
11Y 1
11Y 2
11N 3
11N 4
11Y 5
11N 6
I want out put like this
KEY first count RANKS
11Y 1 1
11Y 2 1
11N 3 2
11N 4 2
11Y 5 3
11N 6 4
how can I do in SAS?
Thanks
I did this
proc sort data=step3;
by first_count key;
run;
data step4;
set step3;
by key;
if first.key THEN ranks=1;
else ranks+1;
run;
This causing error
ERROR: BY variables are not properly sorted on data set WORK.STEP3