16 Handbook of SAS
®
DATA Step Programming
4 Age Num 8
5 Preg Num 8
6 Hearing Char 3
7 Income Num 8
1.4.3 The SORT Procedure
The SORT procedure is used to order the data set observations by the values
of one or more variables. In SAS, a missing value, either numeric or character,
is the smallest value. The general syntax for PROC SORT is as follows:
PROC SORT <DATA=SAS-data-set> <OUT=SAS-data-set>;
BY <DESCENDING> variable-1 <... <DESCENDING> variable-n>;
RUN;
In the PROC SORT statement, the DATA=SAS-data-set option is used to iden-
tify the input SAS data set for sorting, and the OUT=SAS-data-set option
is used to name the output data set that contains newly sorted data. If the
OUT= option is omitted, the PROC SORT procedure will re ...