Check status of jobs in REXX
Posted: Thu Jun 16, 2016 7:14 pm
Good day. Is it possible to check the status of the job and its RC, if the job is running from REXX? The return of these values to the job runs the REXX(in a neighboring topics I asked for help and gave an example of how to solve the problem, for it and designed this task)? So far I've made an example in REXX(only to check the status, separately running task)):
But it might not be the best option. Can anyone advise better?
/******************************** REXX *****************************/
STRING = 'IKJ56192I JOB EXAMPLE(JOB00578) ON OUTPUT QUEUE'
DO TIME=1 TO 10 UNTIL (Y = STRING)
ADDRESS TSO
X = OUTTRAP('LOG.')
"TSO STATUS EXAMPLE"
X = OUTTRAP('OFF')
Y = LOG.1
CALL SYSCALLS('ON')
ADDRESS SYSCALL
"SLEEP" 1
CALL SYSCALLS 'OFF'
SAY ''TIME' Y='LOG.1
END
SAY 'END'
STRING = 'IKJ56192I JOB EXAMPLE(JOB00578) ON OUTPUT QUEUE'
DO TIME=1 TO 10 UNTIL (Y = STRING)
ADDRESS TSO
X = OUTTRAP('LOG.')
"TSO STATUS EXAMPLE"
X = OUTTRAP('OFF')
Y = LOG.1
CALL SYSCALLS('ON')
ADDRESS SYSCALL
"SLEEP" 1
CALL SYSCALLS 'OFF'
SAY ''TIME' Y='LOG.1
END
SAY 'END'
But it might not be the best option. Can anyone advise better?