RMVJRNCHG (Remove Journaled Changes)

RMVJRNCHG Command syntax diagram

 

Purpose

The Remove Journaled Changes (RMVJRNCHG) command removes the changes that have been journaled for a particular journaled object. The journaled changes are removed from the object from the specified starting point to the ending point. The journal entries are processed in reverse of the order in which they were placed into the journal receiver, from the most recent to the oldest. The starting point can be identified as the last journal entry in the specified journal receiver range, the point at which an object last saved, or a particular entry in the receiver range. The ending point can be the first journal entry or a particular entry in the specified journal receiver range, or the point at which an object was opened by a specified job. The CMTBDY parameter can be used for handling changes that are pending.

Note: The Display Journal (DSPJRN) command can be used to help determine the desired starting and ending points.

A list of journaled objects may be specified. The journaled changes for all objects are removed in the order that the journal entries are found on the journal (the reverse of the order that the changes were originally made to the objects).

If an error is found at any point while the journal entries are being removed, the operation ends and the objects may be only partially updated from the journal entries.

Additionally, the command can end when journal entries list operations which cannot be replayed by the command. For example, the command ends when a journal entry is found that indicates one of the following has occurred:

See the Journal management article in the Information Center> for a complete listing of the various entries and how they are handled by this command including those entries which can stop the command.

The command also ends on illogical conditions. If the command ends due to illogical conditions and it is logically possible to restart the operation, you can issue the command again, specifying a new starting sequence number.

Note: If the operation ends for one of the objects specified, it ends for all of the objects.

Journal entry changes can be removed even if the sequence numbers have been reset. The system handles this condition, sends an informational message, and continues the removal of journaled changes.

 

Restrictions

  1. This command is shipped with public *EXCLUDE authority and the QPGMR and QSRV user profiles have private authorities to use the command.
  2. The objects specified on this command must currently be having their changes journaled, and they must have been journaled to the specified journal throughout the period indicated on the command.
  3. Before images are required for the objects. See the appropriate start journaling command.
  4. The objects indicated on the command are allocated exclusively while the changes are being removed. If an object cannot be allocated exclusively, the command ends and no journaled changes are removed from the objects.
  5. If there is no journal entry that represents the entry specified on the FROMENT or TOENT parameter the command ends, and no journaled changes are removed from the objects.
  6. If the journal sequence numbers have been reset in the range of the receivers specified, and a sequence number is specified on the FROMENT or TOENT parameter, the first occurrence of the sequence number specified on either parameter is used.
  7. The TOJOBO parameter cannot be used to specify when the remove journaled changes operation is to end if one or more journal receivers in the specified receiver range was attached to a journal that had a RCVSIZOPT or FIXLENDTA option specified that omitted the collection of that data. >
  8. This command cannot be used on or with a remote journal.
  9. The maximum number of objects that can have changes removed with this command is 65,535. If more than 65,535 objects are included in the specifications, an error message is sent and no changes are removed. You can change the values specified on this parameter so that the limit is not exceeded.

 

Required Parameters

JRN
Specifies the qualified name of the journal that contains the journal entries being removed.

The name of the journal can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

journal-name: Specify the name of the journal.

FILE
Specifies a maximum of 300 qualified names of the physical database files whose journal entries are being removed. The name of the member in the file whose journal entries are being removed can also be specified.

Either the FILE parameter must be specified or the Object Information parameter (OBJ) must be specified, but not both.

Element 1: File Name

The name of the file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

*ALL: All physical files in the specified library whose changes are being journaled to the specified journal have their journal entries removed. The library name must be specified. If *ALL is specified and you do not have the required authority to all of the files, an error message is sent and the command ends.

file-name: Specify the name of the physical database file whose journal entries are being removed.

Element 2: Member Name

*FIRST: Journal entries are removed from the first member of the file.

*ALL: Journal entries are removed from all members in the file.

member-name: Specify the name of the member in the file whose journal entries are removed.

If *ALL is specified for the first part of this parameter, the value specified for the member name is used for all applicable files in the library. For example, if *FIRST is specified, journal changes are removed from the first member of all applicable files in the library.

OBJ
Specifies a maximum of 300 qualified object names whose journal entries are being removed. The name of the member in the file whose journal entries are being removed can also be specified.

