WORK System Option: UNIX

Specifies the location of the Work library.
Valid in: configuration file, SAS invocation, SASV9_OPTIONS environment variable
Category: Environment control: Files
PROC OPTIONS GROUP= ENVFILES
Default: set in the installed !SASROOT/sasv9.cfg file
UNIX specifics: all
Note: This option can be restricted by a site administrator. For more information, see Restricted Options in SAS System Options: Reference.
See: WORK= System Option in SAS System Options: Reference

Syntax

–WORK pathname

Required Argument

pathname
specifies the location of the SAS Work library if pathname is a directory. If pathname describes a file, then SAS chooses a directory from that file as the location for the Work library for the current SAS session.

Details

The Basics

If the value of pathname is a directory, then SAS continues its initialization using the directory as the location for the Work library. If the value of pathname is a file, then SAS opens the file and selects one of the paths to use as the location for the Work library. SAS either selects a path at random or selects a path based on available space. Once a work location is picked at start-up, all of the work files for the session are sent to the single work directory.

Making the Allocation of Work Libraries More Dynamic

If pathname refers to a file, then that file contains a list of locations that can be used for the Work library. Individual SAS Work libraries still reside in a single directory. You use METHOD=RANDOM to specify that the Work directory is randomly chosen from the list of directories. SAS chooses one location per session as the location of the Work directory. This selection enables you to balance the I/O load across multiple hardware systems. You use METHOD=SPACE to specify the directory that has the most available space. If METHOD is not specified, SAS defaults to choosing a directory at random.

Examples

Example 1: Spreading a Processing Load across Multiple Volumes of Different Disks

The following example shows how to spread an I/O processing load across multiple volumes of different disks. In this case, you use METHOD=RANDOM. A file named /sasinfo/workfiles contains the following information:
/disk1/sastempfiles
/disk2/sastempfiles
/disk3/sastempfiles
method=random
The Work library for a particular SAS session will be placed on either disk1, disk2, or disk3. The configuration file or command line would include the following:
-work /sasinfo/workfiles

Example 2: Choosing the Directory That Has the Most Free Space

When you process your data, you can choose the directory that has the most free space. In this case, you use METHOD=SPACE. In the following example, /sasinfo/workfiles contains the following directories:
/disk1/sastempfiles
/disk2/sastempfiles
/disk3/sastempfiles
method=space
The Work library is placed on the disk with the most free space.

See Also