I'm trying to capture an executing job for eg., my TSO id. But I'm ending up with error. The same script is working for queue=print, but not for queue=execution. Any suggestion would be really helpful. Below is the code that i used.
/* REXX */
"ALLOC F (FINAL) DA ('SYS833K.PRODCHKT.TRACK') SHR REU"
"EXECIO * DISKR FINAL (STEM STC. FINIS"
DO I=1 TO STC.0
ISFOWNER= '*'
JOBNAME='SYS833K'
HLQ=SYS833K
RC=ISFCALLS('ON')
MAIN:
IF I>STC.0 THEN
EXIT
PARSE VAR STC.I S1 "." S2 "." S3
JOBNAM=STRIP(S1)
STATUS=STRIP(S2)
LOOKMSG=STRIP(S3)
JNAME=SUBSTR(JOBNAM,1,6)
ISFPREFIX=JOBNAM
IF STATUS=STC THEN
STATUS=EXECUTION
ELSE
STATUS=PRINT
ISFSORT='JOBID'
IF RC <> 0 THEN DO
SAY 'ISFCALLS RC='RC
RETURN RC
END
ADDRESS SDSF 'ISFEXEC ST'
IF RC <> 0 THEN DO
SAY 'ISFEXEC RC='RC
RETURN RC
END
DO IX=1 TO JNAME.0
TRACE ?R
IF QUEUE.IX=STATUS
THEN
DO
"ALLOC F (SPLV) DA ('"USERID()".LICFIN.PDS("JNAME.IX")') SHR REU"
CC=RC
END
"ALLOC F (FINAL) DA ('SYS833K.PRODCHKT.TRACK') SHR REU"
"EXECIO * DISKR FINAL (STEM STC. FINIS"
DO I=1 TO STC.0
ISFOWNER= '*'
JOBNAME='SYS833K'
HLQ=SYS833K
RC=ISFCALLS('ON')
MAIN:
IF I>STC.0 THEN
EXIT
PARSE VAR STC.I S1 "." S2 "." S3
JOBNAM=STRIP(S1)
STATUS=STRIP(S2)
LOOKMSG=STRIP(S3)
JNAME=SUBSTR(JOBNAM,1,6)
ISFPREFIX=JOBNAM
IF STATUS=STC THEN
STATUS=EXECUTION
ELSE
STATUS=PRINT
ISFSORT='JOBID'
IF RC <> 0 THEN DO
SAY 'ISFCALLS RC='RC
RETURN RC
END
ADDRESS SDSF 'ISFEXEC ST'
IF RC <> 0 THEN DO
SAY 'ISFEXEC RC='RC
RETURN RC
END
DO IX=1 TO JNAME.0
TRACE ?R
IF QUEUE.IX=STATUS
THEN
DO
"ALLOC F (SPLV) DA ('"USERID()".LICFIN.PDS("JNAME.IX")') SHR REU"
CC=RC
END
Thanks,
Viswa..