Receive journal entries in an exit program

You can write a program to receive journal entries as they are written to the journal receiver.

When you use the Receive Journal Entry (RCVJRNE) command, you can specify a user-defined program, called an exit program, to receive journal entries. The program can, for example, write the entries to tape or to an i5/OS® intersystem communications function (ICF) file that sends them to a backup system. You can use the received entries to update a backup copy of the primary object on the backup system. You cannot use these received entries with system-supplied recovery commands (Apply Journaled Changes (APYJRNCHG) and Remove Journaled Changes (RMVJRNCHG)) to update your objects because the RCVJRNE command converts the entries to their external form. You must write your own program to apply the changes that are contained in the entries to the objects.

The RCVJRNE command supports the same selection criteria (database files, data areas, data queues, or integrated file system objects) as the Display Journal (DSPJRN) command. You can specify which entries go to the exit program.

For example, you can choose not to receive journal entries that are generated by the action of trigger programs or referential constraints. If you have a user-written program that updates the files on a second system with the journal entries, you probably want to specify DEPENT(*NONE). The actions performed by trigger programs or referential constraints are duplicated automatically on the second system if your database definitions are the same and you replay the original file operations.

You can specify DELAY(*NEXTENT) to have journal entries sent to your program as soon as they are written to the journal receiver. You can also specify a time interval. The exit program will be called sometime within that time interval. Either new entries are sent or an indicator is sent that there are no new entries.

Related concepts
Retrieve journal entries from a remote journal during the catch-up phase
Related reference
Receive Journal Entry (RCVJRNE) command
Display Journal (DSPJRN) command