Page 1 of 1

Re: REXX code for jobs running in dependency.

PostPosted: Sun Aug 08, 2010 6:19 pm
by mukesh.py
hi all..

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

Re: REXX code for jobs running in dependency.

PostPosted: Sun Aug 08, 2010 8:20 pm
by NicC
Do not do this like this!! Your job may not run for hours whereas your rexx exec will run in a second so will finish before your job starts.
Have a step in your first job that will execute TSO (IKJEFT01) and submit the second job. Use condition codes to ensure that the TSO step runs only on successful completion of previous steps.

Re: REXX code for jobs running in dependency.

PostPosted: Mon Aug 09, 2010 5:20 am
by dick scherrer
Hello,

As you were told in your other multiple topics, do not do this.

This topic and the other duplicates in our forums are all being locked.

d