Introduction

Sometimes you need to group observations by the values of a particular variable or order the observations in a particular way, such as alphabetically, in order to

  • reorder the data for reporting
  • reduce data retrieval time
  • enable BY-group processing in both DATA and PROC steps.
The SORT procedure is one technique that can be used to group or order data. However, the SORT procedure can use a high volume of resources. When an uncompressed data file is sorted using the SORT procedure, SAS requires enough space in the data library for two copies of the data file, plus a workspace that is approximately two to four times the size of the data file.
Sort Workspace


In some cases, you might be able to use techniques other than the SORT procedure to group or order observations. In other cases, you might be able to use options or techniques with the SORT procedure that enable you to minimize resource usage.


Note This lesson does not cover the Scalable Performance Data Engine (SPD Engine), which is a SAS 9.1 technology for threaded processing. For details about using the SPD Engine to improve performance, see the SAS documentation.

Notice: This lesson does not include guided practices. Also, the data sets that are used in examples throughout this lesson are not included in the sample data for this course. Therefore, the programs in this lesson will not run in your SAS session.


1.5 hours



In this lesson, you learn to

  • apply techniques that enable you to avoid unnecessary sorts
  • calculate and allocate sort resources
  • use strategies for sorting large data sets
  • eliminate duplicate observations efficiently.

complete the following lessons:

  • .


  • .


  • .