Remove Journaled Changes (RMVJRNCHG)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

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 was 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.

No database object level changes are processed by RMVJRNCHG.

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 a journal code J entry type SX (Exit JRNSTATE(*STANDBY)) entry is found, the operation ends for all objects specified regardless of the OBJERROPT value specified. Objects may be only partially updated from the journal entries.

Additionally, the command can end for an individual object when journal entries list operations which cannot be replayed by the command. If this happens, the operation will continue for the other objects specified if OBJERROPT(*CONTINUE) is used. For example, the command ends for an object when a journal entry is found that indicates one of the following has occurred:

See the Journal Management information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter 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 for an object 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 for that object, specifying a new starting sequence number. Be aware though, that most illogical conditions are the result of starting the remove at the wrong journal entry.

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:

Top


 

Parameters

Keyword Description Choices Notes
JRN Journal Qualified object name Required, Positional 1
Qualifier 1: Journal Name
Qualifier 2: Library Name, *LIBL, *CURLIB
FILE Journaled file identification Values (up to 300 repetitions): Element list Optional, Positional 2
Element 1: Journaled physical file Qualified object name
Qualifier 1: Journaled physical file Name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Member Name, *ALL, *FIRST
OBJ Objects Values (up to 300 repetitions): Element list Optional
Element 1: Object Qualified object name
Qualifier 1: Object Name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Object type *FILE, *DTAARA
Element 3: Member, if data base file Name, *ALL, *FIRST
RCVRNG Range of journal receivers Single values: *CURRENT, *LASTSAVE
Other values: Element list
Optional, Positional 3
Element 1: Starting journal receiver Qualified object name
Qualifier 1: Starting journal receiver Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Ending journal receiver Qualified object name
Qualifier 1: Ending journal receiver Name
Qualifier 2: Library Name, *LIBL, *CURLIB
FROMENTLRG Starting large sequence number Character value, *LAST, *LASTSAVE Optional
TOENTLRG Ending large sequence number Character value, *FIRST, *COMMITSTART Optional
TOJOBO Fully qualified job name Qualified job name Optional
Qualifier 1: Fully qualified job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
CMTBDY Commitment boundary *YES, *NO Optional
OPTION Option *NONE, *IGNINQMSG Optional
OBJERROPT Object error option *CONTINUE, *END Optional
OUTPUT Output *NONE, *OUTFILE Optional
OUTFILE File to receive output Qualified object name Optional
Qualifier 1: File to receive output Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OUTMBR Output member options Element list Optional
Element 1: Member to receive output Name, *FIRST
Element 2: Replace or add records *REPLACE, *ADD
DETAIL Detail *ALL, *ERR Optional
FROMENT Starting sequence number 1-9999999999, *LAST, *LASTSAVE Optional
TOENT Ending sequence number 1-9999999999, *FIRST, *COMMITSTART Optional

Top

 

Journal (JRN)

Specifies the journal that contains the journal entries being removed.

This is a required parameter.

Qualifier 1: Journal

journal-name

Specify the name of the journal.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread 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, QGPL is used.

library-name

Specify the name of the library to be searched.

Top

 

Journaled file identification (FILE)

Specifies a maximum of 300 physical database files whose journal entries are to be removed. The member in the physical file whose journaled changes are to be removed can also be specified.

Either the Journaled file identification (FILE) parameter or the Objects (OBJ) parameter must be specified, but not both.

Element 1: Journaled physical file

Qualifier 1: Journaled physical file

*ALL

Journaled changes are removed from all physical files in the specified library whose changes have been journaled to the specified journal. 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.

file-name

Specify the name of the database physical file whose journaled changes are to be removed.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread 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, QGPL is used.

library-name

Specify the name of the library to be searched.

Element 2: Member

Specifies the name of the member in the file whose journaled changes are removed. If *ALL is specified for the first element 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 for the member name, journal changes are removed from the first member of all applicable files in the library.

*ALL

Journaled changes are removed from all members in the file.

*FIRST

Journaled changes are removed from the first member in the file.

member-name

Specify the name of the member in the file whose journaled changes are removed.

Top

 

Objects (OBJ)

Specifies a maximum of 300 objects 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 Journaled file identification (FILE) parameter or the Objects (OBJ) parameter must be specified, but not both.

Element 1: Object

Qualifier 1: Object

*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.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread 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, QGPL is used.

library-name

Specify the name of the library to be searched.

Element 2: Object type

Specifies the object type of the object that has its journal entries removed.

*FILE

Entries for database file members are removed.

*DTAARA

Entries for data areas are removed.

Element 3: Member, if data base file

Specifies the name of the member in the file that has its journal entries removed. If *ALL is specified for the first element 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 for the member name, journal changes are removed from the first member of all applicable files in the library.

If the specified object type is not *FILE, the member name element value is ignored.

*ALL

Journal entries are removed from all members in the file.

*FIRST

Journal entries are removed from the first member of the file.

member-name

