Hello,
I used the following SAS code to get cumulative count
proc freq data=have ;
tables pass2013/OUTCUM list missing out=want;
run;
then I used the following to sort by descending of cumulative count
proc sort data=want; by CUM_FREQ descending; run;
But got error message of "Variable NAME not found" as following
ERROR: Variable NAME not found.
ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_,
_NUMERIC_.
Please help.
thanks!
Hi,
read the doc about descending option:
proc sort data=want;
by descending CUM_FREQ ;
run
All the best
Bart
Hi,
read the doc about descending option:
proc sort data=want;
by descending CUM_FREQ ;
run
All the best
Bart
thanks much for the help!
You may want to consider adding the option ORDER=FREQ to the Proc Freq. The output will be sorted by descending frequency of the variable. That is not exactly what your current output creates but it may be of interest.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.