High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
SAS on Biowulf and Helix
SAS Logo

Base SAS provides a scalable, integrated software environment specially designed for data access, transformation and reporting. It includes a fourth-generation programming language; ready-to-use programs for data manipulation, information storage and retrieval, descriptive statistics and report writing; and a powerful macro facility that reduces programming time and maintenance issues. The Base SAS windowing environment provides a full-screen facility for interacting with all parts of a SAS program. On-line help is also available.

With multithreaded capabilities, Base SAS software can take advantage of parallel processing power to maximize use of computing resources. However, the main advantage of using SAS on Biowulf would be to run many SAS jobs simultaneously in batch mode as a 'swarm' of single-threaded jobs.

SAS on Biowulf is a limited resource. SLURM keeps track of the SAS resource. Jobs requiring SAS will be started or remain in the queue depending on whether there are SAS resources available. All SAS jobs must therefore specify the resource when the job is submitted, as in the examples below. At present there is a limit of 48 simultaneous SAS processes, but this number is subject to change.

Running a SAS batch job

To submit SAS scripts to the batch queue, first create a batch script file (a csh or bash file) that contains any desired SLURM options and the commands to run SAS non-interactively.

NOTE: The scripts on this page are very simple and are used ONLY as examples on how to submit jobs to the Biowulf cluster. Of course, users will typically submit much more compute-intensive jobs.

Sample SAS script:

----------- sas.bat-----------------
#!/bin/bash
   #
   #SBATCH -J SAS
   #SBATCH --mail-type=BEGIN,END

   date
   sas sasfile.sas 

Submit the script using the sbatch command, e.g.

sbatch --license=sas /full/pathname/sas.bat

This sbatch command requests one SAS license ('license=sas'), so the job will remain in the queue until a license is available. To use more than one license, append --license=sas with a colon and the number of licenses (max is 48) you need (--license=sas:4). You will receive email when the job is executed and when it ends, because of the line containing --mail-type in the script. The output can be found in the directory from which your script was ran, with the file name slurm-#.out

There are other options that you may need to set for your job, specifically walltime and memory. For more information about those options, see http://hpc.nih.gov/docs/userguide.html.

Running a swarm of SAS jobs

The swarm program is designed to submit a group of commands to the Biowulfcluster. Each command is represented by a single line in the swarm command file that you create, and runs as a separate batch job. See the swarm page for more information.

Create a swarm command file, named sasjobs for instance, with each line containing a single sas run. Example:

sas sasjob1.sas
sas sasjob2.sas
sas sasjob3.sas
sas sasjob4.sas
sas sasjob5.sas
[...]
sas sasjob100.sas
Submit this to the batch system with the command:
swarm -f sasjobs --sbatch "--license=sas"

This command submits a swarm of SAS processes (100 SAS commands in the example swarm command file) to the batch system. swarm will send 4 SAS processes to a single node, so 1 SAS resource has been requested for each swarm job. Depending on the availability of the SAS resources on Biowulf, some jobs may start immediately and some may remain in the queue. Users can monitor their jobs with the following commands: squeue, sjobs, jobload and sacct. For more information on using those commands, see Monitoring Jobs.

Total and free licenses, the resource name, and the per-user license limit can be seen by typing 'licenses' at the Biowulf prompt.

Running SAS interactively

If you simply log in to Biowulf and give the sas command, the SAS Workspace environment will run on the main Biowulf login node. This is discouraged because the login node is not intended for running applications. To run SAS interactively, you can allocate a node for interactive use. Once the node is allocated, you can type commands directly on the command-line. Interactive jobs are appropriate during testing, but long jobs or large numbers of jobs should be submitted as swarms or as regular batch jobs. Example:

[user@biowulf ~]$ sinteractive --license=sas
salloc.exe: Pending job allocation 6387201
salloc.exe: job 6387201 queued and waiting for resources
salloc.exe: job 6387201 has been allocated resources
salloc.exe: Granted job allocation 6387201
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn1540 are ready for job
[user@cn1540 ~]$
[user@cn1540 ~]$ sas foobar.sas > foobar.out
[user@cn1540 ~]$ exit
exit
salloc.exe: Relinquishing job allocation 6387201
salloc.exe: Job allocation 6387201 has been revoked.
[user@biowulf ~]$ 

With an Xwindows-capable connection, typing 'sas' at the Biowulf prompt will bring up the SAS Workspace X windows interface. You can then type any SAS command into the window. Again, this should only be used for testing, or for small development tasks. All other SAS jobs should be run either via batch or interactive nodes, as below.

[user@biowulf ~]$ sinteractive --license=sas
salloc.exe: Pending job allocation 6387201
salloc.exe: job 6387201 queued and waiting for resources
salloc.exe: job 6387201 has been allocated resources
salloc.exe: Granted job allocation 6387201
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn1540 are ready for job
[user@cn1540 ~]$
[user@cn1540 ~]$ sas&

You should see the SAS logo pop up briefly, and then the menus will appear. If you need more than 1 SAS license, submit with sinteractive --license=sas:#

SAS splash screen

SAS GUI

Documentation