SeanHoppe.com Cleo Code Samples Call PRTACKTP to Report Late FAs and Rejected FAs
/*****************************************************************************/ /* CL RUNS EXTOL'S FA REPORT. REPORT WILL LOOK FOR LATE FA'S FOR NGL */ /*****************************************************************************/ 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) ADDLIBLE LIB(EXTSYSF) MONMSG MSGID(CPF0000) ADDLIBLE LIB(EXTSYS) MONMSG MSGID(CPF0000) ADDLIBLE LIB(WINSPOOL) MONMSG MSGID(CPF0000) /* RETRIEVE CURRENT DATE AND SUBTRACT 1 DAY */ RTVSYSVAL SYSVAL(QDATE) RTNVAR(&SYSDATE) /* &LILIAN WILL CONTAIN THE NUMBER OF DAYS BETWEEN TODAY AND */ /* AND OCT 14, 1582. */ CALLPRC PRC(CEELOCT) PARM(&LILIAN &JUNK1 &JUNK2 *OMIT) /* SUBTRACTING 1 FROM &LILIAN WILL PRODUCE YESTERDAY'S DATE */ CHGVAR VAR(%BIN(&LILIAN)) VALUE(%BIN(&LILIAN) - 1) /* CONVERT LILLIAN TO YYYMMDD DATE */ CALLPRC PRC(CEEDATE) PARM(&LILIAN 'MMDDYYYY' &WDATE *OMIT) CHGVAR VAR(&YESTERDAY) VALUE(&WDATE) /* UPDATE UPDATE ACK STATUS (PENDING/LATE) */ UPDACKSTS DLTSPLF FILE(LLGPF6R$) MONMSG MSGID(CPF0000) /* RUN EXTOL CMD PRTACKTP FOR LATE FA'S */ PRTACKTP PERIOD((*AVAIL &WDATE)) DIRSLT(*SEND) + ASTSSLT(*LATE) /* 24 hours FA Late Report + for ALL Trading Partners */ RTVJOBA JOB(&JOB) USER(&USER) NBR(&NBR) /* MAIL SPOOL FILE TO RECIPIENTS */ MAILRPT FILE(LLGPF6R$) JOB(&NBR/&USER/&JOB) + TOADDRESS(EDI@xxxx.com) + CONVTYPE(PDF) + RPTDESC('EXTOL 24hr FA Late report') MONMSG MSGID(CPF0000) DLTSPLF FILE(LLGPF6R$) MONMSG MSGID(CPF0000) /* RUN EXTOL CMD PRTACKTP FOR REJECTED FA'S in past 24hours */ PRTACKTP PERIOD((*AVAIL &WDATE)) DIRSLT(*SEND) + ASTSSLT(*REJECTED) /* 24 hours FA + Rejected for ALL Trading Partners */ /* MAIL SPOOL FILE TO RECIPIENTS */ MAILRPT FILE(LLGPF6R$) JOB(&NBR/&USER/&JOB) + TOADDRESS(EDI@xxxx.com) + CONVTYPE(PDF) RPTDESC('EXTOL 24hr FA + Rejected report') MONMSG MSGID(CPF0000) ENDPGM