ORDERBY= Data Set Option

specifies the variables by which to order the data within a partition.

Adding a Table to HDFS with Partitioning

Syntax

ORDERBY=(variable-list)
ORDERBY=(variable-name <DESCENDING> variable-name)

Details

The variable names in the variable-list are separated by spaces.
The ordering is hierarchical. For example, ORDERBY=(A B) specifies ordering by the values of variable B within the ordered values of variable A. The specified variables must exist and cannot be specified as partitioning variables. The order is determined based on the raw value of the variables and uses locale-sensitive collation for character variables. By default, values are arranged in ascending order. You can specify descending order by preceding the variable name in the variable-list with the keyword DESCENDING.

Example

The following code sample orders the data in the partitions by Year in ascending order and then by Quarter in descending order.
data hdfs.prdsale (partition=(country region)
                   orderby=(year descending quarter));
    set sashelp.prdsale;
run;