The dayend job runs the following code to harvest the day's changes
from the ORDJRN into the ORDJRN0 workfile which is passed to an RPG that filters the good bits and distributes a 'change recap' to the
plant's CSRs so they'll be ready for the next day's run.
/* Create a new receiver */
CHGJRN JRN(*LIBL/ORDJRN) JRNRCV(*GEN) /* Dump the J PR record of the CURRENT receiver into CurJrn0 *
DSPJRN JRN(*LIBL/ORDJRN) JRNCDE((J)) ENTTYP(PR) + OUTPUT(*OUTFILE) OUTFILE(*LIBL/CURJRN0) + OUTMBR(*FIRST *REPLACE) /* Read CURJRN0 to find name of the PREVIOUS receiver */ RCVF DEV(*FILE) CHGVAR &prvjrnrcv %SST(&joesd 1 10) /* Deallocate CURJRN0 to allow other instances to run */ DLCOBJ OBJ((*LIBL/CURJRN0 *FILE *EXCL)) /* Now we know the name of the PREVIOUS receiver, dump its */ /* contents into ORDJRN0 */ DSPJRN JRN(*LIBL/ORDJRN) + RCVRNG(*LIBL/&PrvJrnRcv *LIBL/&PrvJrnRcv) + JRNCDE(*ALL) + OUTPUT(*OUTFILE) OUTFILE(*LIBL/ORDJRN0) + OUTMBR(&WSTIME) ENTDTALEN(500)