In a PROC SORT KEY statement, the ASCENDING option modifies all
the variables that it follows. The option must follow the /. In the following
example, the x1 variable in the input data set is sorted in ascending order.
proc sort data=sortVar out=sortedOutput;
key x1 / ascending;
run;
DESCENDING
reverses the sort order for the variable that it follows in the statement so that
observations are sorted from the largest value to the smallest value. The
DESCENDING keyword modifies all the variables that it precedes in the KEY
statement.
Alias
DESC
Default
ASCENDING (ASC) is the default sort order.
Tip
In a PROC SORT KEY statement, the DESCENDING option ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.