Either the FILE parameter must be specified or the Object Information parameter (OBJ) must be specified, but not both.

Element 1: Object

The name of the object can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

*ALL: All objects in the specified library of the specified type whose changes are being journaled to the specified journal have their journal entries removed. The library name must be specified. If *ALL is specified and you do not have the required authority to all of the objects, an error message is sent and the command ends.

object-name: Specify the name of the object whose journal entries are being removed.

Element 2: Object Type

*FILE: Entries for database file members are removed.

*DTAARA: Entries for data areas are removed.

Element 3: Member Name

*FIRST: Journal entries are removed from the first member of the file.

*ALL: Journal entries are removed from all members in the file.

member-name: Specify the name of the member in the file whose journal entries are removed.

If *ALL is specified for the first part of this parameter, the value specified for the member name is used for all applicable files in the library. For example, if *FIRST is specified, journal changes are removed from the first member of all applicable files in the library.

Note: If the specified object-type was not *FILE, the member name value is ignored.

 

Optional Parameters

RCVRNG
Specifies the qualified name of the starting and ending journal receivers used in removing the journal entries. The system begins the removal operation with the starting journal receiver (specified by the first value) and proceeds through the chain of receivers until the ending receiver (specified by the last value) is processed. The values specified on the parameter represent journal receivers in reverse order from the order in which they were attached to the journal.

Note: The maximum number of receivers that can be included in a range of receivers is 256. If more than 256 receivers are included in the range specified, an error message is sent and no changes are removed. You can change the values specified on this parameter so that the limit is not exceeded.

*CURRENT: The journal receiver that is currently attached when starting to remove journal entries is used.

Element 1: Starting Journal Receiver

The name of the starting journal receiver can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

starting-journal-receiver: Specify the name of the journal receiver used as the first (newest) receiver with journal entries to be removed.

Element 2: Ending Journal Receiver

The name of the ending journal receiver can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

ending-journal-receiver: Specify the name of the journal receiver used as the last (oldest) receiver with the journal entries being removed. If the end of the receiver chain is reached before a receiver of this name is found, the operation ends.

FROMENT
Specifies the entry used as the starting point for removing changes that were journaled.

*LAST: Journal entries are removed starting with the last journal entry in the specified receiver range. If FROMENT is not specified, *LAST is assumed.

*LASTSAVE: Journal entries are removed starting with the last journal entry before the last save operation. The system determines the actual starting position for each of the objects specified on the command. The parameter value implies that the object was just restored on the system.

The system also verifies that the date and time of the saved version of the object that is restored on the system is the same as the date and time that the object was last saved, as indicated on the journal.

If the dates and times do not match, no entries are removed and an inquiry message is sent to the user, or system operator requesting a cancel or ignore response. If an ignore response is given to the message, the operation is attempted. A cancel response causes the operation to end, and no journal changes are removed.

If the object was last saved with the save-while-active function, the saved copy of each object includes all changes in the journal entries up to the corresponding start-of-save journal entry. In this case, the system removes changes beginning with the first journal entry preceding the start-of-save entry.

If the object was last saved when it was not in use (normal save), the saved copy of each object includes all changes in the journal entries up to the corresponding object saved journal entry. In this case, the system removes changes beginning with the first journal entry preceding the object saved entry.

starting-sequence-number: Specify the sequence number of the first journal entry that is processed when removing journal changes from the specified object.

TOENT
Specifies the entry used as the ending point for removing changes that were journaled.

*FIRST: Journal entries are removed until the first entry in the specified receiver range is processed.

ending-sequence-number: Specify the sequence number of the last journal entry that is removed from the specified object.

TOJOBO
Specifies the job identifier of the job that, when it opens an object that is specified, ends the removing of journal entries by this command. For example, the specified job could be a job suspected of causing errors when the job opens a file member. The first job open entry found for any of the specified objects, is the ending point for all the objects specified.

This parameter cannot be used to remove a specific job's journal entries; all entries for all jobs are removed.

Only objects of type *FILE have journal entries related to job opens.

The job identifier has a maximum of three elements.

job-name
user-name/job-name
job-number/user-name/job-name

