SeanHoppe.com > Cleo Code Samples > CLEO CLP: PRTACKTP & PRTCNNSEL

CLEO/CLP: PRTACKTP and PRTCNNSEL -- CLEO Reports for Late FAs and Connection Errors

 
 /*****************************************************************************/
 /*  CL runs the following CLEO reports: PRTACKTP and PRTCNNSEL.             */
 /*  CL runs custom queries: -- Queries are located in LIB:XXXXXX             */
 /*  EXT_ENVERR                                                               */
 /*  EXT_GENERR                                                               */
 /*  EXT_TRNERR                                                               */
 /*  EXT_UNWERR                                                               */
 /*  EXT_WRPERR                                                               */
 /*                                                                           */
 /*  To add a new EXTOL generated report use the following date variables     */
 /*  Start Date: &WDATE / End Date (today): &TDATE                            */
 /*  To add a new customer query report use the following date variables      */
 /*  Start Date: &STARTDATE / End Date (today): &ENDDATE                      */
 /*                                                                           */
 /*****************************************************************************/
 PGM
             DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&NBR) TYPE(*CHAR) LEN(6)

             DCL        VAR(&SYSDATE) TYPE(*CHAR) LEN(6)
             DCL        VAR(&YESTERDAY) TYPE(*DEC) LEN(8 0)
             DCL        VAR(&LILIAN) TYPE(*CHAR) LEN(4)
             DCL        VAR(&JUNK1) TYPE(*CHAR) LEN(8)
             DCL        VAR(&JUNK2) TYPE(*CHAR) LEN(23)
             DCL        VAR(&WDATE) TYPE(*CHAR) LEN(8)
             DCL        VAR(&STARTDATE) TYPE(*CHAR) LEN(16)
             DCL        VAR(&ENDDATE) TYPE(*CHAR) LEN(16)
             DCL        VAR(&W2DATE) TYPE(*CHAR) LEN(8)
             DCL        VAR(&DATE) TYPE(*CHAR) LEN(8)
             DCL        VAR(&TDATE) TYPE(*CHAR) LEN(8)
             DCL        VAR(&HOUR) TYPE(*CHAR) LEN(2)

             ADDLIBLE   LIB(EXTSYSF)
             MONMSG     MSGID(CPF0000)
             ADDLIBLE   LIB(EXTSYS)
             MONMSG     MSGID(CPF0000)
             ADDLIBLE   LIB(XXXXXX)
             MONMSG     MSGID(CPF0000)

             DLTSPLF    FILE(LLCPF4R$)
             MONMSG     MSGID(CPF0000)
             DLTSPLF    FILE(LLGPF6R$)
             MONMSG     MSGID(CPF0000)

 /* RETRIEVE CURRENT DATE AND HOUR OF DAY    */

             RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&SYSDATE)
             RTVSYSVAL  SYSVAL(QHOUR) RTNVAR(&HOUR)

 /* &LILIAN WILL CONTAIN THE NUMBER OF DAYS BETWEEN TODAY AND */
 /* AND OCT 14, 1582.                                         */

             CALLPRC    PRC(CEELOCT) PARM(&LILIAN &JUNK1 &JUNK2 *OMIT)

 /*  CONVERT LILLIAN TO MMDDYYYY DATE  */
             CALLPRC PRC(CEEDATE) PARM(&LILIAN 'MMDDYYYY' &TDATE *OMIT)

 /*  CONVERT LILLIAN TO YYYYMMDD DATE  */
             CALLPRC PRC(CEEDATE) PARM(&LILIAN 'YYYYMMDD' &DATE *OMIT)
 /*  SUBTRACTING 5 FROM &LILIAN WILL PRODUCE YESTERDAY'S DATE */

             CHGVAR     VAR(%BIN(&LILIAN)) VALUE(%BIN(&LILIAN) - 5)

 /*  CONVERT LILLIAN TO MMDDYYYY DATE  */
             CALLPRC PRC(CEEDATE) PARM(&LILIAN 'MMDDYYYY' &WDATE *OMIT)
             CHGVAR     VAR(&YESTERDAY) VALUE(&WDATE)

 /* RUN EXTOL CMD FOR LATE FUNCTIONAL ACKS BETWEEN TODAY AND 5 DAYS AGO  */
             PRTACKTP   PERIOD((*AVAIL &WDATE) (*AVAIL &TDATE)) +
                          ASTSSLT(*LATE)
 /* RUN EXTOL CMD TO SHOW INBOUND/OUTBOUND RECEIVE/SEND ERRORS */
             PRTCNNSEL  PERIOD((*AVAIL &WDATE) (*AVAIL &TDATE)) +
                          RCVSTS(*ERROR) SNDSTS(*ERROR) DLTRPT(*YES)

 /*  CUSTOM REPORTS START HERE         */
 /*  CONVERT LILLIAN TO MMDDYYYY DATE  */
             CALLPRC PRC(CEEDATE) PARM(&LILIAN 'YYYYMMDD' &W2DATE *OMIT)

             CHGVAR     VAR(&STARTDATE) VALUE(&W2DATE *TCAT   '00000000')
             CHGVAR     VAR(&ENDDATE) VALUE(&DATE *TCAT   '23599900')

  /* Envelope Error in Extol  */
             OVRPRTF    FILE(QPQXPRTF) DEVTYPE(*SCS) PAGESIZE(8 10.5 +
                          *UOM) LPI(8) CPI(16.7) FOLD(*YES) +
                          PRTQLTY(*STD) PAGRTT(90) UOM(*INCH) +
                          OUTQ(*JOB) HOLD(*YES)
             STRQMQRY   QMQRY(EXT_ENVERR) OUTPUT(*PRINT) +
                          QMFORM(EDILIB/TEST) SETVAR((DATE +
                          &STARTDATE) (DATEEND &ENDDATE))
              DLTOVR        FILE(QPQXPRTF)
  /* Generation Error in Extol  */
              OVRPRTF    FILE(QPQXPRTF) DEVTYPE(*SCS) PAGESIZE(8 10.5 +
                                        *UOM) LPI(8) CPI(16.7) FOLD(*YES) +
                                        PRTQLTY(*STD) PAGRTT(90) UOM(*INCH) +
                                        OUTQ(*JOB) HOLD(*YES)
             STRQMQRY   QMQRY(EXT_GENERR) OUTPUT(*PRINT) +
                          QMFORM(EDILIB/TEST) SETVAR((DATE +
                          &STARTDATE) (DATEEND &ENDDATE))
              DLTOVR        FILE(QPQXPRTF)
  /* Translation Error in Extol  */
              OVRPRTF    FILE(QPQXPRTF) DEVTYPE(*SCS) PAGESIZE(8 10.5 +
                                        *UOM) LPI(8) CPI(16.7) FOLD(*YES) +
                                        PRTQLTY(*STD) PAGRTT(90) UOM(*INCH) +
                                        OUTQ(*JOB) HOLD(*YES)
             STRQMQRY   QMQRY(EXT_TRNERR) OUTPUT(*PRINT) +
                          QMFORM(EDILIB/TEST) SETVAR((DATE +
                          &STARTDATE) (DATEEND &ENDDATE))
              DLTOVR        FILE(QPQXPRTF)
  /* Unwrap Error in Extol  */
              OVRPRTF    FILE(QPQXPRTF) DEVTYPE(*SCS) PAGESIZE(8 10.5 +
                                        *UOM) LPI(8) CPI(16.7) FOLD(*YES) +
                                        PRTQLTY(*STD) PAGRTT(90) UOM(*INCH) +
                                        OUTQ(*JOB) HOLD(*YES)
             STRQMQRY   QMQRY(EXT_UNWERR) OUTPUT(*PRINT) +
                          QMFORM(EDILIB/TEST) SETVAR((DATE +
                          &STARTDATE) (DATEEND &ENDDATE))
              DLTOVR        FILE(QPQXPRTF)
  /* Wrap Error in Extol  */
              OVRPRTF    FILE(QPQXPRTF) DEVTYPE(*SCS) PAGESIZE(8 10.5 +
                                        *UOM) LPI(8) CPI(16.7) FOLD(*YES) +
                                        PRTQLTY(*STD) PAGRTT(90) UOM(*INCH) +
                                        OUTQ(*JOB) HOLD(*YES)
             STRQMQRY   QMQRY(EXT_WRPERR) OUTPUT(*PRINT) +
                          QMFORM(EDILIB/TEST) SETVAR((DATE +
                          &STARTDATE) (DATEEND &ENDDATE))
              DLTOVR        FILE(QPQXPRTF)
 ENDPGM






By: on