Chapter Contents

Previous

Next
The SORT Procedure

Results


Procedure Output
PROC SORT produces only an output data set. To see the output data set, you can use PROC PRINT, PROC REPORT, or another of the many available methods of printing in the SAS System.


Output Data Set
When you specify the OUT= option, PROC SORT creates a new data set that contains the sorted observations. Without OUT=, PROC SORT replaces the original data set with the sorted observations as soon as the procedure executes without errors. Even when a data set is replaced, there must be at least enough space in the data library for a second copy of the original data set.

You can also sort compressed data sets. If you specify a compressed data set as the input data set and omit the OUT= option, the input data set is sorted and remains compressed. If you specify an OUT= data set, the resulting data set is compressed only if you choose a compression method with the COMPRESS= data set option. For more information about the data set option COMPRESS=, see the section on SAS data set options in SAS Language Reference: Dictionary.

Note:   If the SAS system option NOREPLACE is in effect, you cannot replace the original data set with the sorted version. You must either use the OUT= option or specify the SAS system option REPLACE in an OPTIONS statement.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.