Previous PageNext Page

Proc Sort syntax
The Sort Procedure rearranges the observations in a data set according to the value of the BY variables.

Proc SORT syntax
PROC SORT [DATA=input-data-file] [OUT=output-data-file];
BY [descending] variable-name [...[descending] variable-name];
input-data-file specifies the SAS data set to be read by the procedure. If it is not specified, the last data set created will be used as input.
output-data-file specifies the SAS data set to be written by the procedure. If it is not specified, the reordered data file is given the same name as the input data set.
The BY statement is required.
The BY variables specify the hierarchical sorted order. Any number of variables may be used. By default, the data is sorted in ascending order. If a descending sorted order is desired, use
BY DESCENDING variable-name; Only the variable immediately following DESCENDING is affected.

For more information see SPG, Chapter 31, The SORT Procedure.
Proc SORT produces no printed output (nothing is written to the output).

Previous PageTable Of ContentsNext Page