BookmarkSubscribeRSS Feed
cjohnson
Obsidian | Level 7
I am trying to run a simple proc sort, and if I add the descending option, it errors:

14 PROC SORT DATA=GOVERNING_CLASS;
15 BY LR descending;
_
22
ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.
16 RUN;
ERROR: Variable NAME not found.


However, this runs fine:

PROC SORT DATA=GOVERNING_CLASS;
BY LR;
RUN;

Any ideas? I am running SAS 9.1, EG 4.1, and just installed the newest hotfix for errors.

Thanks,
Chris
Christopher Johnson
www.codeitmagazine.com
2 REPLIES 2
data_null__
Jade | Level 19
The keyword DESCENDING goes before the variable that you want to sort descending.
cjohnson
Obsidian | Level 7
Thanks!!!
Christopher Johnson
www.codeitmagazine.com

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 7667 views
  • 2 likes
  • 2 in conversation