Call PRTLOMAR and PRTGRPLOG

EXTOL/CL - Call PRTLOMAR and PRTGRPLOG to Report Late/Rejected FAs and Inbound/Outbound EDI Errors

 
 /*****************************************************************************/
 /*  CL RUNS EXTOL'S FA REPORT. REPORT WILL list send/receive rejected FAs.   */
 /*  Report will be tailored 1st daily report will list FA rejected between   */
 /*  5:00-08:30. The 2nd report will list rejected FAs between 8:31 AND 15:31 */
 /*                                                                           */
 /*****************************************************************************/
 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(&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(WINSPOOL)
             MONMSG     MSGID(CPF0000)

             DLTSPLF    FILE(LLGPF4R$)
             MONMSG     MSGID(CPF0000)
             DLTSPLF    FILE(LLMPF5R$)
             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)

 /*  SUBTRACTING 1 FROM &LILIAN WILL PRODUCE YESTERDAY'S DATE */

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

 /*  CONVERT LILLIAN TO MMDDYYYY DATE  */

             CALLPRC PRC(CEEDATE) PARM(&LILIAN 'MMDDYYYY' &WDATE *OMIT)
             CHGVAR     VAR(&YESTERDAY) VALUE(&WDATE)

 /* TEST TO SEE IF HOUR <= 09                            */
 /* IF HOUR IS 0831 THEN SUBTRACT 1 DAY, AND REPORT      */
 /* EXTOL INBOUND ERRORS BETWEEN 3:00PM PREVIOUS DAY     */
 /* TO 8:30AM CURRENT DAY                                */
            IF (&HOUR *LT '09') DO

 /* RUN EXTOL CMD FOR INBOUND/OUTBOUND ERRORS BETWEEN 15:00-08:30  */
             PRTGRPLOG  FROMCNNDT(&WDATE) FROMCNNTM(150000) +
                          TOCNNDT(&TDATE) TOCNNTM(083000) +
                          FSTS(*ERROR) DRCD(B)

 /* RUN EXTOL CMD FOR INBOUND/OUTBOUND FA ERR BETWEEN 15:00-08:30  */
             PRTLOMAR   PERIOD((150000 &WDATE) (083000 &TDATE)) +
                          ASTSSLT(B X)



             RTVJOBA    JOB(&JOB) USER(&USER) NBR(&NBR)

 /* MAIL SPOOL FILE TO RECIPIENTS               */
             MAILRPT    FILE(LLGPF4R$) JOB(&NBR/&USER/&JOB) +
                          TOADDRESS([email protected] +
                          [email protected]) CONVTYPE(PDF) +
                          RPTDESC('EXTOL 8:30 AM Inbound EDI error +
                          report')
             MONMSG     MSGID(CPF0000)

 /* MAIL SPOOL FILE TO RECIPIENTS               */
             MAILRPT    FILE(LLMPF5R$) JOB(&NBR/&USER/&JOB) +
                          TOADDRESS([email protected] +
                          [email protected]) CONVTYPE(PDF) +
                          RPTDESC('EXTOL 8:30 AM Inbound EDI FA error +
                          report')
             MONMSG     MSGID(CPF0000)
              ENDDO

 /* TEST TO SEE IF HOUR IS 1500                          */
 /* IF HOUR >= 09 THEN REPORT EXTOL INBOUND ERRORS       */
 /* BETWEEN 8:31 AND 15:31 OF CURRENT DAY                */

            IF (&HOUR *GE '09') DO

 /* RUN EXTOL CMD FOR INBOUND/OUTBOUND ERRORS BETWEEN 08:31-15:00  */
             PRTGRPLOG  FROMCNNDT(&TDATE) FROMCNNTM(083100) +
                          TOCNNDT(&TDATE) TOCNNTM(150000) +
                          FSTS(*ERROR) DRCD(B)

 /* RUN EXTOL CMD FOR INBOUND/OUTBOUND FA ERR BETWEEN 08:31-15:00  */
             PRTLOMAR   PERIOD((083100 &TDATE) (150000 &TDATE)) +
                          ASTSSLT(B X)

             RTVJOBA    JOB(&JOB) USER(&USER) NBR(&NBR)

 /* MAIL SPOOL FILE TO RECIPIENTS               */
             MAILRPT    FILE(LLGPF4R$) JOB(&NBR/&USER/&JOB) +
                          TOADDRESS([email protected] +
                          [email protected]) CONVTYPE(PDF) +
                          RPTDESC('EXTOL 3:30 PM Inbound EDI error +
                          report')
             MONMSG     MSGID(CPF0000)


 /* MAIL SPOOL FILE TO RECIPIENTS               */
             MAILRPT    FILE(LLMPF5R$) JOB(&NBR/&USER/&JOB) +
                          TOADDRESS([email protected] +
                          [email protected]) CONVTYPE(PDF) +
                          RPTDESC('EXTOL 3:30 PM Inbound EDI FA error +
                          report')
             MONMSG     MSGID(CPF0000)
              ENDDO
 ENDPGM



By: on