ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/apyjrnchg.htm

1404 lines
72 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Apply Journaled Changes (APYJRNCHG)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="APYJRNCHG.Top_Of_Page"></a>
<h2>Apply Journaled Changes (APYJRNCHG)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#APYJRNCHG.PARAMETERS.TABLE">Parameters</a><br>
<a href="#APYJRNCHG.COMMAND.EXAMPLES">Examples</a><br>
<a href="#APYJRNCHG.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="APYJRNCHG"></a>
<p>The Apply Journaled Changes (APYJRNCHG) command applies the changes that have been journaled for a particular journaled object to a saved version of the object to recover it after an operational error or some form of damage.
</p>
<p>Object content changes, and most object level changes can be applied. Examples of object level changes include journal entries resulting from SQL statements like ALTER TABLE and many operating system commands (for example: CHGPF, RMVM, MOVOBJ, MOV, RNMOBJ and RNM). The one object level change that cannot be applied is for database file objects and it is journal code D, entry type CT (create file). Object level changes that do not deposit a journal entry, naturally, cannot be applied.
</p>
<p>
<b>Note: </b>Some object level changes can only be applied if the entries were deposited into the journal receiver on a V5R3 or later system. Those object level change entries include:
</p>
<ul>
<li>D MA (member added)
</li>
<li>D FM (file moved)
</li>
<li>D FN (file renamed)
</li>
<li>E EM (data area moved)
</li>
<li>E EN (data area renamed)
</li>
</ul>
<p>
<b>Note: </b>Data queue entries can only be applied if the entries were deposited into the journal receiver on a V5R4 or later system.
</p>
<p>Some object level changes that are applied are entries from SQL statements. The replay of these entries can cause the Apply Journaled Changes (APYJRNCHG) command to run for a long time. The default time-out for the replaying of the ALTER TABLE, REFRESH TABLE or the reorganizing physical file entry is 24 hours. The default time-out for commit, rollback or cancel rollback entry is 12 hours. The default time-out for the replaying of the DROP TABLE entry is 1 hour. The default time-out for other object level change entries from SQL statements is 5 minutes.
</p>
<p>If you want to change these default values to a higher or lower value, then add an environment variable called:
</p>
<ul>
<li>QIBM_JO_APPLY_ALTER_TABLE_TIMEOUT - alter table (D CG) entry
</li>
<li>QIBM_JO_APPLY_REFRESH_TABLE_TIMEOUT - refresh table (D TQ) entry
</li>
<li>QIBM_JO_APPLY_DROP_TABLE_TIMEOUT - drop table (F DM) entry
</li>
<li>QIBM_JO_APPLY_REORG_TIMEOUT - reorganize physical file (F RM) entry
</li>
<li>QIBM_JO_APPLY_TIMEOUT - for other object level change entries
</li>
<li>QIBM_JO_APPLY_CM_RB_CN_TIMEOUT - commit (C CM), rollback (C RB), cancel rollback (C CN) entry
</li>
</ul>
<p>The value for all the environment variables is in seconds.
</p>
<p>The minimum for any of these environment variable is 60 seconds. If a value of less than 60 is specified for any of these environment variables, a value of 60 seconds will be used.
</p>
<p>Environment variables must be in all capital letters and set before issuing the APYJRNCHG command.
</p>
<p>
<b>Note: </b>The commands to manipulate environment variables are Add Environment Variable (ADDENVVAR), Change Environment Variable (CHGENVVAR) and Work with Environment Var (WRKENVVAR).
</p>
<p>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.
</p>
<p>A secondary thread is used to apply the object level changes for library objects. The apply of some journal entries may fail if the QMLTTHDACN system value is set to 3 (*NORUN). The recommended setting for QMLTTHDACN during an APYJRNCHG operation is 2. The status of the secondary thread may be monitored using WRKJOB option 20.
</p>
<p>The journaled changes are applied from the specified starting point, either the point at which an object was last saved or a particular entry on the journal, until the specified ending point has been reached. The ending point can be the point at which the object has had all changes applied, the object was last restored, a specified entry has been reached, a specified time has been reached, or the object was opened or closed by a job (the CMTBDY parameter is used for handling changes that are still pending).
</p>
<p>If you remove any database file members, delete any database files, or delete any integrated file system objects prior to restoring objects as part of your recovery scenario, you must be careful when selecting the range of journal entries to apply. Remember that the following entries in the journal will be applied if they are included in the specified range.
</p>
<ul>
<li>Journal code F entry type DM (delete member)
</li>
<li>Journal code D entry type DT (delete file)
</li>
<li>Journal code B entry type BD (integrated file system object deleted)
</li>
</ul>
<p>In these cases, it is recommended that you specify either a specific ending journal sequence number, or recover to a specific date and time (which would be prior to starting any recovery steps).
</p>
<p>
<b>Note: </b>The Display Journal (DSPJRN) command can be used to help determine the desired starting and/or ending points.
</p>
<p>A list of journaled objects can be specified. The journaled changes are applied in the order that the journal entries are found on the journal, which is the same order in which the changes were made to the objects.
</p>
<p>For database files, record-level operations are not performed under commitment control. However, any database file object-level operations that were originally performed under commitment control are also performed under commitment control during the apply. If the commitment control transaction was originally committed, the object-level operations will be committed when the corresponding commit entry is applied. If the commitment control transaction was originally rolled back, the object-level operations will be rolled back when the corresponding rollback entry is applied. If the commitment control operation does not end within the range of journal entries being applied, then the changes are rolled back.
</p>
<p>When applying database object-level changes, if the apply ends before the corresponding commit or rollback entry is applied, any pending object-level operations for database files are either committed or rolled back, depending on whether the transaction was originally committed or rolled back. This is different than what happens with database file record-level changes. For database file record-level changes, if an error occurs during an apply operation, the journal sequence number of the last successfully-applied entry is returned. Everything up to that journal sequence number is guaranteed to be applied, so the user may be able to start the apply again starting with the journal sequence number returned plus one. Since pending database file object-level operations prior to that journal sequence number may be rolled back, careful examination of the journal and user intervention is required before starting the apply again.
</p>
<p>When applying all object-level changes, if a ROLLBACK of an object-level operation for a database file occurs due to an error condition, or one of the remaining journal entries which cause the APYJRNCHG command to end, the system may potentially be in a state where partial record-level changes have been applied and some transactions are not at a commit boundary. Careful examination of the journal and user intervention is required at this point.
</p>
<p>For example, a transaction contains several inserts, followed by an ALTER TABLE to add a column, followed by several more inserts (with the new record length), but ends in a ROLLBACK. If the apply operation was interrupted just after the ALTER TABLE, the system would recognize that the transaction ended in a ROLLBACK and would roll back the ALTER TABLE. If the apply operation were restarted in this case, the second set of inserts would fail due to a record length mismatch. While this scenario is unlikely, it is important to understand the mechanics behind the apply, in order to continue the apply after an error.
</p>
<p>If a journal code J entry type SI (Enter 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.
</p>
<p>Additionally, the command can end applying for an individual object when journal entries list operations which cannot be replayed by the command. If additional changes for this particular object are encountered during this apply, then those changes will not be applied. However, 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:
</p>
<ul>
<li>An object was in use at system end and could not be synchronized with the journal.
</li>
<li>An object was restored.
</li>
<li>The system had already applied or removed the changes through the Apply Journaled Changes (APYJRNCHG) command or the Remove Journaled Changes (RMVJRNCHG) command.
</li>
</ul>
<p>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.
</p>
<p>The command also ends for an object when illogical conditions are encountered, such as attempts to do the following:
</p>
<ul>
<li>To add a record to an existing relative record number for a database file member
</li>
<li>To add a record beyond the next record position after the end of the database file
</li>
<li>To add a record that has a duplicate key for a database file member
</li>
<li>To delete a deleted record for a database file member
</li>
<li>To update a nonexistent record for a database file member
</li>
<li>To add a link to a nonexistent directory
</li>
</ul>
<p>Most illogical conditions are caused by starting the apply journaled changes operation at the wrong place in the journal with respect to the current contents of the objects.
</p>
<p>If the command ends due to illogical conditions and it is logically possible to restart the apply operation, you can issue the command again specifying a new starting sequence number.
</p>
<p>It is possible to apply changes even if the sequence numbers have been reset. The system sends an informational message and continues to apply the changes.
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>This command is shipped with public *EXCLUDE authority and the QPGMR and QSRV user profiles have private authorities to use the command. If FILE(library-name/*ALL) or OBJ(library-name/*ALL) is specified, the journal entries for objects to which a user is not authorized will be ignored.
</li>
<li>The objects specified on this command must currently have their changes journaled.
</li>
<li>If a restore operation occurs before the apply operation, the object being restored must have been journaled at the time of the save operation.
</li>
<li>The objects indicated on the command are allocated exclusively while the changes are being applied. If an object cannot be allocated, the command ends and no journaled changes are applied.
</li>
<li>If there is no journal entry that corresponds to the period indicated on the command, the command ends and no journaled changes are applied.
</li>
<li>If the journal sequence numbers have been reset in the range of the receivers specified, and a sequence number is specified on the FROMENTLRG, FROMENT, TOENTLRG, or TOENT parameter, the first occurrence of the sequence number specified on one of the parameters is used.
</li>
<li>The TOJOBO and TOJOBC parameters cannot be used to specify when the apply journaled changes operation is to end if one or more journal receivers in the specified receiver range was attached to a journal with a receiver size option (RCVSIZOPT) or a fixed length data option (FIXLENDTA) that would have omitted this data was in effect.
</li>
<li>The TOJOBO and TOJOBC parameters cannot be used if the object for which changes are being applied 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.
</li>
<li>The maximum number of objects that can have changes applied with this command is 12,000,000. If more than 12,000,000 objects are included in the specifications, an error message is sent and no changes are applied. You can change the values specified on the FILE, OBJ or OBJPATH parameter so that the limit is not exceeded.
<p>The limit will include any objects which are created as a result of applying the journaled changes to another object. This can happen during the apply operation if applying a file entry which then attempts to create a member or if applying a directory entry which then attempts to create an integrated file system object. If this limit is reached, the new member or the integrated file system object will not be created. APYJRNCHG will stop applying for the file or the directory that caused the create operation. All entries to the file or directory prior to this point will remain applied. Also, the apply operation will continue applying for any other members of the file or any other integrated file system objects in the directory that were created prior to the limit of 12,000,000 objects being exceeded if OBJERROPT(*CONTINUE) was specified.
</p>
<p>When applying changes for a database file, there is one object associated with each member and one additional object associated with the file.
</p>
</li>
<li>If OBJ(*ALLJRNOBJ) is specified, then the OBJPATH parameter cannot also be specified. OBJ(*ALLJRNOBJ) will include integrated file system objects.
</li>
<li>Using APYJRNCHG to apply changes from a journal receiver with journal entries deposited from another release (either previous or later) may cause unexpected results.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="APYJRNCHG.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.JRN"><b>JRN</b></a></td>
<td valign="top">Journal</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Journal</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top" rowspan="5"><a href="#APYJRNCHG.FILE"><b>FILE</b></a></td>
<td valign="top">Journaled file identification</td>
<td valign="top">Values (up to 300 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="5">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top">Element 1: Journaled physical file</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: Journaled physical file</td>
<td valign="top"><i>Name</i>, *ALL</td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Member</td>
<td valign="top">
<i>Name</i>, <b><u>*ALL</u></b>, *FIRST</td>
</tr>
<tr>
<td valign="top" rowspan="6"><a href="#APYJRNCHG.OBJ"><b>OBJ</b></a></td>
<td valign="top">Objects</td>
<td valign="top">Single values: *ALLJRNOBJ<br>Other values (up to 300 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="6">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Object</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: Object</td>
<td valign="top"><i>Name</i>, *ALL</td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Object type</td>
<td valign="top">
*FILE, *DTAARA, *DTAQ</td>
</tr>
<tr>
<td valign="top">Element 3: Member, if data base file</td>
<td valign="top">
<i>Name</i>, <b><u>*ALL</u></b>, *FIRST</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.OBJPATH"><b>OBJPATH</b></a></td>
<td valign="top">Objects</td>
<td valign="top">Values (up to 300 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Name</td>
<td valign="top">
<i>Path name</i></td>
</tr>
<tr>
<td valign="top">Element 2: Include or omit</td>
<td valign="top">
<b><u>*INCLUDE</u></b>, *OMIT</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.SUBTREE"><b>SUBTREE</b></a></td>
<td valign="top">Directory subtree</td>
<td valign="top">*ALL, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.PATTERN"><b>PATTERN</b></a></td>
<td valign="top">Name pattern</td>
<td valign="top">Values (up to 20 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Pattern</td>
<td valign="top">
<i>Character value</i>, <b><u>*</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Include or omit</td>
<td valign="top">
<b><u>*INCLUDE</u></b>, *OMIT</td>
</tr>
<tr>
<td valign="top" rowspan="7"><a href="#APYJRNCHG.RCVRNG"><b>RCVRNG</b></a></td>
<td valign="top">Range of journal receivers</td>
<td valign="top">Single values: <b><u>*LASTSAVE</u></b>, *CURRENT<br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="7">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top">Element 1: Starting journal receiver</td>
<td valign="top">
<i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: Starting journal receiver</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top">Element 2: Ending journal receiver</td>
<td valign="top">
Single values: <b><u>*CURRENT</u></b><br>Other values: <i>Qualified object name</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Qualifier 1: Ending journal receiver</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top" style="padding-left:10pt">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top"><a href="#APYJRNCHG.FROMENTLRG"><b>FROMENTLRG</b></a></td>
<td valign="top">Starting large sequence number</td>
<td valign="top"><i>Character value</i>, <b><u>*LASTSAVE</u></b>, *FIRST</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.TOENTLRG"><b>TOENTLRG</b></a></td>
<td valign="top">Ending large sequence number</td>
<td valign="top"><i>Character value</i>, <b><u>*LASTRST</u></b>, *LAST</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.TOTIME"><b>TOTIME</b></a></td>
<td valign="top">Ending date and time</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Ending date</td>
<td valign="top">
<i>Date</i></td>
</tr>
<tr>
<td valign="top">Element 2: Ending time</td>
<td valign="top">
<i>Time</i></td>
</tr>
<tr>
<td valign="top" rowspan="4"><a href="#APYJRNCHG.TOJOBO"><b>TOJOBO</b></a></td>
<td valign="top">Fully qualified job name</td>
<td valign="top"><i>Qualified job name</i></td>
<td valign="top" rowspan="4">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Fully qualified job name</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: User</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 3: Number</td>
<td valign="top">000000-999999</td>
</tr><tr>
<td valign="top" rowspan="4"><a href="#APYJRNCHG.TOJOBC"><b>TOJOBC</b></a></td>
<td valign="top">Fully qualified job name</td>
<td valign="top"><i>Qualified job name</i></td>
<td valign="top" rowspan="4">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Fully qualified job name</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: User</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 3: Number</td>
<td valign="top">000000-999999</td>
</tr><tr>
<td valign="top"><a href="#APYJRNCHG.CMTBDY"><b>CMTBDY</b></a></td>
<td valign="top">Commitment boundary</td>
<td valign="top"><b><u>*YES</u></b>, *NO</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.OPTION"><b>OPTION</b></a></td>
<td valign="top">Option</td>
<td valign="top"><b><u>*NONE</u></b>, *IGNINQMSG</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.OBJERROPT"><b>OBJERROPT</b></a></td>
<td valign="top">Object error option</td>
<td valign="top"><b><u>*CONTINUE</u></b>, *END</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.OUTPUT"><b>OUTPUT</b></a></td>
<td valign="top">Output</td>
<td valign="top"><b><u>*NONE</u></b>, *OUTFILE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.OUTFILE"><b>OUTFILE</b></a></td>
<td valign="top">File to receive output</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: File to receive output</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top" rowspan="3"><a href="#APYJRNCHG.OUTMBR"><b>OUTMBR</b></a></td>
<td valign="top">Output member options</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Member to receive output</td>
<td valign="top">
<i>Name</i>, <b><u>*FIRST</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Replace or add records</td>
<td valign="top">
<b><u>*REPLACE</u></b>, *ADD</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.DETAIL"><b>DETAIL</b></a></td>
<td valign="top">Detail</td>
<td valign="top"><b><u>*ALL</u></b>, *ERR</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.FROMENT"><b>FROMENT</b></a></td>
<td valign="top">Starting sequence number</td>
<td valign="top">1-9999999999, <b><u>*LASTSAVE</u></b>, *FIRST</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#APYJRNCHG.TOENT"><b>TOENT</b></a></td>
<td valign="top">Ending sequence number</td>
<td valign="top">1-9999999999, <b><u>*LASTRST</u></b>, *LAST</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="APYJRNCHG.JRN"></a>
<h3>Journal (JRN)</h3>
<p>Specifies the journal associated with the journal entries that are being applied.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Journal</b>
</p>
<dl>
<dt><b><i>journal-name</i></b></dt>
<dd>Specify the name of the journal associated with the journal entries being applied.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.FILE"></a>
<h3>Journaled file identification (FILE)</h3>
<p>Specifies a maximum of 300 qualified names of physical database files to which journal entries are being applied.
</p>
<p>Either the FILE parameter must be specified or one of the object parameters (OBJ or OBJPATH) must be specified, but not both.
</p>
<p><b>Element 1: Journaled physical file</b>
</p>
<p><b>Qualifier 1: Journaled physical file</b>
</p>
<dl>
<dt><b>*ALL</b></dt>
<dd>All physical files in the specified library whose changes are recorded in the specified journal have their journal entries applied. The library name <i>must</i> be specified. If *ALL is specified and the user does not have the required authority for all the files in the library, a message is sent and the applying of journal entries ends.
</dd>
<dt><b><i>file-name</i></b></dt>
<dd>Specify the name of the database physical file that has its journal entries applied. 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, the first member of all applicable files in the library has the changes applied.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
<p><b>Element 2: Member</b>
</p>
<p>Specify the name of the member in the file that has its journal entries applied.
</p>
<dl>
<dt><b><u>*ALL</u></b></dt>
<dd>All members in the file have their journal entries applied.
</dd>
<dt><b>*FIRST</b></dt>
<dd>The first member in the file has its journal entries applied.
</dd>
<dt><b><i>member-name</i></b></dt>
<dd>Specify the name of the member in the file that has its journal entries applied. If a member name or *FIRST is specified (not *ALL) then object-level changes for that file will not be applied during the apply operation. When *ALL is specified, then object-level changes for the file are applied.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OBJ"></a>
<h3>Objects (OBJ)</h3>
<p>Specifies a maximum of 300 objects to which journal entries are being applied, or all objects currently journaled to the journal (*ALLJRNOBJ).
</p>
<p>Either the FILE parameter must be specified, or one of the object parameters (OBJ or OBJPATH) must be specified, but not both.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*ALLJRNOBJ</b></dt>
<dd>All objects currently journaled to the journal will have their journal entries applied. This includes objects of type *FILE, *DTAARA, *DTAQ, *STMF, *DIR, and *SYMLINK. The OBJPATH parameter cannot be specified if this value is used.
</dd>
</dl>
<p><b>Element 1: Object</b>
</p>
<p><b>Qualifier 1: Object</b>
</p>
<dl>
<dt><b>*ALL</b></dt>
<dd>All objects in the specified library of the specified type whose changes are journaled to the specified journal have their journal entries applied. The library name must be specified. If *ALL is specified and the user does not have the required authority for all objects in the library, a message is sent and the applying of journal entries ends.
</dd>
<dt><b><i>object-name</i></b></dt>
<dd>Specify the name of the object that is to have its journal entries applied.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
<p><b>Element 2: Object type</b>
</p>
<p>Specify the object type of the object that has its journal entries applied.
</p>
<dl>
<dt><b>*FILE</b></dt>
<dd>Entries for database file members are applied.
</dd>
<dt><b>*DTAARA</b></dt>
<dd>Entries for data areas are applied.
</dd>
<dt><b>*DTAQ</b></dt>
<dd>Entries for data queues are applied.
</dd>
</dl>
<p><b>Element 3: Member, if data base file</b>
</p>
<p>Specify the name of the member in the file that has its journal entries applied. 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, the first member of all applicable files in the library has the changes applied.
</p>
<p>
<b>Note: </b>If the specified object type is not *FILE, the member name element value is ignored.
</p>
<dl>
<dt><b><u>*ALL</u></b></dt>
<dd>All members in the file have their journal entries applied.
</dd>
<dt><b>*FIRST</b></dt>
<dd>The first member in the file has its journal entries applied.
</dd>
<dt><b><i>member-name</i></b></dt>
<dd>Specify the name of the member in the file that has its journal entries applied. If a member name or *FIRST is specified (not *ALL) then object-level changes for that file will not be applied during the apply operation. When *ALL is specified for a file, then object-level changes for the file are applied.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OBJPATH"></a>
<h3>Objects (OBJPATH)</h3>
<p>Specifies a maximum of 300 objects to which journal entries are being applied. Only objects whose path name identifies an object of type *STMF, *DIR or *SYMLNK that is in the "root" (/), QOpenSys, and user-defined file systems are supported.
</p>
<p>Either the FILE parameter must be specified, or one of the object parameters (OBJ or OBJPATH) must be specified, but not both. OBJPATH is not allowed if OBJ(*ALLJRNOBJ) is used.
</p>
<p><b>Element 1: Name</b>
</p>
<dl>
<dt><b><i>path-name</i></b></dt>
<dd>Specify the name of the object that is to have its journal entries applied.
<p>A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. Symbolic links within the path name will not be followed. If the path name begins with the tilde character, then the path is assumed to be relative to the appropriate home directory.
</p>
<p>Additional information about path name patterns is in the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
<p><b>Element 2: Include or omit</b>
</p>
<p>The second element specifies whether names that match the path name or a pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.
</p>
<p>
<b>Note: </b>The SUBTREE parameter specifies whether the subtrees are included or omitted.
</p>
<dl>
<dt><b><u>*INCLUDE</u></b></dt>
<dd>The objects that match the object name pattern are to be included in determining what journal entries are be applied, unless overridden by an *OMIT specification.
</dd>
<dt><b>*OMIT</b></dt>
<dd>The objects that match the object name pattern are not to be included in determining what journal entries are being applied. This overrides an *INCLUDE specification and is intended to be used to omit a subset of a previously selected pattern.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.SUBTREE"></a>
<h3>Directory subtree (SUBTREE)</h3>
<p>Specifies whether the directory subtrees are included in determining the objects for which journal entries are being applied.
</p>
<p>
<b>Note: </b>This parameter is only valid if one or more path names were specified on the OBJPATH parameter.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>Only the objects that match the selection criteria are processed. The objects within selected directories are not implicitly processed.
</dd>
<dt><b>*ALL</b></dt>
<dd>All objects that meet the selection criteria are processed in addition to the entire subtree of each directory that matches the selection criteria. The subtree includes all sub-directories and the objects within those sub-directories.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.PATTERN"></a>
<h3>Name pattern (PATTERN)</h3>
<p>Specifies a maximum of 20 patterns to be used to include or omit objects for which journal entries are being applied.
</p>
<p>Only the last part of the path name will be considered for the name pattern match. Path name delimiters are not allowed in the name pattern. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes.
</p>
<p>If the Name Pattern parameter is not specified the default will be to match all patterns.
</p>
<p>Additional information about path name patterns is in the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p>
<b>Note: </b>This parameter is only valid if one or more path names were specified on the OBJPATH parameter.
</p>
<p><b>Element 1: Pattern</b>
</p>
<dl>
<dt><b><u>'*'</u></b></dt>
<dd>All objects that match the input OBJPATH parameter are to be included.
</dd>
<dt><b><i>name-pattern</i></b></dt>
<dd>Specify the pattern to be used to include or omit objects for which journal entries are being applied. Only the last part of the path name will be considered for the name pattern match. Path name delimiters are not allowed in the name pattern.
</dd>
</dl>
<p>If the Name Pattern parameter is not specified the default will be to match all patterns.
</p>
<p>Additional information about path name patterns is in the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p><b>Element 2: Include or omit</b>
</p>
<p>The second element specifies whether names that match the pattern should be included or omitted from the operation. Note that in determining whether a name matches a pattern, relative name patterns are always treated as relative to the current working directory.
</p>
<p>
<b>Note: </b>The SUBTREE parameter specifies whether directory subtrees are included or omitted.
</p>
<dl>
<dt><b><u>*INCLUDE</u></b></dt>
<dd>The objects that match the object name pattern are included in the operation, unless overridden by an *OMIT specification.
</dd>
<dt><b>*OMIT</b></dt>
<dd>The objects that match the object name pattern are not to be included in the operation. This overrides an *INCLUDE specification and is intended to be used to omit a subset of a previously selected pattern.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.RCVRNG"></a>
<h3>Range of journal receivers (RCVRNG)</h3>
<p>Specifies the starting and ending journal receivers used in applying the journal entries. The system begins by applying the journal entries in the first journal receiver in this journal receiver range and proceeds through the receivers until it applies the journal entries in the last journal receiver in this journal receiver range.
</p>
<p>
<b>Note: </b>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.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*LASTSAVE</u></b></dt>
<dd>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 applied. This parameter value is only valid if *LASTSAVE is also specified on the <b>Starting sequence number (FROMENT)</b> parameter, and on the <b>Starting large sequence number (FROMENTLRG)</b> parameter.
</dd>
<dt><b>*CURRENT</b></dt>
<dd>The journal receiver that is currently attached when starting to apply journal entries is used.
</dd>
</dl>
<p><b>Element 1: Starting journal receiver</b>
</p>
<p><b>Qualifier 1: Starting journal receiver</b>
</p>
<dl>
<dt><b><i>starting-journal-receiver</i></b></dt>
<dd>Specify the name of the journal receiver used as the first (oldest) receiver.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>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.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the library where the journal receiver is located.
</dd>
</dl>
<p><b>Element 2: Ending journal receiver</b>
</p>
<p><b>Qualifier 1: Ending journal receiver</b>
</p>
<dl>
<dt><b><u>*CURRENT</u></b></dt>
<dd>The journal receiver that is currently attached when starting to applying journal entries is used.
</dd>
<dt><b><i>ending-journal-receiver</i></b></dt>
<dd>Specify the name of the journal receiver used as the last (newest) receiver with journal entries to be applied. If the end of the receiver chain is reached before finding this receiver, no entries are applied, and an escape message is sent.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>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.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the library where the journal receiver is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.FROMENTLRG"></a>
<h3>Starting large sequence number (FROMENTLRG)</h3>
<p>Specifies the entry that is used as the starting point for applying changes that have been journaled.
</p>
<p>You can specify a value for either the <b>Starting sequence number (FROMENT)</b> parameter or the <b>Starting large sequence number (FROMENTLRG)</b> parameter, but not for both.
</p>
<dl>
<dt><b><u>*LASTSAVE</u></b></dt>
<dd>The journal entries are applied beginning with the first journal entry after the object was last saved. 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.
<p>If the restored version of the object was a version that was saved using the save-while-active function, then the system will start applying 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 applying journaled changes is saved with the object and restored. When all objects specified on the apply 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 apply processing.
</p>
<p>If the restored version of the object was a version that was saved when it was not in use (normal save), then the system verifies information for each object specified, such as if the date and time of the restore is after the date and time of the last save. 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.
</p>
<p>If the dates and times do not match, no entries are applied and an inquiry message (CPA7050) 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 entries are applied.
</p>
<p>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 applies changes beginning with the first journal entry following the start-of-save entry.
</p>
<p>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 applies changes beginning with the first journal entry following the object saved entry.
</p>
<p>
<b>Note: </b>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. If apply journaled changes cannot be used to complete the partial transactions, then the remove journaled changes (RMVJRNCHG) command can be used to just remove the partial transactions. If neither APYJRNCHG nor RMVJRNCHG can be used, and no other version of the file can be restored, then as a last resort, the Change Journaled Object (CHGJRNOBJ) command can be used to allow the file to be used while leaving the partial transactions within the object.
</p>
</dd>
<dt><b>*FIRST</b></dt>
<dd>The journal entries are applied beginning with the first journal entry in the first receiver supplied to this command.
</dd>
<dt><b><i>starting-sequence-number</i></b></dt>
<dd>Specify the sequence number of the first journal entry that is applied from the supplied journal entries. The acceptable range is 1 to 18,446,744,073,709,551,600.
<p>
<b>Note: </b>When entering a sequence number, the <b>Range of journal receivers (RCVRNG)</b> parameter cannot be *LASTSAVE and the <b>Ending large sequence number (TOENTLRG)</b> parameter cannot be *LASTRST.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.TOENTLRG"></a>
<h3>Ending large sequence number (TOENTLRG)</h3>
<p>Specifies the entry used as the ending point for applying changes that have been journaled.
</p>
<p>You can specify a value for either the <b>Ending sequence number (TOENT)</b> parameter or the <b>Ending large sequence number (TOENTLRG)</b> parameter, but not for both.
</p>
<dl>
<dt><b><u>*LASTRST</u></b></dt>
<dd>The journal entries are applied ending with the entry before the object was last restored. The system determines the actual ending position for each of the objects specified on the command. The system verifies that the date and time of the restored version of the object on the system is the same as the date and time that the object was last restored, as indicated on the journal. If the dates and times do not match, no entries are applied and an inquiry message (CPA7075) 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 entries are applied.
<p>If an object is created as a result of applying changes to another object, the ending apply point for the newly created object is the greatest ending point of all the objects being applied to.
</p>
<p>This parameter value is only valid if *LASTSAVE is also specified on the <b>Starting sequence number (FROMENT)</b> parameter or on the <b>Starting large sequence number (FROMENTLRG)</b> parameter. *LASTRST is assumed if none of the following parameters are specified:
</p>
<ul>
<li><b>Ending date and time (TOTIME)</b>,
</li>
<li><b>Fully qualified job name (TOJOBO)</b>,
</li>
<li><b>Fully qualified job name (TOJOBC)</b>.
</li>
</ul>
</dd>
<dt><b>*LAST</b></dt>
<dd>Journal entries are applied through the last entry of the last journal receiver in the receiver range.
</dd>
<dt><b><i>ending-sequence-number</i></b></dt>
<dd>Specifies the sequence number of the last entry that is applied. The acceptable range is 1 to 18,446,744,073,709,551,600.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.TOTIME"></a>
<h3>Ending date and time (TOTIME)</h3>
<p>Specifies the time and date of the last journal entry that is applied. The first entry with that or the next earlier time is the ending point for the applying of journal entries.
</p>
<p>The time can be specified in 24-hour format with or without a time separator:
</p>
<ul>
<li>Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where <b>hh</b> = hours, <b>mm</b> = minutes, and <b>ss</b> = seconds.
</li>
<li>With a time separator, specify a string of 5 or 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If you enter this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.
</li>
</ul>
<p><b>Element 1: Ending date</b>
</p>
<dl>
<dt><b><i>date</i></b></dt>
<dd>Specify the ending date.
</dd>
</dl>
<p><b>Element 2: Ending time</b>
</p>
<dl>
<dt><b><i>time</i></b></dt>
<dd>Specify the ending time.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.TOJOBO"></a>
<h3>Fully qualified job name (TOJOBO)</h3>
<p>Specifies the job identifier of the job that, when it opens an object that is specified, ends the applying of journal entries by this command. The first job open entry found for any of the specified objects, is the ending point for all the objects specified.
</p>
<p>Only objects of type *FILE, *DIR or *STMF have journal entries related to job opens. The TOJOBO parameter cannot be used if the object for which changes are being applied 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.
</p>
<dl>
<dt><b><i>job-identifier</i></b></dt>
<dd>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.
<dl>
<dt><b><i>job-name</i></b></dt>
<dd>Specify the job name of the job.
</dd>
<dt><b><i>user-name</i></b></dt>
<dd>Specify the user name of the job.
</dd>
<dt><b><i>job-number</i></b></dt>
<dd>Specify the system-assigned job number.
</dd>
</dl>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.TOJOBC"></a>
<h3>Fully qualified job name (TOJOBC)</h3>
<p>Specifies the job identifier of the job that ends the applying of journal entries by this command. The first object close entry found for the specified job, for any of the specified objects, is the ending point for all objects specified. The applying of journal entries is ended when either of the following occurs:
</p>
<ul>
<li>The specified job closes an object that is specified.
</li>
<li>The specified job is ended.
</li>
</ul>
<p>Only objects of type *FILE, *DIR or *STMF have journal entries related to object closes. The TOJOBC parameter cannot be used if the object for which changes are being applied 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.
</p>
<dl>
<dt><b><i>job-identifier</i></b></dt>
<dd>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.
<dl>
<dt><b><i>job-name</i></b></dt>
<dd>Specify the job name of the job.
</dd>
<dt><b><i>user-name</i></b></dt>
<dd>Specify the user name of the job.
</dd>
<dt><b><i>job-number</i></b></dt>
<dd>Specify the system-assigned job number.
</dd>
</dl>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.CMTBDY"></a>
<h3>Commitment boundary (CMTBDY)</h3>
<p>Specifies whether commitment boundaries are honored when the journal entries to be applied 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.
</p>
<p>
<b>Note: </b>For purposes of this parameter description, the TO option is used to describe either the TOENT, the TOENTLRG, the TOTIME, the TOJOBO, or the TOJOBC parameter, whichever is specified.
</p>
<dl>
<dt><b><u>*YES</u></b></dt>
<dd>The journal entries are applied from the entry specified on the FROMENT or the FROMENTLRG parameter to the entry indicated on the TO option, honoring commitment boundaries.
<ul>
<li>If the journal entry specified on the FROMENT or the FROMENTLRG 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.
</li>
<li>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 and that fact is recorded in any outfile generated.
</li>
</ul>
<p>
<b>Note: </b>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. In addition, if pending object level operations exist, they are either committed or rolled back, determined by looking ahead in the journal for that transaction's Journal Code C Entry Type CM or RB journal entry. This may result in a partial transaction being applied and commitment boundaries might not be honored. If a C/CM or C/RB entry is not found in the journal, the object level operations are rolled back.
</p>
</dd>
<dt><b>*NO</b></dt>
<dd>The journal entries are applied from the entry specified on the FROMENT or the FROMENTLRG 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.
<p>
<b>Note: </b>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 original pending changes, along with any new changes for the partial transaction will remain in the object at the end of the apply operation. The object will only be usable if all pending transactions complete within the specified range.
</p>
<p>
<b>Note: </b>Even with CMTBDY(*NO) specified, commitment control is used during the apply for database object level operations. This does not affect the range of journal entries selected, which is still as described above. If pending database object level operations exist, they are either committed or rolled back, determined by looking ahead in the journal for that transaction's C/CM or C/RB journal entry. If no C/CM or C/RB journal entry is found, the changes are rolled back.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OPTION"></a>
<h3>Option (OPTION)</h3>
<p>Specifies whether additional checking should be done prior to applying journal changes.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>All protective checks are performed before any journal changes are applied.
</dd>
<dt><b>*IGNINQMSG</b></dt>
<dd>Ignore inquiry message. Inquiry messages CPA7050 and CPA7075 are not presented to the user, even if the object that is being applied to is not from the last save or restore of the object. The apply operation continues.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OBJERROPT"></a>
<h3>Object error option (OBJERROPT)</h3>
<p>Specifies how the processing of journal entries should proceed when an error situation is encounterd.
</p>
<dl>
<dt><b><u>*CONTINUE</u></b></dt>
<dd>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.
</dd>
<dt><b>*END</b></dt>
<dd>When the first journal entry is encountered that cannot be successfully processed, processing will end for all objects.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OUTPUT"></a>
<h3>Output (OUTPUT)</h3>
<p>Specifies whether a list of information about the objects to whom changes were applied is created. The information can be directed to a database file.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No data base file is created with the output. Messages are sent to the job log for the first 512 objects.
</dd>
<dt><b>*OUTFILE</b></dt>
<dd>Output information about the apply operation will be directed to the database file specified on the <b>File to receive output (OUTFILE)</b> parameter.
<p>
<b>Note: </b>You must specify the database file name on the <b>File to receive output (OUTFILE)</b> parameter when OUTPUT(*OUTFILE) is specified.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OUTFILE"></a>
<h3>File to receive output (OUTFILE)</h3>
<p>Specifies the database file to which the information is directed when *OUTFILE is specified on <b>Output (OUTPUT)</b> 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.
</p>
<p><b>Qualifier 1: File to receive output</b>
</p>
<dl>
<dt><b><i>database-file-name</i></b></dt>
<dd>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.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>library-name</i></b></dt>
<dd>Specify the name of the library to be searched.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.OUTMBR"></a>
<h3>Output member options (OUTMBR)</h3>
<p>Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the <b>Output (OUTPUT)</b> parameter.
</p>
<p><b>Element 1: Member to receive output</b>
</p>
<dl>
<dt><b><u>*FIRST</u></b></dt>
<dd>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 <b>File to receive output (OUTFILE)</b> parameter.
</dd>
<dt><b><i>name</i></b></dt>
<dd>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.
<p>If the member exists, you can add records to the end of the existing member or clear the existing member and add the records.
</p>
</dd>
</dl>
<p><b>Element 2: Replace or add records</b>
</p>
<dl>
<dt><b><u>*REPLACE</u></b></dt>
<dd>The existing records in the specified database file member are replaced by the new records.
</dd>
<dt><b>*ADD</b></dt>
<dd>The new records are added to the existing information in the specified database file member.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.DETAIL"></a>
<h3>Detail (DETAIL)</h3>
<p>Specifies the type of information that is directed to the output file.
</p>
<dl>
<dt><b><u>*ALL</u></b></dt>
<dd>The file will contain information about the command and an entry for each object that was applied to whether it existed when the apply command started, or it was created during the apply.
</dd>
<dt><b>*ERR</b></dt>
<dd>The file will contain information about the command, an entry only for each object that was not successfully applied to. If the apply ended early for an object an entry will be included for it.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.FROMENT"></a>
<h3>Starting sequence number (FROMENT)</h3>
<p>Specifies the entry that is used as the starting point for applying changes that have been journaled.
</p>
<p>You can specify a value for either the <b>Starting sequence number (FROMENT)</b> parameter or the <b>Starting large sequence number (FROMENTLRG)</b> parameter, but not for both.
</p>
<dl>
<dt><b><u>*LASTSAVE</u></b></dt>
<dd>The journal entries are applied beginning with the first journal entry after the object was last saved. 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.
<p>If the restored version of the object was a version that was saved using the save-while-active function, then the system will start applying 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 applying journaled changes is saved with the object and restored. When all objects specified on the apply 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 apply processing.
</p>
<p>If the restored version of the object was a version that was saved when it was not in use (normal save), then the system verifies information for each object specified, such as if the date and time of the restore is after the date and time of the last save. 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.
</p>
<p>If the dates and times do not match, no entries are applied and an inquiry message (CPA7050) 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 entries are applied.
</p>
<p>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 applies changes beginning with the first journal entry following the start-of-save entry.
</p>
<p>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 applies changes beginning with the first journal entry following the object saved entry.
</p>
<p>
<b>Note: </b>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. If apply journaled changes cannot be used to complete the partial transactions, then the remove journaled changes (RMVJRNCHG) command can be used to just remove the partial transactions. If neither APYJRNCHG nor RMVJRNCHG can be used, and no other version of the file can be restored, then as a last restore, the Change Journaled Object (CHGJRNOBJ) command can be used to allow the file to be used while leaving the partial transactions within the object.
</p>
</dd>
<dt><b>*FIRST</b></dt>
<dd>The journal entries are applied beginning with the first journal entry in the first receiver supplied to this command.
</dd>
<dt><b><i>starting-sequence-number</i></b></dt>
<dd>Specify the sequence number of the first journal entry that is applied from the supplied journal entries. The acceptable range is 1 to 9,999,999,999.
<p>
<b>Note: </b>When entering a sequence number, the <b>Range of journal receivers (RCVRNG)</b> parameter cannot be *LASTSAVE and the <b>Ending sequence number (TOENT)</b> parameter cannot be *LASTRST.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="APYJRNCHG.TOENT"></a>
<h3>Ending sequence number (TOENT)</h3>
<p>Specifies the entry used as the ending point for applying changes that have been journaled.
</p>
<p>You can specify a value for either the <b>Ending sequence number (TOENT)</b> parameter or the <b>Ending large sequence number (TOENTLRG)</b> parameter, but not for both.
</p>
<dl>
<dt><b><u>*LASTRST</u></b></dt>
<dd>The journal entries are applied ending with the entry before the object was last restored. The system determines the actual ending position for each of the objects specified on the command. The system verifies that the date and time of the restored version of the object on the system is the same as the date and time that the object was last restored, as indicated on the journal. If the dates and times do not match, no entries are applied and an inquiry message (CPA7075) 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 entries are applied.
<p>If an object is created as a result of applying changes to another object, the ending apply point for the newly created object is the greatest ending point of all the objects being applied to.
</p>
<p>This parameter value is only valid if *LASTSAVE is also specified on the <b>Starting sequence number (FROMENT)</b> parameter or the <b>Starting large sequence number (FROMENTLRG)</b> parameter. *LASTRST is assumed if none of the following parameters are specified:
</p>
<ul>
<li><b>Ending date and time (TOTIME)</b>,
</li>
<li><b>Fully qualified job name (TOJOBO)</b>,
</li>
<li><b>Fully qualified job name (TOJOBC)</b>.
</li>
</ul>
</dd>
<dt><b>*LAST</b></dt>
<dd>Journal entries are applied through the last entry of the last journal receiver in the receiver range.
</dd>
<dt><b><i>ending-sequence-number</i></b></dt>
<dd>Specifies the sequence number of the last entry that is applied. The acceptable range is 1 to 9,999,999,999.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="APYJRNCHG.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Applying Changes to First Member</b>
</p>
<p>
<pre>
APYJRNCHG JRN(FIN/JRNACT) FILE(FIN/RCVABLE)
</pre>
</p>
<p>This command causes the system to apply to the first member of file RCVABLE in library FIN all changes journaled to JRNACT in library FIN since the file was last saved. The receiver range is determined by the system. The changes are applied beginning with the first journaled change on the receiver chain after the file was last saved and continue through all applicable journal entries to the point at which the file was last restored.
</p>
<p><b>Example 2: Applying Changes to a Specific Member</b>
</p>
<p>
<pre>
APYJRNCHG JRN(JRNA) FILE((LIB2/PAYROLL JAN))
RCVRNG(RCV22 RCV25)
FROMENT(*FIRST) TOENT(*LAST)
</pre>
</p>
<p>This command causes the system to apply all changes journaled to JRNA to member JAN of the file PAYROLL in library LIB2. The journal receivers containing the journaled changes are contained in the receiver chain starting with receiver RCV22 and ending with receiver RCV25. Applying the changes starts with the first change journaled on this receiver chain and ends with the last change journaled on this receiver chain. The library search list (*LIBL) is used to find the journal JRNA and the journal receivers RCV22 and RCV25.
</p>
<p><b>Example 3: Applying Changes to integrated file system Objects</b>
</p>
<p>
<pre>
APYJRNCHG JRN(JRNS/JRNA)
OBJPATH(('/HRinfo/payroll/Jan*')
('/HRinfo/payroll/JanSummary' *OMIT))
SUBTREE(*ALL)
PATTERN(('*.data') ('Temp*.data' *OMIT))
RCVRNG(*CURRRENT)
FROMENT(20) TOENT(400)
</pre>
</p>
<p>This command causes the system to apply changes to integrated file system objects. The changes will be applied from starting sequence number 20 to ending sequence number 400 found in the journal receiver currently attached to journal JRNS/JRNA.
</p>
<ol>
<li>All objects in the integrated file system subtree '/HRinfo/payroll' that start with the characters 'Jan', but omitting the object named '/HRinfo/payroll/JanSummary'.
</li>
<li>All objects in the subtree of any directories that matched number 1, whose names end with '.data', but omitting names ending in '.data' that begin with the characters 'Temp'.
</li>
</ol>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="APYJRNCHG.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF69A9</b></dt>
<dd>Internal error detected, error code &amp;2.
</dd>
<dt><b>CPF69AA</b></dt>
<dd>Unable to refer to object &amp;1 saved with STG(*FREE).
</dd>
<dt><b>CPF69AB</b></dt>
<dd>Values for RCVRNG parameter not correct.
</dd>
<dt><b>CPFA0D4</b></dt>
<dd>File system error occurred. Error number &amp;1.
</dd>
<dt><b>CPF70CC</b></dt>
<dd>Cannot perform operation beyond journal entry &amp;7.
</dd>
<dt><b>CPF70CD</b></dt>
<dd>Cannot perform operation beyond journal entry &amp;7.
</dd>
<dt><b>CPF70CE</b></dt>
<dd>Cannot perform operation beyond journal entry &amp;7.
</dd>
<dt><b>CPF70EB</b></dt>
<dd>Referential constraint error on member &amp;3.
</dd>
<dt><b>CPF70EC</b></dt>
<dd>Referential constraint error. Reason code &amp;9.
</dd>
<dt><b>CPF70EE</b></dt>
<dd>Maximum encoded vector access paths for member &amp;3.
</dd>
<dt><b>CPF7002</b></dt>
<dd>File &amp;1 in library &amp;2 not a physical file.
</dd>
<dt><b>CPF7003</b></dt>
<dd>Entry not journaled to journal &amp;1. Reason code &amp;3.
</dd>
<dt><b>CPF7006</b></dt>
<dd>Member &amp;3 not found in file &amp;1 in &amp;2.
</dd>
<dt><b>CPF7007</b></dt>
<dd>Cannot allocate member &amp;3 file &amp;1 in &amp;2.
</dd>
<dt><b>CPF701B</b></dt>
<dd>Journal recovery of an interrupted operation failed.
</dd>
<dt><b>CPF704A</b></dt>
<dd>Record length incorrect for member &amp;3.
</dd>
<dt><b>CPF704F</b></dt>
<dd>TOJOBO or TOJOBC parameter not valid for receiver range.
</dd>
<dt><b>CPF7041</b></dt>
<dd>Entry for job &amp;3/&amp;2/&amp;1 not found.
</dd>
<dt><b>CPF7042</b></dt>
<dd>Object not journaled or journaled to different journal.
</dd>
<dt><b>CPF7044</b></dt>
<dd>Apply or remove of journaled entries failed, reason code &amp;7.
</dd>
<dt><b>CPF7045</b></dt>
<dd>Journal receiver &amp;1 in &amp;2 partially damaged.
</dd>
<dt><b>CPF7046</b></dt>
<dd>Duplicate key not allowed for member &amp;3.
</dd>
<dt><b>CPF7047</b></dt>
<dd>Member &amp;3 file &amp;1 in &amp;2 full.
</dd>
<dt><b>CPF7048</b></dt>
<dd>Cannot perform journaled change to member &amp;3.
</dd>
<dt><b>CPF7049</b></dt>
<dd>Cannot perform operation beyond journal entry &amp;7.
</dd>
<dt><b>CPF705A</b></dt>
<dd>Operation failed due to remote journal.
</dd>
<dt><b>CPF7050</b></dt>
<dd>LASTSAVE date not same as restored version of *&amp;4 object.
</dd>
<dt><b>CPF7051</b></dt>
<dd>Save entry for *&amp;6 object not found.
</dd>
<dt><b>CPF7052</b></dt>
<dd>Select/omit failure in logical file over member &amp;3.
</dd>
<dt><b>CPF7053</b></dt>
<dd>Values for RCVRNG parameter not correct; reason code &amp;1.
</dd>
<dt><b>CPF7054</b></dt>
<dd>FROM and TO values not valid.
</dd>
<dt><b>CPF7057</b></dt>
<dd>*LIBL not allowed with FILE(*ALL) or OBJ(*ALL).
</dd>
<dt><b>CPF7058</b></dt>
<dd>Apply or remove journaled entries operation failed.
</dd>
<dt><b>CPF7059</b></dt>
<dd>Entry for &amp;1 not found in RCVRNG.
</dd>
<dt><b>CPF7063</b></dt>
<dd>Cannot use file &amp;1 as OUTFILE.
</dd>
<dt><b>CPF7067</b></dt>
<dd>FROMENTLRG or FROMENT option not valid. Commit boundary violation.
</dd>
<dt><b>CPF7068</b></dt>
<dd>Entry needed for apply or remove operation not found.
</dd>
<dt><b>CPF7069</b></dt>
<dd>No entries applied or removed using journal &amp;1.
</dd>
<dt><b>CPF7075</b></dt>
<dd>Restore date of *&amp;4 object not same as in journal.
</dd>
<dt><b>CPF7076</b></dt>
<dd>Restore entry for *&amp;6 object not found in RCVRNG.
</dd>
<dt><b>CPF7077</b></dt>
<dd>Key mapping error on member &amp;3.
</dd>
<dt><b>CPF7078</b></dt>
<dd>Cannot apply or remove changes to member &amp;3.
</dd>
<dt><b>CPF70A4</b></dt>
<dd>Apply journaled changes not allowed for specified receiver.
</dd>
<dt><b>CPF70A7</b></dt>
<dd>Not all entries applied or removed for at least one object.
</dd>
<dt><b>CPF70A8</b></dt>
<dd>File &amp;1 in library &amp;2 cannot be used.
</dd>
<dt><b>CPF70AA</b></dt>
<dd>FROMENT(*LASTSAVE) must be specified.
</dd>
<dt><b>CPF70AB</b></dt>
<dd>Journal receiver &amp;1 in library &amp;2 not found.
</dd>
<dt><b>CPF70AD</b></dt>
<dd>Apply of journaled entries failed, reason code &amp;7.
</dd>
<dt><b>CPF9801</b></dt>
<dd>Object &amp;2 in library &amp;3 not found.
</dd>
<dt><b>CPF9802</b></dt>
<dd>Not authorized to object &amp;2 in &amp;3.
</dd>
<dt><b>CPF9803</b></dt>
<dd>Cannot allocate object &amp;2 in library &amp;3.
</dd>
<dt><b>CPF9809</b></dt>
<dd>Library &amp;1 cannot be accessed.
</dd>
<dt><b>CPF9810</b></dt>
<dd>Library &amp;1 not found.
</dd>
<dt><b>CPF9812</b></dt>
<dd>File &amp;1 in library &amp;2 not found.
</dd>
<dt><b>CPF9820</b></dt>
<dd>Not authorized to use library &amp;1.
</dd>
<dt><b>CPF9822</b></dt>
<dd>Not authorized to file &amp;1 in library &amp;2.
</dd>
<dt><b>CPF9825</b></dt>
<dd>Not authorized to device &amp;1.
</dd>
<dt><b>CPF9860</b></dt>
<dd>Error occurred during output file processing.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#APYJRNCHG.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>