Sentry Page Protection
Proc Sort [2-2]
SAS Base Exam
SAS Base Exam
Output Option
The Output option creates an output data set for the sorted observations.
Example
Copy and run the SCHOOL data set from the yellow box below.
Example
Copy and run the SCHOOL data set from the yellow box below.
Similar to the MEANS procedure, you can add the Output option to the SORT procedure.
Example
Proc Sort Data=School Out=SortedRes;
By Subject Results;
Run;
The OUT option is added to the SORT procedure.
This creates an output data set called SortedRes that contains the sorted observations.
Important Note
When adding the OUT option to the SORT procedure, the input data set (i.e. SCHOOL) remains unchanged.
Key Concept to Remember:
With the present of the OUT option, the input data set remains unchanged.
Exercise
Sort the SCHOOL data set by Results in descending order and save the sorted observations in a new data set called DesResult.
Need some help?
Fill out my online form.