ESP Workload Automation

  • 1.  Setting NON Zero return codes in ESP Batch

    Posted Nov 10, 2016 01:52 PM
      |   view attached

    I have developed a process to set a non zero return code for ESP batch functions.   I am currently using this in the History Archive process when we close the HIST1 , Copy the History Records and Archive Records, and open HIST1.

     

    It was suggested I put this out to the community in-case anyone else is interested in using it.

     

    The Psuedo code is

    ESPBatch

     Write SYSPRINT to Temp file

    IEBGENER

      Print Temp file back to SYSOUT

    IKJEFT01 

        Use Rexx to scan for specific messages and set the return code.

     

    If this is of interest I will be happy to post the three steps plus the REXX.

     

    Here is the REXX code.  It is very simple and is attached.

     

     

    This was the only way I could find to set a return code when an ESP Batch step got an error.

     

    The rewrite of the ESP History File Archive went from 6 steps to 14.

     

    Step Name

    Restart? Y/N

    Step Program

    Description

    STEP01

    Y

    ESP    

    Close the HIST1 file for processing

    STEP02

    N

    IEBGENER

    Print the ESP Batch file output

    STEP03

    N

    IKJEFT01

    Parse the ESP Batch output and set error code

    STEP04

    Y

    IDCAMS 

    Backup the HISTFILE to a temp home

    STEP05

    Y

    ESP    

    Copy the Archive Records and Reload records

    STEP06

    N

    IEBGENER

    Print the ESP Batch file output

    STEP07

    N

    IKJEFT01

    Parse the ESP Batch output and set error code

    STEP08

    Y

    IDCAMS 

    Delete/Define the ESP Histfile

    STEP09

    Y

    SORT   

    Sort the records to be reloaded into the HISTFILE

    STEP10

    Y

    IDCAMS 

    Load the records into the HISTFILE

    STEP11

    Y

    ESP    

    OPEN the HIST1 file

    STEP12

    N

    IEBGENER

    Print the ESP Batch file output

    STEP13

    N

    IKJEFT01

    Parse the ESP Batch output and set error code

    STEP14

    Y

    IDCAMS 

    List the HISTFILE for later review for trending for size

     

     

    Lizette

    Attachment(s)



  • 2.  Re: Setting NON Zero return codes in ESP Batch

    Broadcom Employee
    Posted Nov 14, 2016 08:08 AM

    Hi Lizette,

     

    Thank you for sharing.  I changed it from a question to a discussion.

     

    Do you use BATCHRC in ESP init parm? Wonder if it can help to show the proper return code.

    BATCHRC MAXSEV|LEGACY

    MAXSEV causes the return code to reflect the most severe error detected. LEGACY keeps the original behavior. The original behavior is preserved unless MAXSEV is explicitly requested. The setting remains active until changed by BATCHRC command or until IPL. The new command applies to master and proxy subsystems.

     

    Note: It seems the above is not in the ESP related manuals. I will seek to add it.

     

    Lucy



  • 3.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 14, 2016 10:41 AM

    Thank you Lucy.

     

    The only reference I could find is in this manual Dynamic Agent Configuration Enhancement in section SAVEAGDF Command: Save Agent Definitions

     

    But it does not describe this parameter or how it is used.


    This is the example:

    //NEWGEN EXEC PGM=IEFBR14
    //AGENTDEF DD DSN=GL.PROD.TEMPAGDF(+1),DISP=(,CATLG,DELETE),
    // UNIT=SYSDA,VOL=SER=ESPVOL,SPACE=(TRK,1),
    // DCB=(DSORG=PS,RECFM=FB,BLKSIZE=23440,LRECL=80)
    //*
    //ESP EXEC PGM=ESP,PARM='SUBSYS(ESPM)',COND=(0,LT)
    //STEPLIB DD DISP=SHR,DSN=GL.PROD.LOADLIB
    //SYSPRINT DD SYSOUT=*
    //SYSIN DD *
    OPER BATCHRC MAXSEV
    SAVEAGDF 'GL.PROD.TEMPAGDF(0)'

     

    Lizette



  • 4.  Re: Setting NON Zero return codes in ESP Batch

    Broadcom Employee
    Posted Nov 15, 2016 12:13 PM

    Our doc team will add BATCHRC related information in the ESP online manual.

     

    Sorry about that.

     

    Lucy



  • 5.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 16, 2016 12:28 PM

    Lucy, while awaiting the addition of BATCHRC to the online manuals, could you please elaborate a bit on what it all entails?

    Must a particular ptf be applied before this can be done in pagemode?

    As Lizette points out, there are some ESP batch cmds that simply always end in 0, and you must eyeball the sysprint to see if there was any squawking......How could BATCHRC help with that assuming its a one step job that returns 0 right now? 

    Currently, if we do an LI on a job, it appears to show just the last rc from a multi-step job (often a 0 even if prior steps blow up six ways to Sunday).  If we issued BATCHRC MAXSEV in pagemode on the master and each proxy, would that change to start showing the highest RC as opposed to the last?



  • 6.  Re: Setting NON Zero return codes in ESP Batch

    Broadcom Employee
    Posted Nov 17, 2016 08:49 AM

    Hi Michael,

     

    It should be on the base of version 11.4.

     

    If the ESP command returns zero, then this parm won't help. It helps in the scenario that multiple ESP commands are entered in same ESP batch step, and some (not the last) return non-zero return code.

     

    As the Tuesday tip in the link below, this BATCHRC only affects ESP batch step (not even the ESP batch job) and ESP report step (like SADGEN), it won't affect non-ESP batch jobs:

    https://communities.ca.com/message/100614154

     

    It won't help on the LI command.

     

    Thanks,

     

    Lucy



  • 7.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 17, 2016 12:54 PM

    Thanks Lucy



  • 8.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 16, 2016 12:53 PM

    very nice Lizette.  Would you please post the '3 steps'?   This should prove valuable for esp cmds that do not bow to the batchrc cmd. (for example I did a batch  resdef b- list   and it came back with a cc 0 and 

    ESP1905I No Resources found matching B-

    Adding the batchrc maxsev did not change anything:

    ESP VER 11.4 BATCH INTERFACE

    OPER BATCHRC MAXSEV
    ESP2791I Batch RC mode is MAXSEV
    RESDEF B- LIST
    ESP1905I No Resources found matching B-

    cc was still 0, so in cases such as this, your eloquent rexx procedure might be the only solution currently.

    thanks



  • 9.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 16, 2016 02:58 PM

    Here is the JCL

     

    //STEP01 EXEC PGM=ESP,PARM='SUBSYS(ESP)'
    //SYSABEND DD SYSOUT=U,FREE=CLOSE,SPIN=UNALLOC
    //SYSUDUMP DD SYSOUT=U,FREE=CLOSE,SPIN=UNALLOC
    //*
    //SYSPRINT DD DISP=(,PASS),UNIT=SYSDA,DSN=&&ESPTEMP,
    // LRECL=135,RECFM=FB,BLKSIZE=0,SPACE=(CYL,(5,100),RLSE)
    //*
    //SYSIN DD *
    OPER TRACKING NOSTORE
    OPER HISTFILE HIST1 CLOSE
    /*
    //*
    //* -----------------------------------------------------------------
    //*
    //* STEP02: THE FOLLOWING IEBGENER WILL PRINT THE OUTPUT FROM
    //* THE ESP BATCH STEP TO SYSOUT. SO THE INFORMATION IS
    //* MAINTAINED WITHIN THE JOB STREAM.
    //*
    //* -----------------------------------------------------------------
    //*
    //STEP02 EXEC PGM=IEBGENER DO NOT CONDITION CODE THIS STEP
    //SYSPRINT DD SYSOUT=*
    //*
    //SYSUT1 DD DISP=(OLD,PASS),DSN=&&ESPTEMP
    //SYSUT2 DD SYSOUT=*
    //*
    //SYSIN DD DUMMY
    //*
    //* -----------------------------------------------------------------
    //*
    //* STEP03: PARSE MESSAGES. SEE IF THERE IS A MESSAGE IN
    //* THE ESP BATCH STEP THAT NEEDS A DIFFERENT RC
    //*
    //* -----------------------------------------------------------------
    //*
    //STEP03 EXEC PGM=IKJEFT01,DYNAMNBR=100,PARM='%RXESPMSG'
    //*
    //SYSPROC DD DISP=SHR,DSN=SYS1.CAI.ESP.REXX
    //*
    //* -----------------------------------------------------------------
    //*
    //* THE ESPRPTIN IS THE TEMP FILE FROM THE ESP BATCH STEP.
    //* THE REXX RXESPMSG WILL BE USED TO PARSE THROUGH THE OUPUT
    //* AND IF ANY MESSAGE ARE IN THE OUTPUT THAT SHOULD CAUSE
    //* THIS PROCESS TO FAIL, IT WILL SET AN APPROPRIATE RC
    //*
    //* -----------------------------------------------------------------
    //*
    //ESPRPTIN DD DISP=(OLD,DELETE),DSN=&&ESPTEMP
    //*
    //SYSPRINT DD SYSOUT=*
    //SYSPROC DD DISP=SHR,DSN=SYS1.CAI.ESP.REXX
    //SYSTSPRT DD SYSOUT=*
    //SYSTERM DD DUMMY
    //SYSOUT DD SYSOUT=*
    //*
    //SYSTSIN DD DUMMY

     

     

    Lizette



  • 10.  Re: Setting NON Zero return codes in ESP Batch

    Posted Nov 16, 2016 04:03 PM

    thank you Lizette