Proc sort is used to sort SAS data sets. This sorting is useful in producing printouts in the proper format when using by statements in other SAS procedures. Here's a typical example of using proc sort.
proc sort data=mixedup
out=ordered;
by x descending y;
In this example the original data set mixedup is sorted by
ascending x values. The default sort order is ascending. The
data is then sorted further within each value of x by descending
y value. The sorted data set is named ordered.
The option out= specifies the name for the sorted data set. If
out= is not used, the original data set is modified.
There is no limit to the number of variables which can be specified
in the by statement. The by statement MUST appear.
For further information see SAS SYSTEM HELP--DATA MANAGEMENT--SORT in the online help or the SAS Procedures Guide.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.