SAS Companion for the CMS Environment |
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:
Log
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:
- Delete files to free
space.
- Delete SAS data sets and members from any SAS
library that resides on the same minidisk as the WORK library, including members
of the WORK library itself. If the WORK library is in an SFS directory, deleting
SAS data sets and members of any SAS library in the same userid and file pool
as the WORK library will free additional space for the WORK library. See Deleting Temporary SAS Data Sets
for more information.
- Remove unneeded CMS files from the minidisk where
your WORK library resides. If the WORK library resides in an SFS directory,
removing any CMS files from the same userid and file pool as the WORK library
will free additional WORK library space.
- 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.
- 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.
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=.)
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.
- You can cause errors in a job by deleting a SAS
data set before the job is finished with it.
- If you need several very large temporary SAS data
sets in your job at the same time, you may run out of space before you reach
a point at which you can delete any SAS data sets.
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 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.
The following example
illustrates the use of the USER=
system option.
filename giant 'survey tvdata a1';
libname result 'filepool: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 are 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 "result filepool: my.tv.sasdata".
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.