| SAS Companion for the CMS Environment |
Space is the aspect of the WORK library that is most likely to require your
consideration. 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 issues a
message similar to the one shown in Insufficient WORK Space Message. In an interactive session, a dialog
window asks you to specify what action to take.
Insufficient WORK Space Message
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. |
Here are several possible solutions to this problem:
-
Perform file cleanup to free up
space.
-
Define a virtual disk or a temporary disk for
your WORK library. Point WORK or USER to the virtual disk or the temporary
disk. See Directing Temporary SAS Data Sets to the USER Library
for more information.
-
Ask your systems programmer 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.
By default, SAS creates the WORK library on the CMS minidisk
that has the largest amount of 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=.)
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 problems with this method.
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.
You can use either a temporary data set or a permanent
data set for the library, and you can put the library either on disk or on
tape. The data set can be either a Version 6 or Version 7 SAS data library.
The following table summarizes differences between the WORK and USER libraries.
The following example
illustrates the use of the USER=
system option. The numbered lines of code are explained below.
filename giant 'survey tvdata a1';
libname result 'my.tv.sasdata';
[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;
run;
[4] proc freq;
tables region*income*viewers*cable
[5] / noprint out=result.freqdata;
run;
-
The LIBNAME statement associates the libref TEMP
with the F minidisk.
-
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 will be
stored in this library.
-
A one-level name is used in the DATA statement.
When the DATA step is processed, the SAS data set TEMP.TOTALUSA is created.
-
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.
-
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 MY.TV.SASDATA.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.