Using SAS on Clipper

Tags SAS Clipper

The SAS statistical software suite is available for command-line use on the Clipper HPC cluster. As of March 2024, there is no X windows support provided by Clipper so the SAS GUI is currently unavailable.

Loading SAS

SAS is available through the modules system:

[hpcuser1@clipper ~]$ module load sas

While the above command depicts loading SAS from the head node, please do not run your SAS jobs there. The head node is not optimized for running intensive workloads like SAS jobs and doing so may negatively impact cluster performance.

Example SAS Script and Slurm Batch Job

SAS Script

The following SAS code will print basic statistics from a small data set containing average points per game per season for the GVSU football team. Save the below as football.sas to your home directory on Clipper.

DATA stats;
INPUT season $ gvsu opponents;
DATALINES;
2023 43.77 16.54
2022 37.92 11.15
2021 38.00 18.58
2019 30.09 17.00
2018 32.75 19.08
RUN;

PROC PRINT DATA=stats;
RUN;

PROC MEANS DATA=stats;
RUN;

Slurm Batch Submission Script

Save the below as sas.sbatch to your home directory on Clipper, substituting your user name, email and resource requirements where applicable. For SAS, we recommended submitting to the cpu partition while allocating a single task/processor, unless you are certain your SAS code can take advantage of multiple threads. Not all SAS procedures are capable of multi-threading.

#!/bin/sh
#SBATCH --job-name=SAS_job
#SBATCH --partition=cpu
#SBATCH --time=1:00:00
#SBATCH --mem=1GB
#SBATCH --ntasks=1
#SBATCH --mail-type=BEGIN,END,FAIL
#SBATCH --mail-user=hpcuser1@gvsu.edu

module load sas
sas /home/hpcuser1/football.sas -nodate -linesize 90

Submit the job to the cluster:

[hpcuser1@clipper ~]$ sbatch sas.sbatch

The SAS log and output are created in the working directory (/home/hpcuser1):

[hpcuser1@clipper ~]$ cat football.lst
                                      The SAS System                                     1

                           Obs    season     gvsu    opponents

                            1      2023     43.77      16.54
                            2      2022     37.92      11.15
                            3      2021     38.00      18.58
                            4      2019     30.09      17.00
                            5      2018     32.75      19.08
                                      The SAS System                                     2

                                   The MEANS Procedure

      Variable     N            Mean         Std Dev         Minimum         Maximum
      ------------------------------------------------------------------------------
      gvsu         5      36.5060000       5.2978703      30.0900000      43.7700000
      opponents    5      16.4700000       3.1564379      11.1500000      19.0800000
      ------------------------------------------------------------------------------

SAS Work Directory

SAS by default uses the directory from which the SAS session is launched as the working directory. If you are working with large data sets and outputs, you should launch your SAS session within your batch job from your project storage allocation and not your home folder.

For example:

#!/bin/sh
#SBATCH --job-name=SAS_job
#SBATCH --partition=cpu
#SBATCH --time=1:00:00
#SBATCH --mem=1GB
#SBATCH --ntasks=1
#SBATCH --mail-type=BEGIN,END,FAIL
#SBATCH --mail-user=hpcuser1@gvsu.edu

module load sas
cd /active/hpcuser1_project
sas /home/hpcuser1/football.sas -nodate -linesize 90
Was this helpful?
0 reviews

Details

Article ID: 18894
Created
Tue 3/26/24 1:50 PM
Modified
Tue 3/26/24 4:30 PM