Chuck,

You are correct about the missing ALCOBJ - I missed it during the cut-n-paste.
The following four lines are in our source code immediately prior to the CHGJRN
command. A more clever person could likely create a more bullet-proof technique
but this has been sufficient to avoid collisions in our environment.
/*===================================================================*/
/* Attempt to AlcObj the CURJRN0 PF to prevent multiple instances */
/* of this pgm from colliding. */
/*===================================================================*/
ALCOBJ OBJ((*LIBL/CURJRN0 *FILE *EXCL)) WAIT(60)

I'm not sure that I understand your comment about potential problems with the
way the program uses the 'CHGJRN JRNRCV()' command. Are you referring to the
possibility of some external process triggering a CHGJRN that is never harvested
by the auditing report? In our environment that has not happened in more than ten
years, perhaps because we're a small shop and all programming requests are vetted
by me. Note I'm not challenging your assertion - just pointing out that it hasn't
happened here.

JK

On Thu 08/08/28 08:55 , CRPence sent:
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 is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
listTo post a message email: RPG400-
L@xxxxxxxxxxxxxx subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-lor email:
RPG400-L-request@xxxxxxxxxxxxxxxxxx posting, please take a moment to review the
archives
at http://archive.midrange.com/rpg400-l.





---- Msg sent via Internet America Webmail - www.internetamerica.com

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 midrange.com 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].