Resources

The Resource Requirements of a job are one of SCHEDULE's most powerful tools. Using resources you can program a variety of advanced logic into your jobs including job switching which allows you to turn off sections of jobs by setting a variable and job intersection which lets you determine whether the job will run based on the value of an integer.

The resource list is where the bulk of advanced job programming occurs. The list is used with variables to affect the flow of jobs and job interaction. It consists of a list of requirements and a list of actions to take once those requirements are met. Here IF-THEN statements are processed that can check or alter the value of a variable, suppress a job run or cause a wait to occur. These techniques will prove very useful.

 


The General Resource list, which is processed when the job is run, can evaluate an expression and then do one of three things if the expression is true:

 

Suppress the job run
 Example:

IF count .eq. 20 THEN SUPPRESS_RUN

Put the job in a wait state
 Example:

IF disk_space .ge. 20000 THEN WAIT

Set a variable to a new value
 Example:

IF job_success .le. 12 THEN SET job_success .eq. 0

 

An action(s) can be included in the list to cause a variable to change value when all resource conditions have been met. The two actions are IF and SET. A special SUPPRESS_RUN action can be specified to cause the job to just skipped but marked as having successfully completed with a special status code. For example:

if COLOR eq "ORANGE" then set COLOR = "BLUE"
     if COLOR eq "YELLOW" then suppress_run
     if DISK_SPACE lt 2000 then suppress_run
     set COLOR = "BLUE"
     set COUNT -= 1
     set COUNT += 1

Once the job has had ALL resources met the the variable COLOR is set to BLUE. This feature can be used as a semaphore to prevent certain jobs from running when other jobs are or force them to all run at the same time. It can also be used to change a job tree automatically on certain days just by setting up a job that runs on that day with this type of resource list.