Chapter Contents |
Previous |
Next |
The SORT Procedure |
Observations Sorted by the Values of One Variable shows the results of sorting a data set with the most basic form of a PROC SORT step. In this example, PROC SORT replaces the original data set, sorted alphabetically by last name, with a data set that is sorted by employee identification number. The statements that produce the output follow:
proc sort data=employee; by idnumber; run; proc print data=employee; run;
Observations Sorted by the Values of One Variable
Observations Sorted by the Values of Multiple Variables shows the results of a more complicated sort by three variables. The businesses in this example are sorted by town, then by debt from highest amount to lowest amount, then by account number. For an explanation of the program that produces this output, see Reversing the Order of the Sorted Values .
Observations Sorted by the Values of Multiple Variables
Note: The sorting capabilities that are described in
this chapter are available on all operating environments. In addition, if
you use the HOST value of the SAS system option SORTPGM=, you may be able
to use other sorting options available only in your operating environment.
Refer to the SAS documentation for your operating environment for information
on other sorting capabilities. For more information about the SAS system option
SORTPGM=, see the chapter on SAS system options in SAS Language Reference: Dictionary.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.