Note there are assumptions in the quoted CL that might fail for lack of explicitly specified parameters or for actions since the last invocation. Be sure to prompt the commands and specify parameters explicitly to avoid breakage from change command defaults; most notably, RCVRNG(*CURRENT) is not explicit, but documented as an assumption. There is nothing apparent that ensures no CHGJRN JRNRCV() has taken place since the last invocation; that is a consideration that may need to be made, depending on the environment in which the program runs. Additionally there is a spurious DLCOBJ request; a DLCOBJ must be paired with an equivalent ALCOBJ request that affects the same member.

Regards, Chuck

JK wrote:

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)

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].