The Retrieve Journal Entry (RTVJRNE) command enables you to either retrieve
journal entries from your program or to specify an exit program to
automatically receive journal entries as they are written to a journal
receiver.
The latter method, using an exit program, was incorporated in the DspAudLog
utility published in the June 2000 issue of iSeries NEWS. The utility
included an exit program to save journal entries to an audit database.
In this newsletter tip, Carsten Flensburg provides an exit program and a
simple application that lets you experiment with the exit program to receive
journal entries quickly and easily.
At the heart of the source provided in this tip is RPG ILE exit program
CBX902, which writes journal entries into log file CBX902F. A sample
customer data file is also provided. RCVJRNE will monitor this customer data
file for changes and will call exit program CBX902 when changes are
detected.
To begin using the exit program, you submit CL program CBX902C to the job
queue, where it runs as a never-ending program. CBX902C configures RCVJRNE
to call the exit program when a journal entry is received. If no entries
have been received for 25 seconds, it passes a zero to indicate that no
entries are available. The 25 seconds is specified to prevent the job from
timing out after 30 seconds, which is the default delay time for a
controlled end job request.
Once CBX902C runs, simply insert, change, or delete the records in customer
file CBXDTAF and the exit program will add log entries to file CBX902F.
Also provided is CL program CBX902X, which compiles both programs and
creates the physical files, journal receiver, journal, and data area.
Here's a list of the source members included in this tip:
CBX902 -- RPG ILE exit program
CBX902C -- CL program that calls RCVJRNE
CBX902X -- CL program that compiles the programs and creates files
CBXDTAF -- test customer file
CBX902F -- journal entry log file
You can download the above source code at
http://www2.systeminetwork.com/noderesources/code/clubtechcode/RcvJrnEExit.zip.
You can read more about RCVJRNE here:
RCVJRNE (Receive Journal Entry)
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/cl/rcvjrne.htm
Receive journal entries in an exit program
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/rzaki/rzakircvjrnentry.htm
Finally, iSeries Network Pro VIP members can read about and download the
DspAudLog utility here:
http://www2.systeminetwork.com/article.cfm?ID=7454
The above source code was written by Carsten Flensburg. For questions
regarding this tip, contact Carsten at mailto:flensburg@novasol.dk.