SORTSIZE System Option: Windows

Specifies the amount of memory that is available to the SORT procedure.

Valid in: configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Categories: Sort: Procedure Options
System Administration: Memory
PROC OPTIONS GROUP= MEMORY
SORT
Default: 1G
Windows specifics: Default value
See: SORTSIZE= System Option in SAS System Options: Reference

Syntax

-SORTSIZE n | nK | nM | nG | hexX | MIN | MAX
SORTSIZE= n | nK | nM | nG | hexX | MIN | MAX

Required Arguments

n | nK | nM | nG

specifies the amount of memory in multiples of 1; 1,024 (kilobytes); 1,048,576 (megabytes); and 1,073,741,824 (gigabytes) respectively. You can specify decimal values for the number of kilobytes, megabytes, or gigabytes. For example, a value of 8 specifies 8 bytes, a value of .782k specifies 801 bytes, and a value of 3m specifies 3,145,728 bytes.

hexX

specifies the amount of memory as a hexadecimal value. You must specify the value beginning with a number (0–9), followed by an X. For example, the value 2dx sets the amount of memory to 45 bytes.

MIN

specifies the minimum amount of memory available.

MAX

specifies the maximum amount of memory available.

Details

By default, this option is set to the maximum amount of memory available. The SORTSIZE system option can reduce the amount of swapping SAS must do to sort the data set. If PROC SORT needs more memory than you specify, it creates a temporary utility file in your SAS work directory in which to store the data. The SORT procedure's algorithm can swap unneeded data more efficiently than Windows can.
If you can place the SAS data file that you want to sort in physical memory on your machine, then a sort in SAS is very efficient. Set SORTSIZE to be larger than the size of the data file. If you cannot fit the data file in physical memory, then set SORTSIZE to 1G or less. In addition, SORTSIZE should always be set to a value that is at least 8M smaller than MEMSIZE.

Comparisons

The SORTSIZE option is similar to the REALMEMSIZE option. SORTSIZE affects only the SORT procedure. REALMEMSIZE affects multiple procedures.