Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example 4 - Job monitoring - 1

&pagelevel(3)&pagelevel

The jobs AJOB, BJOB and CJOB are started and monitored from a control job.

/         SET-LOGON-PARAMETERS JOB-NAME=STEUER
/         ENTER-JOB FROM-FILE=AJOB,MONJV=JV.AJOB
/         ENTER-JOB FROM-FILE=BJOB,MONJV=JV.BJOB
/         ENTER-JOB FROM-FILE=CJOB,MONJV=JV.CJOB———————————————————————  (1) 
/         SHOW-JOB-STATUS JOB-ID=*MONJV(JV.AJOB)———————————————————————  (2) 
/         WAIT-EVENT UNTIL=*JV(CONDITION=((JV.AJOB,1,2)=C'$T' OR -
/                                        (JV.AJOB,1,2)=C'$A'),-
/                              TIME-LIMIT=3600,TIMEOUT-LABEL=FEHL1) ———  (3) 
/         SKIP-COMMANDS TO-LABEL=NORMAL,IF=*JV(CONDITION=((JV.AJOB,1, -
                                                           2)=C'$T')) —  (4) 
/.FEHL1   CANCEL-JOB JOB-ID=*MONJV(JV.CJOB) ———————————————————————————  (5) 
/.NORMAL  SET-JOB-STEP
/         SKIP-COMMANDS TO-LABEL=ENDE,IF=*JV(CONDITION=((JV.BJOB,1,2) -
                                                         NE C'$R'))
/         CHANGE-TASK-PRIORITY JOB-ID=*MONJV(JV.BJOB),RUN-PRIORITY=130—  (6) 
/.ENDE    EXIT-JOB

(1)

The jobs are started and monitored.

(2)

Information about AJOB is interrogated.

(3)

Wait until AJOB terminated (normally or abnormally), but for a maximum of 3600 seconds.

(4)

Check whether AJOB was terminated normally or abnormally.

(5)

In the event of abnormal termination of AJOB, processing of CJOB is likewise aborted.

(6)

If CJOB is still running, the priority is changed.