Output 2.20 Sorting by Columns That Are Not Selected
Specifying a Different Sorting Sequence
SORTSEQ= is a PROC SQL statement option that specifies the sorting sequence for
PROC SQL to use when a query contains an ORDER BY clause. Use this option only if
you want to use a sorting sequence other than your operating environment's default
sorting sequence. Possible values include ASCII, EBCDIC, and some languages other
than English. For example, in an operating environment that supports the EBCDIC
sorting sequence, you could use the following option in the PROC SQL statement to set
the sorting sequence to EBCDIC:
proc sql sortseq=ebcdic;
In the third maintenance release for SAS 9.4, linguistic collation is supported with the
SORTSEQ statement option. For more information, see “SORTSEQ=sort-table |
LINGUISTIC” on page 229.
Note: SORTSEQ= affects only the ORDER BY clause. It does not override your
operating environment's default comparison operations for the WHERE clause.
Operating Environment Information
For more information about the default and other sorting sequences for your
operating environment, see the SAS documentation for your operating environment.
Sorting Columns That Contain Missing Values
PROC SQL sorts nulls, or missing values, before character or numeric data. Therefore,
when you specify ascending order, missing values appear first in the query results.
Sorting Data 43