User Tools

Site Tools



Statistical Analysis System is a statistical software suite developed by SAS Institute for data management, advanced analytics, multivariate analysis, business intelligence, criminal investigation, and predictive analytics.

Example Job

An example job is stored in /share/apps/SAS/example_job. Here is how you can run this job from your account through the scheduler.

First copy the example directory files into your account. Use SASexample as your directory name:

pinnacle-l1:pwolinsk:~$ mkdir SASexample
pinnacle-l1:pwolinsk:~$ cp /share/apps/SAS/example_job/* SASexample/
pinnacle-l1:pwolinsk:~$ cd SASexample
pinnacle-l1:pwolinsk:~/SASexample$ cat 
libname home "~/SASexample" ;

proc options option = work ;

proc sort data = home.unsorteddata ;
by  DirectorID DirBrdID ;

Next using an editor of your choice, create a SLURM job script to run the example. This is a short example. 1 node and 1 core for 5 minutes will be enough. The script is named sas.slurm below:

pinnacle-l1:pwolinsk:~/SASexample$ cat sas.slurm 
#SBATCH -p comp01
#SBATCH -t 5:00
#SBATCH -N1 -n1

cd ~/SASexample

Then submit the job into the queue and wait for it to run:

pinnacle-l1:pwolinsk:~/SASexample$ sbatch sas.slurm 
Submitted batch job 128940
pinnacle-l1:pwolinsk:~/SASexample$ squeue -u pwolinsk
            128940     comp01 sas.slur pwolinsk PD       0:00      1 (None)
pinnacle-l1:pwolinsk:~/SASexample$ squeue -u pwolinsk

When the job finishes look for output files:

 ls -ltr
total 208
-rw-r--r--. 1 pwolinsk pwolinsk    134 Jul 22 11:52
-rw-r--r--. 1 pwolinsk pwolinsk 294912 Jul 22 12:03 unsorteddata.sas7bdat
-rw-rw-r--. 1 pwolinsk pwolinsk    152 Jul 22 12:04 sas.slurm
-rw-rw-r--. 1 pwolinsk pwolinsk      0 Jul 22 12:04 slurm-128940.out
-rw-rw-r--. 1 pwolinsk pwolinsk   2937 Jul 22 12:04 sascode_example.log

Contents of the sas log file:

pinnacle-l1:pwolinsk:~/SASexample$ cat sascode_example.log 
1                                                          The SAS System                             12:23 Wednesday, July 22, 2020

ERROR: Expecting page 1, got page -1 instead.
ERROR: Page validation error while reading SASUSER.PROFILE.CATALOG.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.
NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) Proprietary Software 9.4 (TS1M6) 
      Licensed to UNIV OF AR - FAYETTEVILLE CAMPUS - SFA - T&R, Site 70215900.
NOTE: This session is executing on the Linux 3.10.0-957.10.1.el7.x86_64 (LIN X64) platform.

NOTE: Analytical products:
      SAS/STAT 15.1
      SAS/ETS 15.1
      SAS/IML 15.1

NOTE: Additional host information:

 Linux LIN X64 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 CentOS Linux release 7.8.2003 (Core) 

You are running SAS 9. Some SAS 8 files will be automatically converted 
by the V9 engine; others are incompatible.  Please see

PROC MIGRATE will preserve current SAS file attributes and is 
recommended for converting all your SAS libraries from any 
SAS 8 release to SAS 9.  For details and examples, please see

This message is contained in the SAS news file, and is presented upon
initialization.  Edit the file "news" in the "misc/base" directory to
display site-specific news and information in the program log.
The command line option "-nonews" will prevent this display.

NOTE: SAS initialization used:
      real time           0.08 seconds
      cpu time            0.02 seconds
1          libname home "~/SASexample" ;
NOTE: Libref HOME was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: /home/pwolinsk/SASexample
3          proc options option = work ;
4          run;

    SAS (r) Proprietary Software Release 9.4  TS1M6

                   Specifies the libref or location of the Work library.
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

2                                                          The SAS System                             12:23 Wednesday, July 22, 2020


6          proc sort data = home.unsorteddata ;
7          by  DirectorID DirBrdID ;
8          run;

NOTE: There were 100 observations read from the data set HOME.UNSORTEDDATA.
NOTE: The data set HOME.UNSORTEDDATA has 100 observations and 18 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

ERROR: Errors printed on page 1.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           0.10 seconds
      cpu time            0.04 seconds
sas.txt · Last modified: 2020/07/22 17:29 by pwolinsk