Removing journaled changes
Depending on the type of damage to the journaled object and the amount of activity since the object was last saved, removing changes from the object can be easier than applying changes to the object. Use the Remove Journaled Changes (RMVJRNCHG) command to remove changes from an object if you are journaling before-images.
The RMVJRNCHG command removes changes in reverse chronological order, starting with the most recent change.
On the RMVJRNCHG command, you identify the first journal entry to be removed from the object. This entry can be from:
- The last journal entry that is contained within the range of journal receivers specified.
- The entry that corresponds to the last save of the object.
- An identified sequence number.
You can control the changes that are removed from the object. For example, assume that an application updated data incorrectly for a period of time. In this case, you can remove the changes from the object until that application first opened the object.
You can stop removing journaled changes at:
- The start of the commit cycle for a transaction.
- The end of data in the journal receivers. This corresponds to the first journal entry that was recorded on the range of journal receivers that are specified.
- An identified sequence number that corresponds to a particular entry in the journal.
- The start of a particular job's use of the object. You can only specify this if you did not specify any the following:
- To exclude open and close journal entries (OMTJRNE(*OPNCLO)) when starting journaling for the file
- To minimize fixed-length entries RCVSIZOPT(*MINFIXLEN) for the journal at any time while the object was journaled.
- To omit a FIXLENDTA option that includes the job name.
You can ensure that commitment transaction boundaries are honored on the remove journaled changes operations by using the CMTBDY parameter on these commands.
If the system encounters a journal entry that causes the apply or remove process to stop, the commitment boundary may not be honored.
Error handling
When the system encounters a journal entry it cannot process, it ends remove processing either for that specific object or for the entire remove operation. You can specify how the system behaves when it encounters a journal entry it cannot process with the Object Error Option (OBJERROPT) on the Remove Journaled Changes (RMVJRNCHG) command. If you specify OBJERROPT(*CONTINUE), the system ends remove processing for the specific object, but it continues remove processing for the other objects in the remove operation. If you specify OBJERROPT(*END), the system ends processing for the entire remove operation. Actions of applying or removing journaled changes by journal code shows which entry types cause processing to end for an object.
Starting and ending points
Use the Display Journal (DSPJRN) command to identify the required starting and ending points. If you use a control language (CL) program for your recovery procedures, use the following:
- Receive Journal Entry (RCVJRNE) command to receive journal entries as they are written to the journal receiver.
- Retrieve Journal Entry (RTVJRNE) command to retrieve a journal entry and place it in program variables.
You can also use the Retrieve Journal Entries (QjoRetrieveJournalEntries) API to retrieve the information into a High Level Language (HLL) program.
Another way to remove journaled changes is to Remove journaled changes with the WRKJRN command and follow the command prompts.
The apply and remove journaled changes output file
It is highly recommended that you use the apply and remove journaled changes output file when you remove journaled changes. The output file contains a record for each object that the remove operation processes. It contains a record for each object created and each object deleted during the remove. This output file is especially useful when the remove ends early. It is much easier to query the output file for the status of each object rather then searching through the job log messages. Also the messages are limited to 512 while the output file is not limited.
- Removing journaled changes with the WRKJRN command
Remove journaled changes with the Work With Journal (WRKJRN) command by selecting Option 3 (Backout recovery).
Parent topic:
Recovery of journaled objectsRelated concepts
Actions of applying or removing journaled changes by journal code Use of the QAJRNCHG file