Retrieve Journal Entry Exit Program
Date Posted: October 09, 2003 12:00 AM
Author: System iNEWS Staff

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.


Want to use this article? Click here for options!
Want to subscribe? Click here!
There are no comments to display. Be the first to add your thoughts!
You must log on before posting a comment.

Are you a new visitor? Register Here
 

around the forums

better data access for AS400 applications
Forum Name: Systems Management
21 May 2012 06:22 AM | Replies: 0
Selection error involving field *N.
Forum Name: SQL, Query and Database
18 May 2012 02:19 PM | Replies: 6
WINDOWS 7 with CLIENT ACCESS 7 R1
Forum Name: Communications/Networking
18 May 2012 08:43 AM | Replies: 1

ProVIP Sponsors

BCD

Join Our Community!

Subscribe today to iPro Developer! iPro Developer is packed with technical know-how for developers of IBM i, iSeries, AS400 and System i. Sign up now to get your full subscriber benefits including:

  • Code available for download
  • Full access to the online article archive (including all System iNEWS ProVIP content)
  • Downloadable ebook with past 6 months of articles
  • Discounts on eLearning classes, self-paced training, in-person events, and more!
iPro Developer Newsletters
  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips