CA Workload Automation ESP Edition

Expand all | Collapse all

ESP Reporting.

  • 1.  ESP Reporting.

    Posted 05-23-2019 10:02 AM

    Hi, 

     

    I never coded script for ESP scheduler. With help of google I have done coding and achieved 70 percent of my desired result. For completion I am not able to find any help from google. Someone  please help me out. 

     

    I have to generate monthly report for different carriers. Carriers are identified using JOBNAMES. Instead of PL/I program I opted ESP script. Planned to schedule the new JOB to run on First day of every month. 

     

    I have coded the JCL as below

    //TSID2510 EXEC PGM=ESP,REGION=4M                                      
    //*                                                                    
    //SYSIN    DD   DSN=E861559.SC239212.TEST.CNTLLIB(TSID2513),DISP=SHR  
    //SYSPRINT DD   DSN=E861559.TSID025.A01,DISP=OLD                      
    //SYSUDUMP DD   SYSOUT=* 

    In TSID2513 member in control librarey I have coded as below 

    REPORT
    HISTFILE HIST1
    FROM 01AM APRIL 1 2019 TO 11PM APRIL 30 2019
    CRITERIA JOBNAME EQ 'SID028' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID024A' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID024C' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID026' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID033' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID045' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA51A' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA5TP' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA005U' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA5DB' AND CMPC EQ 0
    DISPLAY JOBNAME 25 'SYSTEM NAME',EXECSDATE 20 'FTP DATE',
    ENDT 15 'FTP TIME',CMPC 15 'RETURN' 'CODE'
    SORT JOBNAME EXECSDATE
    BREAK JOBNAME 6 SPACE 1

    ENDR

     

    I am getting the result but  the output is containg the control cards as well as below.

    1ESP VER 11.4 BATCH INTERFACE 04.49.54 THURSDAY MAY
    0
    REPORT
    HISTFILE HIST1
    FROM 01AM APRIL 1 2019 TO 11PM APRIL 30 2019
    CRITERIA JOBNAME EQ 'SID028' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID024A' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID024C' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID026' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID033' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'SID045' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA51A' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA5TP' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA005U' AND CMPC EQ 0
    CRITERIA JOBNAME EQ 'ABA5DB' AND CMPC EQ 0
    DISPLAY JOBNAME 25 'SYSTEM NAME',EXECSDATE 20 'FTP DATE',

    ENDT 15 'FTP TIME',CMPC 15 'RETURN' 'CODE'
    SORT JOBNAME EXECSDATE
    BREAK JOBNAME 6 SPACE 1
    ENDR
    1ESP VER 11.4 BATCH INTERFACE 04.49.54 THURSDAY MAY
    0
    SYSTEM NAME FTP DATE FTP TIME

    ABA005U TUE 2APR19 20.18.38
    ABA005U TUE 2APR19 04.47.24
    ABA005U WED 3APR19 22.18.53
    ABA005U THU 4APR19 22.40.25
    ABA005U FRI 5APR19 20.06.12

     

    Is there any way to strip the top part and contain only report part as below

    SYSTEM NAME FTP DATE FTP TIME 

    ABA005U TUE 2APR19 20.18.38 
    ABA005U TUE 2APR19 04.47.24 
    ABA005U WED 3APR19 22.18.53 
    ABA005U THU 4APR19 22.40.25 
    ABA005U FRI 5APR19 20.06.12.

     

    For this do I need to code anything else in jcl or in ESP report script. Please advise and help.

     

    Thanks & Regards



  • 2.  Re: ESP Reporting.

    Posted 05-23-2019 01:43 PM

    Hi, 

    To remove the titles I add a step after the report step. The step runs some REXX that removes unwanted lines.  

     It is not simple for someone not familiar with JCL. But it is not terrible. 

     

    Below is an example. The lines in bold need to be modified. The PRINT2 is the dataset created from the report. 

    JCL 

    //STEP020 EXEC PGM=IKJEFT01,REGION=4096K,DYNAMNBR=25
    //SYSEXEC DD DSN=POWXXX.TEST.CNTL,DISP=SHR
    //INDD DD DSN=POWXXX.PRINT2,DISP=SHR
    //OUTDD DD DSN=POWXXX.PRINT3,DISP=(NEW,CATLG,DELETE),
    //                    UNIT=SYSDA,SPACE=(CYL,(1,1)),
    //                    DSORG=PS,RECFM=FB,
    //                    LRECL=133,BLKSIZE=0
    //SYSTSPRT DD SYSOUT=*
    //SYSTSIN DD *
    %RXRPT1
    /*

     

    REXX

    /* REXX */
    /**************************************************************/
    /* THIS IS USED BY JOB PSEE6RPT */
    /* THIS REXX PROGRAM WILL REMOVE EXTRA LINES FROM */
    /* AN ESP REPORT */
    /**************************************************************/
    /* WRITTEN BY -- */
    /* MOD -- */
    /**************************************************************/
    "EXECIO * DISKR INDD (STEM INPUT1. FINIS"
    "FREE DD(INDD)"
    DO N = 1 TO INPUT1.0
    PARSE VAR INPUT1.N W1 W2 W3 W4 W5 W6 W7 W8 W9 W10
    W1 = STRIP(W1)
    IF W1 = 'HISTFILE' THEN ITERATE
    IF W1 = 'SETWIDTH' THEN ITERATE
    IF W1 = 'FROM' THEN ITERATE
    IF W1 = 'SORT' THEN ITERATE
    IF W1 = 'DISPLAY' THEN ITERATE
    IF W1 = 'BREAK' THEN ITERATE
    IF W1 = 'ENDR' THEN ITERATE
    IF W1 = '1ESP' THEN ITERATE
    IF W1 = '0' THEN ITERATE
    IF W1 = 'REPORT' THEN ITERATE
    IF W1 = 'TITLE' THEN ITERATE
    IF W1 = 'ABEND' THEN ITERATE

    IF W1 = 'CRITERIA' THEN ITERATE
    IF W1 = 'SUBTOTAL' THEN ITERATE
    IF W1 = 'TOTAL' THEN ITERATE
    IF W1 = 'OR' THEN ITERATE
    IF W1 = 'JOBNAME' THEN ITERATE
    IF W1 = 'CHANGED' THEN ITERATE
    IF W1 = 'START' THEN ITERATE
    SYSER = POS(SYSERROR,INPUT1.N)
    IF SYSER > 0 THEN ITERATE
    RUNN = POS(RUNNING,INPUT1.N)
    IF RUNN > 0 THEN ITERATE
    QUEUE INPUT1.N
    END
    QUEUE ''
    "EXECIO * DISKW OUTDD (FINIS"
    "FREE F(OUTDD)"
    EXIT