Skip to Main Content

How to run SAS programs on maya


Running SAS on the cluster is similar to running any other serial job. Make sure you’ve read the tutorial for C programs first, to understand the basics. We will not demonstrate any parallel code here, so reading just the serial section is okay for now.

For more information about the software, see the SAS website.


Here is a sample script that plots homework scores versus test scores in one EPS file and test scores versus homework scores in another EPS file.

data grades;
input homework test;
48 66
72 75
61 70
88 79
75 91
92 93
77 90
58 69
63 68
filename file1 'homework-test.eps';
goptions reset=global DEVICE=pslepsfc gsfmode=replace gsfname=file1 hsize=4 vsize=3;
proc gplot;
plot homework*test;
filename file2 'test-homework.eps';
goptions reset=global DEVICE=pslepsfc gsfmode=replace gsfname=file2 hsize=4 vsize=3;
proc gplot2;
plot test*homework;

Download: ../code/plotgrades-SAS/

In order to run this script on the cluster nodes, we will need a batch script

#SBATCH --job-name=plotgrades
#SBATCH --output=slurm.out
#SBATCH --error=slurm.err
#SBATCH --partition=develop


Download: ../code/plotgrades-SAS/run.slurm

We can then run that script

[araim1@maya-usr1 plotgrades-SAS]$ slurm run.slurm
sbatch: Submitted batch job 2623
[araim1@maya-usr1 plotgrades-SAS]$

Once your job completes, it should produce several files.

[straha1@maya-usr1 plotgrades-SAS]$ ls
homework-test.eps  plotgrades.log    test-homework.eps
run.slurm    test-homework.gif
[straha1@maya-usr1 plotgrades-SAS]$

The slurm.err and slurm.out files contain everything that your job printed to its error and output streams, respectively. The plotgrades.log file contains detailed information about what SAS did while running your program. The two EPS files homework-test.eps and test-homework.eps are scatter plots that your program created. They should look something like this

GIF version of test-homework.eps

except that we have converted them to GIF to display above. You can download sample output files using these links