Architecting, installing and maintaining your SAS environment

Making the Allocation of Work Libraries More Dynamic

Reply
Occasional Contributor
Posts: 17

Making the Allocation of Work Libraries More Dynamic

If you have I/O issues with your WORK library, this may help spread the I/O load.  (In our case, our location for the WORK directory was 100% all the time) 

Wanted to share this with the SAS Deployment world:

WORK System Option: UNIX

--------------------------------------------------------------------------------

Specifies the location of the Work library. Default: set in the installed !SASROOT/sasv9.cfg file Valid in: configuration file, SAS invocation, SASV9_OPTIONS environment variable

Category: Environment control: Files

PROC OPTIONS GROUP= ENVFILES

UNIX specifics: all

See: WORK= System Option in SAS Language Reference: Dictionary 

--------------------------------------------------------------------------------

Syntax

Details

The Basics

Making the Allocation of Work Libraries More Dynamic Examples  Example 1: Spreading a Processing Load across Multiple Volumes of Different Disks  Example 2: Choosing the Directory That Has the Most Free Space See Also

--------------------------------------------------------------------------------

Syntax

-WORK pathname 

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. 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.

Ask a Question
Discussion stats
  • 0 replies
  • 293 views
  • 0 likes
  • 1 in conversation