The job name must be specified. The null value (*N) may be used in place of the job number or the user profile name to maintain the position in the sequence. For example, 123456/*N/job-name specifies the job number, 123456, and the job name, without specifying the user profile under which the job is run.

CMTBDY
Specifies whether commitment boundaries are honored when the journal entries from which journaled changes are to be removed are part of a commitment control logical unit of work (LUW). More information on the use of commitment control is in the Commitment control article in the Information Center.>

Note: For purposes of this parameter description, the TO option is used to describe either the TOENT or the TOJOBO parameter, whichever is specified.

*NO: The journal entries are removed from the entry specified on the FROMENT parameter to the entry indicated on the TO option, regardless of commitment boundaries. Even if a journal entry within this range is a participant of the LUW, the operation is attempted. The FROMENT parameter must identify a point that is at a commitment boundary.

*YES: The journal entries are removed from the entry specified on the FROMENT parameter to the entry indicated on the TO option, honoring commitment boundaries.

  • If the journal entry specified on the FROMENT parameter is in the middle of the LUW of which it is a participant, an error message is sent and the operation is not attempted.
  • If the journal entry indicated on the TO option is in the middle of the LUW of which it is a participant, the operation stops at the commitment boundary before that journal entry. A diagnostic message is sent at the end of the operation.


Note: If a journal entry is encountered that causes the operation to end before the entry indicated on the TO option, commitment boundaries might not be honored.

Example for RMVJRNCHG

RMVJRNCHG   JRN(JRNA)  FILE((LIB2/PAYROLL JAN))
  RCVRNG(RCV25 RCV22)  TOENT(*FIRST)

This command causes the system to remove all journaled changes to journal JRNA to member JAN of file PAYROLL in library LIB2 that are journaled on the journal receiver chain starting with receiver RCV25 and ending with receiver RCV22. Library search list *LIBL is used to find journal JRNA and receivers RCV25 and RCV22.

The removal operation begins with the last journaled change on the receiver chain and ends with the first journaled change.

Error messages for RMVJRNCHG

*ESCAPE Messages

CPF70CC
Cannot perform operation beyond journal entry &7.
CPF70CD
Cannot perform operation beyond journal entry &7.
CPF70CE
Cannot perform operation beyond journal entry &7.
CPF70EB
Referential constraint error on member &3.
CPF70EC
Referential constraint error. Reason code &9.
CPF70EE
Maximum encoded vector access paths for member &3.
CPF7002
File &1 in library &2 not a physical file.
CPF7003
Entry not journaled to journal &1. Reason code &3.
CPF7006
Member &3 not found in file &1 in &2.
CPF7007
Cannot allocate member &3 file &1 in &2.
CPF701B
Journal recovery of an interrupted operation failed.
CPF704A
Record length incorrect for member &3.
CPF704F
TOJOBO or TOJOBC parameter not valid for receiver range.
CPF7041
Entry for job &3/&2/&1 not found.
CPF7042
Object not journaled or journaled to different journal.
CPF7044
Apply or remove of journaled entries failed, reason code &7.
CPF7045
Journal receiver &1 in &2 partially damaged.
CPF7046
Duplicate key not allowed for member &3.
CPF7047
Member &3 file &1 in &2 full.
CPF7048
Cannot perform journaled change to member &3.
CPF7049
Cannot perform operation beyond journal entry &7.
CPF705A
Operation failed due to remote journal.
CPF7052
Select/omit failure in logical file over member &3.
CPF7053
Values for RCVRNG parameter not correct; reason code &1.
CPF7054
FROM and TO values not valid.
CPF7055
Maximum number of objects exceeded.
CPF7056
Object &1 not being journaled with before images.
CPF7057
*LIBL not allowed with FILE(*ALL) or OBJ(*ALL).
CPF7058
Apply or remove journaled entries operation failed.
CPF7067
FROMENT option not valid. Commit boundary violation.
CPF7068
Entry needed for apply or remove operation not found.
CPF7069
No entries applied or removed using journal &1.
CPF7077
Key mapping error on member &3.
CPF7078
Cannot apply or remove changes to member &3.
CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF9809
Library &1 cannot be accessed.
CPF9810
Library &1 not found.
CPF9812
File &1 in library &2 not found.
CPF9820
Not authorized to use library &1.
CPF9822
Not authorized to file &1 in library &2.