29.12.2013 Views

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1030 Results: SORT Procedure 4 Chapter 44<br />

Results: SORT Procedure<br />

Procedure Output<br />

PROC SORT produces only an output data set. To see the output data set, you can<br />

use PROC PRINT, PROC REPORT, or another of the many available methods of<br />

printing in <strong>SAS</strong>.<br />

Output Data Set<br />

Without the OUT= option, PROC SORT replaces the original data set with the sorted<br />

observations when the procedure executes without errors. When you specify the OUT=<br />

option using a new data set name, PROC SORT creates a new data set that contains<br />

the sorted observations.<br />

To do this<br />

implicit replacement of input data set<br />

explicit replacement of input data set<br />

no replacement of input data set<br />

Use this statement<br />

proc sort data=names;<br />

proc sort data=names out=names;<br />

proc sort data=names out=namesbyid;<br />

With all three replacement options (implicit replacement, explicit replacement, and no<br />

replacement) there must be at least enough space in the output data library for a copy<br />

of the original data set.<br />

You can also sort compressed data sets. If you specify a compressed data set as the<br />

input data set and omit the OUT= option, then the input data set is sorted and remains<br />

compressed. If you specify an OUT= data set, then the resulting data set is compressed<br />

only if you choose a compression method with the COMPRESS= data set option. For<br />

more information about COMPRESS=, see the chapter on <strong>SAS</strong> data set options in <strong>SAS</strong><br />

Language Reference: Dictionary.<br />

Note: If the <strong>SAS</strong> system option NOREPLACE is in effect, then you cannot replace<br />

an original permanent data set with a sorted version. You must either use the OUT=<br />

option or specify the <strong>SAS</strong> system option REPLACE in an OPTIONS statement. The<br />

<strong>SAS</strong> system option NOREPLACE does not affect temporary <strong>SAS</strong> data sets. 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!