SAS is a commercial statistical software licensed yearly to NCSU.
External Links:
SAS website
SAS Free Training
SAS E-Learning: NCSU Login Required
Do not run SAS interactively on the login nodes. If you need to use SAS interactively using a GUI, you may do so on an HPC-VCL node. On logging in to the VCL, start SAS from a terminal using
module load sas sas
For a SAS input file called my_program.sas, create a text file called submit.csh containing:
#!/bin/tcsh #BSUB -W 20 #BSUB -n 1 #BSUB -x #exclusive use of node #BSUB -o out.%J #BSUB -e err.%J module load sas sas my_program.sasThe job can be submitted as
bsub < submit.cshNote that the job above requests exclusive use of the node; #BSUB -x . This is because several SAS procedures are thread-enabled, which means that they may run on more than the one core requested with #BSUB -n 1. So exclusive use prevents this job from interfering with other jobs on the node. The 2nd example below shows how a user can specify the # of cores, allowing the user to leave out the -x flag.
Example 1, Hello World: Create a SAS input file called simple.sas, by clicking on the link and copying the contents (make sure to edit this file so that it has the proper groupid and username in the /share/... path). Also create a job-submission file called submit.csh containing:
#!/bin/tcsh #BSUB -W 5 #BSUB -n 1 #BSUB -x #exclusive use of node #BSUB -o out.%J #BSUB -e err.%J module load sas sas simple.sasThe job can be submitted as
bsub < submit.csh
Example 2, shows the multiple-threads option for better performance: This example below uses SAS's CPUCOUNT parameter to run multiple threads on multiple cores in shared-memory mode. SAS is found to use cpucount + 1 number of threads. That is why the -n in #BSUB -n is set to cpucount + 1. Which in turn, is why cpucount is set to -n - 1, or $LSB_DJOB_NUMPROC - 1. Also note that #BSUB -x (exclusive use) is NOT used. Create a SAS input file called l1.sas, by clicking on the link and copying the contents (make sure to edit this file so that it has the proper groupid and username in the /share/... path). Also create a job-submission file called sub.csh containing:
#!/bin/tcsh #BSUB -n 4 #BSUB -R "span[host=1]" #BSUB -W 60 #BSUB -o out.%J #BSUB -e err.%J module load sas setenv cpucount `expr "$LSB_DJOB_NUMPROC" - 1` echo $cpucount sas -threads -cpucount $cpucount l1.sasThe job can be submitted as
bsub < sub.csh
Higher throughput tip: You could specify a minimum and maximum # of cores, with something like #BSUB -n 2,4. This tells the scheduler to run on the higher number of cores if they can be reserved without queue waits. This scheduler feature could enhance throughput if you are submitting a large ensemble of jobs and your throughput is sensitive to PENDing time in the scheduler.
Last modified: March 23 2022 13:18:59.