This is an example of how to control the flow of a set of jobs that can only be run one at a time. In this case the DATABASE variable limits the access to a database to one job at a time. Though the three update jobs (DB_UPDATE1, DB_UPDATE2 and DB_UPDATE3) are all initiated at the same time (by SUB2), they can only run one at a time. The resource lists for each job are as follows:
IF DATABASE .EQS. "ACTIVE" THEN WAIT
SET DATABASE = "ACTIVE"
The jobs first check the DATABASE variable to see if it is set to ACTIVE and wait if it is set to ACTIVE. However if the DATABASE variable is set to IDLE by the End Action:
SET DATABASE = "IDLE"
then the job will run.