Program
INVJOB.clle
No notes on this program yet.
1/* INVJOB - Invoice Processing Job2 *3 * Submitted by the end-of-day batch scheduler.4 * Calls ORDENT to process queued orders, then EDIOUT to5 * produce the outbound EDI 810 file for the trading partner.6 *7 * Steps:8 * 1. Override order files to production library9 * 2. Call ORDENT for each unprocessed order10 * 3. Call EDIOUT to write the EDI spool11 * 4. Submit EDISND to transmit the file12 */13PGM1415 DCL VAR(&ORDLIB) TYPE(*CHAR) LEN(10) VALUE('ORDPRD')16 DCL VAR(&ERRFLAG) TYPE(*CHAR) LEN(1)1718 /* Override to production order library */19 OVRDBF FILE(ORDHDR) TOFILE(&ORDLIB/ORDHDR) OVRSCOPE(*JOB)20 OVRDBF FILE(ORDDTL) TOFILE(&ORDLIB/ORDDTL) OVRSCOPE(*JOB)21 OVRDBF FILE(CUSTMST) TOFILE(&ORDLIB/CUSTMST) OVRSCOPE(*JOB)22 OVRDBF FILE(TAXTBL) TOFILE(&ORDLIB/TAXTBL) OVRSCOPE(*JOB)2324 /* Run invoice calculation for unprocessed orders */25 CALL PGM(ORDENT) PARM(&ERRFLAG)26 IF COND(&ERRFLAG *EQ 'Y') THEN(DO)27 SNDPGMMSG MSG('INVJOB: ORDENT returned error. Check QSYSOPR.') +28 TOPGMQ(*EXT) MSGTYPE(*ESCAPE)29 ENDDO3031 /* Generate EDI 810 output */32 CALL PGM(EDIOUT)3334 /* Transmit EDI file - submitted separately so job log stays clean */35 SBMJOB CMD(CALL PGM(EDISND)) JOB(EDISND) JOBQ(QBATCH)3637 DLTOVR FILE(*ALL) LVL(*JOB)3839ENDPGM