Specify the name of the member in the file whose journal entries are to be removed.

Top

 

Range of journal receivers (RCVRNG)

Specifies the starting and ending journal receivers used in removing the journaled changes. 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.

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

Single values

*CURRENT

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

*LASTSAVE

The range of journal receivers used is determined by the system, as a result of save information for the objects that have their recorded changes removed. This parameter value is only valid if *LASTSAVE is also specified on the Starting sequence number (FROMENT) parameter, and on the Starting large sequence number (FROMENTLRG) parameter.

Element 1: Starting journal receiver

Qualifier 1: Starting journal receiver

starting-journal-receiver

Specify the name of the journal receiver used as the first (newest) receiver whose journaled changes are to be removed.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the job is used to locate the journal receiver. If no library is specified as the current library for the job, QGPL is used.

library-name

Specify the library where the journal receiver is located.

Element 2: Ending journal receiver

Qualifier 1: Ending journal receiver

ending-journal-receiver

Specify the name of the journal receiver used as the last (oldest) receiver whose journaled changes are to be removed. If the end of the receiver chain is reached before a receiver of this name is found, the operation ends.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the job is used to locate the journal receiver. If no library is specified as the current library for the job, QGPL is used.

library-name

Specify the library where the journal receiver is located.

Top

 

Starting large sequence number (FROMENTLRG)

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

You can specify a value for either the Starting sequence number (FROMENT) parameter or the Starting large sequence number (FROMENTLRG) parameter, but not for both.

*LAST

Specifies that journaled changes are removed starting with the last journal entry in the specified receiver range.

*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.

If the restored version of the object was a version that was saved using the save-while-active function, then the system will start removing changes from the corresponding start-of-save entry whether or not this was actually the last save of the object. When using save-while-active, information needed for removing journaled changes is saved with the object and restored. When all objects specified on the remove command have been restored from save versions that used save-while-active, the system does not need to scan all the journal receivers to find the save points for the objects. This can improve the performance of the remove processing.

If the restored version of the object was a version that was saved when it was not in use (normal save), then 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.

If any database file members were saved specifying *NOCMTBDY as the second element of the SAVACTWAIT parameter on the save command and are currently in a state where apply journaled changes is required, then *LASTSAVE must be specified.

starting-sequence-number

Specify the sequence number of the first journal entry that is processed when removing journaled changes from the specified objects. The acceptable range is 1 to 18,446,744,073,709,551,600.

Top

 

Ending large sequence number (TOENTLRG)

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

You can specify a value for either the Ending sequence number (TOENT) parameter or the Ending large sequence number (TOENTLRG) parameter, but not for both.

*FIRST

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

*COMMITSTART

Either FROMENTLRG(*LASTSAVE) or FROMENT(*LASTSAVE) must be specified, along with CMTBDY(*YES) to specify this value. Starting with the last save journal entry, only changes for journal entries for any partial transactions are removed, back to the start of the commit transaction. This option can be used when the version of the object that was restored was a version that was saved with partial transactions and Apply Journaled Changes (APYJRNCHG) is not desired.

ending-sequence-number

Specify the sequence number of the last journaled change that is removed from the specified objects. The acceptable range is 1 to 18,446,744,073,709,551,600.

Top

 

