#!/bin/sh ########################################################## # Copyright(C)1997 by SAS Institute Inc.,Cary, NC, USA. # # # # SAS (R) is a registered trademark of SAS Institute Inc.# # # # SAS Institute does not assume responsibility for the # # accuracy of any material presented in this file. # ########################################################## ########################################################## # PROGRAM DESCRIPTION: # # ==================== # # This is a sample UNIX Bourne Shell script that checks # # to see how many sas jobs are running. If the limit # # of sas jobs is reached, then sas will exit with # # the appropriate messages. For this example, the limit # # of sas jobs is set to 5 or less. The limit of sas # # jobs will have to be determined on a per site basis. # # # # The following also uses /usr/local/sas612 as the # # location of where sas is installed. Depending on # # where The SAS SYSTEM is installed, users may have to # # change the below sas installation directory. # ########################################################## checknum=`ps -u userid | grep ' sas' | wc -l` if [ "$checknum" -gt 5 ]; then echo "The number of sas jobs is $checknum" echo "Which is Too Many SAS Jobs Running Currently" echo "Exiting.........." exit 1 else /usr/local/sas612/sas $@ & fi exit 0