REXX code for jobs running in dependency.



IBM's Command List programming language & Restructured Extended Executor

Re: REXX code for jobs running in dependency.

Postby mukesh.py » Sun Aug 08, 2010 6:19 pm

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
mukesh.py
 
Posts: 8
Joined: Tue Nov 11, 2008 10:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: REXX code for jobs running in dependency.

 

Re: REXX code for jobs running in dependency.

Postby NicC » Sun Aug 08, 2010 8:20 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2702
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: REXX code for jobs running in dependency.

Postby dick scherrer » Mon Aug 09, 2010 5:20 am

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
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post