I am trying to submit two jobs test2 and test1 using this rexx code. test2 should run only after test1 completes successfully for which i have set rconditions in the code.
the current code shows no error and gives the below o/p
1. first job gets submitted successfully and gives a return code of 0.
2. the message 'success1' is thrown.
None of any other messages that i have put as a check point is getting displayed and the second job test1 does not get submitted.
Can someone please advice the error in the rexx code :
/* REXX */
address tso "SUBMIT 'PUBLIC.TEST.jcllib(test2)'"
CALL EVLRTC
say 'call success2'
address tso "SUBMIT 'PUBLIC.TEST.jcllib(test1)'"
say 'logic success'
EXIT 0
EVLRTC:
say call 'success1'
RC=ISFCALLS("ON")
ISFPREFIX='JOBID*'
ADDRESS SDSF "ISFEXEC ST"
ISFCOLS= "JNAME JOBID RETCODE"
COLDTL=WORD(ISFCOLS,1)
DO IX=1 TO ISFROWS
DO JX=1 TO WORDS(ISFCOLS)
COL=WORD(ISFCOLS,JX)
END
IF JOBID.IX = 'JOBID'
THEN
RCCODE=RETCODE.IX
SELECT
WHEN RCCODE > 8
THEN SAY 'BAD RETURN CODE'
EXIT 0
WHEN RCCODE < 9
THEN
RC=ISFCALLS("OFF")
RETURN 0
OTHERWISE
SAY 'JOB HAS ERROR'
EXIT 0
END
END
address tso "SUBMIT 'PUBLIC.TEST.jcllib(test2)'"
CALL EVLRTC
say 'call success2'
address tso "SUBMIT 'PUBLIC.TEST.jcllib(test1)'"
say 'logic success'
EXIT 0
EVLRTC:
say call 'success1'
RC=ISFCALLS("ON")
ISFPREFIX='JOBID*'
ADDRESS SDSF "ISFEXEC ST"
ISFCOLS= "JNAME JOBID RETCODE"
COLDTL=WORD(ISFCOLS,1)
DO IX=1 TO ISFROWS
DO JX=1 TO WORDS(ISFCOLS)
COL=WORD(ISFCOLS,JX)
END
IF JOBID.IX = 'JOBID'
THEN
RCCODE=RETCODE.IX
SELECT
WHEN RCCODE > 8
THEN SAY 'BAD RETURN CODE'
EXIT 0
WHEN RCCODE < 9
THEN
RC=ISFCALLS("OFF")
RETURN 0
OTHERWISE
SAY 'JOB HAS ERROR'
EXIT 0
END
END