Workload Automation

Expand all | Collapse all

run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

Jump to Best Answer
  • 1.  run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 12:58 PM

    Hi, have a coding question for the group.  I need to code an appl where job xxxx will run if another job in the appl job yyyy ends in cc 0, cc 1 or cc 4.  If job yyyy ends in cc 2, then do not run xxxx.

    Is there a way of doing this without a yyyy_jobend monitor ?  (or without pug-ugly rexxon?).  We are esp 1.13.

    thanks



  • 2.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 02:22 PM

    Hi Mike,

     

    Yes, you may code something like below:

     

    JOB Y

    ....

    RELEASE ADD(X) COND(RC(0:1))

    RELEASE ADD(X) COND(RC(4))

    ENDJOB

     

    JOB X

    ...

    ENDJOB

     

    See more about RELEASE with COND on Command Reference Guide.

     

    Lucy



  • 3.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 02:32 PM

    Hey Lucy (glad to hear from you!)

    so given:

    JOB Y

    RELEASE ADD(X) COND(RC(0:1))

    RELEASE ADD(X) COND(RC(4))

    RUN ANY

    ENDJOB

     

    JOB X

    RUN ANY

    ENDJOB

     

    So Job X will run only if Y gets a 0, 1 or 4...., ie if Y gets a cc 2 or Y gets a cc12..the only possible way for X to run is if Y gets 0, 1, or 4?

    any other condition X will simply be BYPASSed coded as above? (I thought I might have to make X a conditional job or something.)



  • 4.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 03:51 PM

    Hi Mike,

     

    If JOB Y is considered successfull with return code 2 or 12, then JOB X will be bypassed.

     

    See the example below in the manual:

     

    Example: Releasing a job based on a job's return code

     

    Successful completion

     

    In this example, if PAYJOB14 completes successfully and the return code is not 8, then PAYJOB15 is bypassed. Alternatively, PAYJOB15 runs if PAYJOB14 completes successfully with a return code of 8.

     

    APPL PAYROLL

     

    JCLLIB 'CYBER.JCL.CNTL'

     

    JOB PAYJOB14

     

    RUN DAILY

     

    RELEASE ADD(PAYJOB15) COND(RC(8))

     

    ENDJOB

     

    JOB PAYJOB15

     

    RUN DAILY

     

    ENDJOB

     

     

    Hope this helps,

     

    Lucy




  • 5.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-26-2014 09:15 AM

    I coded this test appl below and it is still not working.  The 1st test job A#BIEGA0 gets a cc 0….when I run the appl, the 2 successors get bypassed.

    I would expect them NOT to be bypassed, but to also run unless A#BIEGA0 gets a cc 2 or a cc3…only then I’d hoped they’d be bypassed

    JOB A#BIEGA0

      CCFAIL (*,GT,4)

      RELEASE ADD(A#BIEGA1) COND(RC(0:1))

      RELEASE ADD(A#BIEGA1) COND(RC(4))

      RELEASE ADD(A#BIEGA4) COND(RC(0:1))

      RELEASE ADD(A#BIEGA4) COND(RC(4))

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA1

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA4

      RUN ANY

    ENDJOB

     

    Where did I get off at the wrong exit on this?



  • 6.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-26-2014 10:59 AM

    Looks like ESP is only honoring the second of each pair of cond(rc stmts

    JOB A#BIEGA0

      CCFAIL (*,GT,4)

      RELEASE ADD(A#BIEGA1) COND(RC(0:1))

      RELEASE ADD(A#BIEGA1) COND(RC(4))

      RELEASE ADD(A#BIEGA4) COND(RC(0:1))

      RELEASE ADD(A#BIEGA4) COND(RC(4))

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA1

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA4

      RUN ANY

    ENDJOB

     

     

    ………….so apparently I am limited to just 1

    This works if cc is 0 or 1 (successors run if pred cc is 0 or 1….bypassed if pred cc is 4)

    ……..apparently the 2nd cond(rc stmt overrides the 1st, so can only have 1 such stmt:

     

    JOB A#BIEGA0

      CCFAIL (*,GT,4)

      RELEASE ADD(A#BIEGA1) COND(RC(4)) <<< apparently ignored or overridden by following stmt

      RELEASE ADD(A#BIEGA1) COND(RC(0:1))

      RELEASE ADD(A#BIEGA4) COND(RC(4))  <<< apparently ignored or overridden by following stmt

      RELEASE ADD(A#BIEGA4) COND(RC(0:1))

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA1

      RUN ANY

    ENDJOB

     

    JOB A#BIEGA4

      RUN ANY

    ENDJOB



  • 7.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2
    Best Answer

    Posted 11-26-2014 11:12 AM

    Found the solution:  OR’ing it worked…….successors ran if preds cc was 0, 1, or 4……..bypassed if pred cc was 2 (or 3)

    RELEASE ADD(A#BIEGA4) COND(RC(0:1) OR RC(4))

     

     

    Thanks!



  • 8.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-26-2014 01:17 PM

    Hi Mike,

     

    Glad that you figured it out. I replied to the update with same solution, somehow it didn't show up.

     

    So should use the COND with OR instead of multitple RELEASE ADD in this condition.

     

    Regards,

     

    Lucy



  • 9.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-26-2014 01:19 PM

    Thank you Lucy



  • 10.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 02:41 PM

    Hey Lucy….so wonderful to hear from you. I am back with ESP support but rather than from the system side like I was for so many years, I am now working as a scheduler (with Kelly and her group), which is wonderful.   Since July, our mainframe system support went over to Acxiom, so along with it went our contract…..ergo I have to ask them to open any tickets rather than do it myself, so I was hoping that I could get a response from the community, as it’s the only easy vehicle I have for asking questions now.



  • 11.  Re: run  job X if another job, Y, ends in cc 0, 1, or 4, but do not run X if Y ends in cc 2

    Posted 11-25-2014 03:52 PM

    Welcome back Mike!

     

    And hope you have a good experience here in ESP user communities.

     

    Lucy