Loading...
Select Version
&pagelevel(3)&pagelevel
Program monitoring
The second example illustrates the use of monitoring job variables for communication between programs. There are two programs, each within a separate task.
Program 1 is to run whatever the circumstances, while the decision whether program 2 runs or not depends upon the outcome of program 1. In other words, program 2 must wait for program 1 to finish and check whether it was terminated normally.
The monitoring job variable is deleted by JOB2 after a check query. Both jobs are started under the same user ID. The job can provide further processing steps after program 1, regardless of the execution of job JOB2.
/ SET-LOGON-PARAMETERS JOB-NAME=JOB1
/ START-PROGRAM FROM-FILE=PROGRAM-1,MONJV=JV.PROG1
/ SET-JOB-STEP
/ SKIP-COMMANDS TO-LABEL=FEHL,IF=*JV(CONDITION=((JV.PROG1,1,2)=C'$A'))
/ START-EXE FROM-FILE=PROGRAM-XY ———————————————————————————————— (1)
.
.
.
.
/.FEHL SHOW-JV JV=JV.PROG1
/ EXIT-JOB
/ SET-LOGON-PARAMETERS JOB-NAME=JOB2
/ SHOW-JV JV=JV.PROG1
/ WAIT-EVENT UNTIL=*JV(CONDITION=(((JV.PROG1,1,2)=C'$T' OR -
/ (JV.PROG1,1,2)=C'$A')), -
/ TIME-LIMIT=3600,TIMEOUT-LABEL=FEHL)
/ SKIP-COMMANDS TO-LABEL=FEHL,IF=JV(CONDITION=((JV.PROG1,1,2)=C'$A'))
/ START-EXE FROM-FILE=PROGRAM-2
/.FEHL SHOW-JV JV=JV.PROG1
/ DELETE-JV JV=JV.PROG1
/ EXIT-JOB
(1) As of BLSSERV V2.3, the START-PROGRAM command is replaced by the START-EXECUTABLE-PROGRAM command