ESP Workload Automation

Expand all | Collapse all

Is there a way for ESP to recognize a conditional release on an external wob?

  • 1.  Is there a way for ESP to recognize a conditional release on an external wob?

    Posted Mar 16, 2017 12:16 PM

    The condition code is not recognized. How do I get this to work or is this possible in ESP?

     

    JOB C02465G EXTERNAL SCHEDULED('TODAY') APPLID(CJOBA)
      RUN REF CJOBS.GROUPX                              
       RELEASE ADD(CJOBS.GROUPX) COND(RC(1))            
    ENDJOB                                              

     

    JOB CJOBS.GROUPX TASK SELFCOMPLETING
      /* X_TEST _ GROUP                
      TAG CJOB_1                       
      DATASET C02465.JCL.CNTL          
      RUN TODAY                        
      RELEASE ADD(C02465A)             
      RELEASE ADD(C02465B)             
      RELEASE ADD(C02465C)             
    ENDJOB                             



  • 2.  Re: Is there a way for ESP to recognize a conditional release on an external wob?
    Best Answer

    Posted Mar 16, 2017 01:42 PM

    Try having the job release a simple self-completing task if it gets a 1.  You can add this task as an external to your other application. So:

     


    =================================================
    APPL APPLA

    JOB C02465G
     RUN TODAY
     RELEASE ADD(CJOBS.GROUPX) COND(RC(1))
    ENDJOB

    JOB CJOBS.GROUPX TASK SELF COMPLETING
     RUN TODAY
    ENDJOB

    ==========================================================
    APPL APPLB

    AIX_JOB CJOBS.GROUPX EXTERNAL APPLID(APPLA) SCHEDULED(TODAY)
      TAG HM_APPL=APPLA                                     
      RUN WORKDAYS                                             
      RELEASE ADD(C02455H)                                    
    ENDJOB                                                     


    JOB C02455H
      /* X_TEST _ GROUP                
      TAG CJOB_1                       
      DATASET C02465.JCL.CNTL          
      RUN TODAY                        
      RELEASE ADD(C02465A)             
      RELEASE ADD(C02465B)             
      RELEASE ADD(C02465C)             
    ENDJOB   

    ======================================================

     

    This would be two applciatoins, APPLA and APPLB.  I've taken the liberty of converting your task into a z/OS job, and giving it a new name (using the next letter up in the alphabet).  What will happen is, if C02465G gets a return code of 1, it will release a task that will act as your external in APPLB.  If it gets marked as complete, then the external releases C02455H.

     

    Of course, from a purely design standpoint, you could make this a little cleaner by simply releasing the second job only if the first job gets a 1, then using a cleanup task to clean the second job up at a specific time if it never runs.  That could look something like this:

     


    =================================================
    APPL APPLA
     
    JOB C02465G
     RUN TODAY
     RELEASE ADD(C02455H) COND(RC(1))
    ENDJOB
     
    JOB C02455H
      /* X_TEST _ GROUP                
      TAG CJOB_1                       
      DATASET C02465.JCL.CNTL          
      RUN TODAY                        
      RELEASE ADD(C02465A)             
      RELEASE ADD(C02465B)             
      RELEASE ADD(C02465C)             
    ENDJOB   
     
    JOB CLEANUP TASK SELFCOMPLETING              
     RUN TODAY                                            
     DELAYSUB 23:40                              
     ESP AJ C02455H COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
    ENDJOB                                       
    ======================================================