Availability

SAS is currently only available on Flux.

Accessing SAS

SAS is accessed by loading its module with

$ module load sas

We have limited number of licenses for SAS at this time, so when you prepare your PBS script, you need to request a SAS job. If too many SAS jobs are running, your job will queue until a license becomes available.

Notes on using SAS

When running SAS with a command file, either via PBS or in batch, be aware that the SAS output files will have the same root name as the command file. That is, if you run the command file test.pbs, then SAS will produce test.log and test.lst as output files. Do not run SAS with command files of the same name from the same directory, or the output files will corrupt each other. This is usually only an issue if you run from PBS scripts.

When SAS runs, it makes a copy of your data into the SAS work library. By default, SAS will create the work library under /tmp, and on Flux, /tmp has limited space. If your data file is larger than about 10 GB, you may wish to change the SAS work library. You can do this with the SAS command option -work as in

sas -work /scratch/project_flux/uniqname

Additional help with SAS

The Center for Statistical Consultation and Research (CSCAR) at the University of Michigan offers help using SAS. If you are having trouble with SAS itself, you can contact them for assistance. They can be reached by e-mail at sas-help@umich.edu. They also have telephone and walk-in support, and you can make an appointment with a consultant if your problem is statistical or complex. See the CSCAR website for contact information, hours, and location.

Running SAS interactively

You should only run SAS interactively on the login hosts for very small jobs to test syntax or that it is working. If you need to run SAS interactively for real work, you should submit an interactive job (see our documentation on submitting an interactive job for details).

Current versions of SAS expect to run with a Java-based GUI. If you need to run SAS interactively with the GUI, you will probably not get very good responsiveness, so we recommend that you run it in text interactive mode instead. This can be done by invoking SAS with

$ sas -nodms

The SAS prompt is a number followed by a question mark. All SAS commands are terminated with a semicolon, and the command to exit sas is endsas.

  1?  endsas;

Running SAS in batch mode

The preferred method for running SAS is in batch mode. This is done by creating a text file containing the SAS commands you wish to run, then using that as the argument to the sas command.

Suppose you had the following SAS commands in a file called test.sas.

options linesize=72;
data work.example;  
  input var1 var2 $ var3;
  datalines;
  2345 able 423.55
  36625 baker 6262.65
  485 charlie 4.46
  ;
proc print data=work.example;
  title 'printout of example data stored in the work library';
run;

Note that SAS will simply read the commands and exit without generating any output unless there is at least one run; command.

To run that in batch from an interactive prompt, the command you would run is

sas test.sas

For each command file, SAS will create a corresponding .log file and a .lst file. Errors, warnings, resource utilization, and the transcript of your commands will be, in this case, in test.log and the output of your commands will be in test.lst.

Running SAS from PBS

Running SAS from a PBS script is just like running it in batch from an interactive command line, except that you put the commands in a file. We have a limited number of
copies of SAS available, so please note the use of gres=sas on the #PBSĀ -l gres=sas:1 line, which requests one SAS license. If no SAS licenses are available, your job will be held until there are.

Assuming you had a file with valid SAS commands called test.sas, as in the example above, the following PBS script would run them.

####  PBS preamble
#PBS -N sas_test
#PBS -M uniqname@umich.edu
#PBS -m abe

#PBS -l procs=1,mem=1gb
#PBS -j oe
#PBS -V
#PBS -l gres=sas:1

#PBS -A example_flux
#PBS -l qos=flux
#PBS -q flux

####  End PBS preamble
#  Include the next three lines always
if [ -d "${PBS_NODEFILE}" ] ; then
   echo "I ran on:"
   cat $PBS_NODEFILE   # list of the CPUs you were using
fi
#  Put your job commands after this line

sas test.sas