Sorting Data |
Sorting data enables you to categorize your data and arrange it in a particular order. For example, if you are sorting data on houses for sale, you can sort the data by a particular value, such as by the number of square feet. You can arrange the data in ascending or descending order, such as from the smallest house to the largest house. You can sort by a number such as by the price of a house, or by a characteristic such as in alphabetical order by the style of the house.
In this chapter you learn how to sort the data in the HOUSES table in ascending order by style and then descending order by square footage. The sorted data are stored in a temporary table called WORK.STYLE. When sorted, the houses are in order alphabetically by style. If more than one house has the same style, then the largest house is listed first.
The original order of the houses in the HOUSES table is shown in the following display as viewed using Edit/Browse on the Data Management menu.
Unsorted Houses Table
Refer to Editing and Browsing Data for information about editing and browsing.
Additional Information |
For additional information about sorting data, refer to the SORT Procedure chapter in the Base SAS Procedures Guide.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.