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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.