Fully qualified job name (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 TOJOBO parameter cannot be used if the object for which changes are being removed from was not recording open and close entries. For further clarification, refer to the Omit journal entry (OMTJRNE) parameter for the STRJRN, STRJRNPF, and CHGJRNOBJ commands.

Other values

job-identifier

Specify the job name, the user name, and the job number of the job to use. You can also specify that the job name only, or that the job name and the user name be used.

job-name

Specify the job name of the job.

user-name

Specify the user name of the job.

job-number

Specify the system-assigned job number.

Top

 

Commitment boundary (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 Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

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

*YES

The journal entries are removed from the entry specified on the FROMENTLRG or FROMENT parameter to the entry indicated on the TO option, honoring commitment boundaries. The FROMENTLRG or FROMENT parameter must identify a point that is at a commitment boundary.

  • If the journal entry specified on the FROMENTLRG or 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.

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.

*NO

The journal entries are removed from the entry specified on the FROMENTLRG or 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.

If CMTBDY(*NO) is specified and any object being applied to has been restored from a saved version that contains partial transactions, the changes pending for those partial transactions will not be removed if the transactions do not complete within the specified range. The object will only be usable if all pending transactions complete within the specified range.

Top

 

Option (OPTION)

Specifies whether additional checking should be done prior to removing journal changes.

*NONE

All protective checks are performed before any journal changes are removed.

*IGNINQMSG

Ignore inquiry message. Inquiry message CPA7050 is not presented to the user, even if the object that is being applied to is not from the last save of the object. The remove operation continues.

Top

 

Object error option (OBJERROPT)

Specifies how the processing of journal entries should proceed when an error situation is encounterd.

*CONTINUE

When a journal entry for a specific object is encountered that cannot be processed, the remaining journal entries for that object will not be processed. Processing of journal entries for other objects will continue. A diagnostic message will be sent indicating that the processing of journaled changes for that object was not successful. An indication is also placed in any output file record to indicate processing ended early for the specific object.

*END

When the first journal entry is encountered that cannot be successfully processed, processing will end for all objects.

Top

 

Output (OUTPUT)

Specifies whether a list of information about the objects to whom changes were removed is created. The information can be directed to a database file.

*NONE

No data base file is created with the output. Messages are sent to the job log for the first 512 objects for which processing failed to complete successfully.

*OUTFILE

Output information about the remove operation will be directed to the database file specified on the File to receive output (OUTFILE) parameter.

You must specify the database file name on the File to receive output (OUTFILE) parameter when OUTPUT(*OUTFILE) is specified.

Top

 

File to receive output (OUTFILE)

Specifies the database file to which the information is directed when *OUTFILE is specified on Output (OUTPUT) parameter. If the file does not exist, this command creates a database file in the specified library. If a new file is created, the system uses QAJRNCHG in QSYS with the format name QJOAPYRM as a model.

Qualifier 1: File to receive output

database-file-name

Specify the name of the database file to which output from the command is directed. If this file does not exist, it is created in the specified library.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread 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, QGPL is used.

library-name

Specify the name of the library to be searched.

Top

 

Output member options (OUTMBR)

Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.

Element 1: Member to receive output

*FIRST

The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter.

name

Specify the name of the file member that receives the output. If OUTMBR(member-name) is specified and the member does not exist, the system creates it.

If the member exists, you can add records to the end of the existing member or clear the existing member and add the records.

Element 2: Replace or add records

*REPLACE

The existing records in the specified database file member are replaced by the new records.

*ADD

The new records are added to the existing information in the specified database file member.

Top

 

Type of output information (DETAIL)

Specifies the type of information that is directed to the spooled file.

*ALL

The file will contain information about the command and an entry for each object that matched the object selection specified on the command.

*ERR

The file will contain information about the command, an entry only for each object for which the removal of journaled changes ended early.

Top

 

Starting sequence number (FROMENT)

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

You can specify a value for either the Starting sequence number (FROMENT) parameter or the Starting large sequence number (FROMENTLRG) parameter, but not for both.

*LAST

Specifies that journaled changes are removed starting with the last journal entry in the specified receiver range.

*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.

If the restored version of the object was a version that was saved using the save-while-active function, then the system will start removing changes from the corresponding start-of-save entry whether or not this was actually the last save of the object. When using save-while-active, information needed for removing journaled changes is saved with the object and restored. When all objects specified on the remove command have been restored from save versions that used save-while-active, the system does not need to scan all the journal receivers to find the save points for the objects. This can improve the performance of the remove processing.

If the restored version of the object was a version that was saved when it was not in use (normal save), then 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.

If any database file members were saved specifying *NOCMTBDY as the second element of the SAVACTWAIT parameter on the save command and are currently in a state where apply journaled changes is required, then *LASTSAVE must be specified.

starting-sequence-number

Specify the sequence number of the first journal entry that is processed when removing journaled changes from the specified objects. The acceptable range is 1 to 9,999,999,999.

Top

 

Ending sequence number (TOENT)

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

You can specify a value for either the Ending sequence number (TOENT) parameter or the Ending large sequence number (TOENTLRG) parameter, but not for both.

*FIRST

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

*COMMITSTART

Either FROMENTLRG(*LASTSAV) or FROMENT(*LASTSAV) must be specified, along with CMTBDY(*YES) to specify this value. Starting with the last save journal entry, only changes for journal entries for any partial transactions are removed, back to the start of the commit transaction. This option can be used when the version of the object that was restored was a version that was saved with partial transactions and Apply Journaled Changes (APYJRNCHG) is not desired.

ending-sequence-number

Specify the sequence number of the last journaled change that is removed from the specified objects. The acceptable range is 1 to 9,999,999,999.

Top


 

Examples

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

This command causes the system to remove all journaled changes found in journal JRNA from member JAN of file PAYROLL in library LIB2 that are found 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.

Top


 

Error messages

*ESCAPE Messages

CPF69A9

Internal error detected, error code &2.

CPF69AA

Unable to refer to object &1 saved with STG(*FREE).

CPF69AB

Values for RCVRNG parameter not correct.

CPF70A7

Not all entries applied or removed for at least one object.

CPF70A8

File &1 in library &2 cannot be used.

CPF70AA

FROMENT(*LASTSAVE) must be specified.

CPF70AB

Journal receiver &1 in library &2 not found.

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.

CPF7051

Save entry for *&6 object not found.

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.

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.

CPF705A

Operation failed due to remote journal.

CPF7063

Cannot use file &1 as OUTFILE.

CPF7067

FROMENTLRG or 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.

CPF9825

Not authorized to device &1.

CPF9860

Error occurred during output file processing.

Top