03-02-2013 11:46 AM
here is my codes,but there are some mistakes. I do not know why the statement n=_N_ is wrong.
by using n=_N_, I want to get the serial number of the observations。
are there anyother to get the serial number of the observations?
proc sort data=raw;
by stkcd year month;
proc sort data=raw; out=b;
by decending n;
who can rewrite some code for me ? thank you very much.
03-02-2013 11:52 AM
_n_ can only be used in a datastep. Just remove that line from your proc sort call and preface the code with a simple datastep. e.g.: