Chapter Contents


SAS Companion for the CMS Environment

Handling Space in the WORK Library

If you have many large temporary SAS data sets, or if you use a procedure that has many large utility files (for example, a PROC FREQ step with a complex TABLES statement that you run against a large SAS data set), you may run out of space in the WORK library. If you run out of space in batch mode, your PROC or DATA step terminates prematurely, and SAS issues a message similar to the following:

ERROR: Insufficient space in file WORK.TEMP.DATA.                           
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEMP may be incomplete.  When this step was
         stopped there were 117 observations and 3 variables.
WARNING: Data set WORK.TEMP was not replaced because this step was stopped. 

In an interactive session, a dialog window asks you to specify what action to take.

Here are several possible solutions to this problem:

  1. Delete files to free space.

  2. Define a virtual disk or a temporary disk for your WORK library. Point WORK or USER to the virtual disk or to the temporary disk. See Directing Temporary SAS Data Sets to the USER Library for more information.

  3. Ask your systems administrator to increase the allocation of the minidisk where the WORK library resides or to increase the limits for your userid in the SFS pool where your WORK library resides. See Increasing the Size of the WORK Library for more information.

Increasing the Size of the WORK Library

By default, SAS creates the WORK library on the CMS minidisk that has the largest amount of READ/WRITE (R/W) space available.

You may also want to access a minidisk and reserve it exclusively for SAS WORK files. Use the SAS system option SIODISK= to tell SAS which filemode or SFS directory to use for the WORK library. (See SIODISK=.)

Deleting Temporary SAS Data Sets

Under CMS, temporary SAS data set means a data set that is stored in a temporary SAS data library. That is, you cannot designate the data set itself as temporary, but the data set takes on the attribute of the library in which it is stored.

One simple way to conserve space in the WORK library is to delete each temporary SAS data set with a PROC DATASETS step after you no longer need it. However, there are two potential problems to keep in mind with this method.

Directing Temporary SAS Data Sets to the USER Library

An alternative to deleting temporary SAS data sets is to direct them to a different SAS data library. You can use the USER= system option to store temporary data sets in the USER library rather than in the WORK library. You can make the USER library as large as you need it to be.

Note:   Utility data sets that are created by SAS procedures continue to be stored in the WORK library. However, any data sets that have one-level names and that are created by your SAS programs will be stored in the USER library.  [cautionend]

You can put the library either on disk or on tape. The data set can be in either a Version 8, 7, or 6 SAS data library. The following table summarizes differences between the WORK and USER libraries.

Differences between the WORK and USER Libraries
Library Type of Data Set Storage Medium Format
WORK temporary disk V8
USER temporary or permanent disk or tape V8, V7, or V6

The following example illustrates the use of the USER= system option.

    filename giant 'survey tvdata a1';
    libname result '';
[1]   libname temp 'f';
[2]   options user=temp;
[3]   data totalusa;
      infile giant;
      input home_id region income viewers cable;
      if home_id=. then delete;

[4]   proc freq;
      tables region*income*viewers*cable
[5]        / noprint out=result.freqdata;
  1. The LIBNAME statement associates the libref TEMP with the F minidisk.

  2. In the OPTIONS statement, the USER= system option designates the TEMP libref as the temporary SAS data library. Any data sets that have one-level names and that are created by your SAS program are stored in this library.

  3. A one-level name is used in the DATA statement. When the DATA step is processed, the SAS data set TEMP.TOTALUSA is created.

  4. Because the large TOTALUSA data set was directed to the TEMP library, there is more space available in the WORK library for the utility files that the FREQ procedure requires.

  5. The SAS data set FREQDATA contains the results of the FREQ procedure. A two-level name is used to store FREQDATA in the permanent SAS data library "result filepool:".

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.