Run
getSlurmExamples
at the command line ofrnd
orvleda
to have all the tutorials copied to your home directory.
In this tutorial, you will practice running a SAS script. SAS is a statistics software suite. The sample script we will be using creates a cross-frequency table on the gender and handedness of individuals. This script demonstrates a basic data manipulation and analysis task in SAS, where frequency tables are a common tool used to summarize categorical data.
SAS Script
/* crosstab.sas */
DATA Hand;
INPUT gender $ handed $ ;
DATALINES;
Female Right
Male Left
Male Rightcd
Female Right
Female Right
Male Right
Male Left
Male Right
Female Right
Female Left
Male Right
Female Right
PROC FREQ DATA=Hand;
TABLES gender*handed;
RUN;
SLURM Script
#!/bin/bash
# [ crosstab.sbatch ]
#SBATCH --job-name=crosstab
#SBATCH --output=crosstab.out
#SBATCH --export=ALL
#SBATCH --time=00:10:00
#SBATCH --mem=512m
# This script demonstrates how to run a SAS program on the Stern grid.
# The SAS program creates a cross tabulation between gender and
# left- and right-handedness. It creates TWO files:
#
# crosstab.log # the execution log
# #
# and crosstab.lst # a table of gender handedness
# ---------------------------------------------------------------------
# You may submit this 'crosstab.sh' script for:
# IMMEDIATE execution, to the grid using the 'srun' command, or
# LATER execution, to the grid using the 'sbatch' command.
#
#
# Example submissions:
# --------------------
# Submit crosstab.sh via sbatch to the grid for LATER execution with command:
# sbatch crosstab.sbatch
#
#
# Specify the software and version to use, and run the sas program:
module purge
module load sas/9.4
sas -nodms crosstab.sas
You can run the script by typing in the following command:
sbatch crosstab.sbatch