From the course: SAS® 9.4 Cert Prep: Part 03 Exploring and Validating Data

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Sorting data

Sorting data

- Sorting data can be a helpful and sometimes necessary step in exploring your data. For example, you might want to sort on groups or measures so that you can visually examine the high or low values. You might also use sorting as a way to identify and remove duplicate rows. For certain data processing steps, sorting is required. To sort the rows in a table, you use the sort procedure. Using proc sort, you can sort on one or more character or numeric columns. Similar to other procedures, you use the date equal option to specify the input table. Although it's optional, we often use the out equal option to specify an output table because if you don't include the out equal option, proc sort changes the order of the rows in the input table. Every proc sort step must include a by statement. The by statement specifies one or more columns in the input table whose values are used to sort the rows. The by statement also indicates whether…

Contents