/tmp space.
While any SAS working files can be directed to /tmp, as the
examples and explanations here show, it is usually not a good
idea to redirect the -sasuser subdirectories to /tmp, as they and
other temporary SAS work files will be deleted in due course.
The files in the -sasuser area are very small, and contain information
that many users wish to keep from session to session. For these
reasons, it is always better to keep the -sasuser directories and
files in your own file structure.
There are many ways to use /tmp in SAS, indeed almost as many
ways as you can use your own subdirectory structure. One example
is the use of a large file of raw data to create a SAS data set
that will be stored in your own file structure (your own
subdirectories). You might ftp the file containing the raw data
from another system to /tmp (or to a subdirectory that you create
in /tmp), then use the following SAS program to read it:
libname perm '~/sasdata';
filename indata '/tmp/mydir/raw.data';
data perm.project8; infile indata;
input <variable names and specifications>
This would leave the space available within your quota free of the large raw data set while SAS is creating and saving the permanent SAS data set.
One more way of managing limited working space is to ask SAS to clear it out whenever previously-created temporary SAS Data Sets are no longer needed. Some programs create a number of SAS Data Sets, one after the other, leading up to a "final" version that is the one to be used for analyses. All temporary SAS Data Sets, however, are kept in the working space until the end of the SAS session, or until the user asks SAS to delete them, whichever comes first. If you are running out of working space, and you have a number of DATA steps in your program, you can delete any unneeded SAS Data Sets with PROC DATASETS. At the end of the following example, only FINAL remains in the working area. Without the PROC DATASETS step, all four SAS Data Sets would still be saved in the working area.
data one; infile 'raw.data'; input id test1 test2 sex $;
data two; set one; if sex = 'f';
data three; set two; average = (test1 + test2) / 2;
data final; set three; if average gt 50;
proc datasets library = work; delete one two three;
run;
The first example shows how to access compressed raw data residing on UNIX disk. The PIPE keyword is used in the FILENAME statement, and the UNIX 'uncompress' command is placed inside the single quotes:
filename test1 pipe 'uncompress -c raw.file.Z';
data cmpress1;
infile test1;
input <--variable and format specifications-->
For further information on saving resources while using large amounts of data, see the section above entitled "Using Large Data Sets in the UNIX Environment".
/tmp for
workspace in the Student Computing Facility and /tmpsas0
in the Research Computing Facility.
(The /tmpsas0 space in the
RCF may be used only by SAS; users may not
use this space for any other purpose than for SAS's own
workspace.
User files stored in /tmpsas0 will be deleted without
notice.) Occasionally, these large, public-access work areas get
full and you may need to invoke SAS with an alternative work area
specified. You can direct SAS to use any space for its work area
that you have write access to. If you find that the default work
areas are temporarily full, and you wish to redirect the SAS work
space to the common user space called /tmp1,
for example, invoke SAS as follows:
sas -work /tmp1
and SAS will direct all its work files to /tmp1.
Note that you must specify alternative
workspace when you invoke SAS: workspace
cannot be transferred to another place during a SAS session.
Note also that if you use a workspace other than the default and
your SAS session ends abnormally, it is your responsibility to
make sure that any working files left behind are removed to free
the space for other users.
If you run out of space during a SAS job and need to estimate
whether your job will run if you invoke SAS and specify another
directory, first determine how much space is available in the
directory (go to the directory and type df . -- that's
"df" followed by a space, then a period), then look at the
size of the SAS or raw data file you wish to manipulate (this can
be done several ways, including the lf -l command). If there
is free space equal to twice the size of your file, it should be
sufficient, unless you are planning to do a sort, in which case
you should have at least three times the size of the file in free
space available.