Change Journaled Object (CHGJRNOBJ)

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

The Change Journaled Object (CHGJRNOBJ) command changes the journaling attributes of a journaled object without the need to end and restart journaling for the object.

The command can be used to change the Images (IMAGES) value for a database file (*FILE) or a data area (*DTAARA) object without the need to end and restart journaling for the object. Otherwise the Start Journal Physical File (STRJRNPF) can be used to set this value for database files. The Start Journal (STRJRN) or the Start Journal Object (STRJRNOBJ) can be used to set this value for data areas.

The command can be used to change the Omit journal entry (OMTJRNE) value for a database file (*FILE), an integrated file system stream file (*STMF) or directory (*DIR) object without the need to end and restart journaling for the object. Otherwise the Start Journal Physical File (STRJRNPF) can be used to set this value for database files. The Start Journal (STRJRN) can be used to set this value for integrated file system objects.

The command can be used to change the New objects inherit journaling (INHERIT) value for an integrated file system directory (*DIR) object without the need to end and restart journaling for the object. Otherwise the Start Journal (STRJRN) can be used to set this value for integrated file system objects.

The command can also be used to allow a database file (*FILE), that contains changes for partial transactions, to be used. Partial transactions can only exist for an object that can be changed under commitment control. Database file objects (*FILE) are the only objects that can be opened using commitment control.

Partial transactions can exist for two reasons:

  1. The most common reason that an object may have partial transactions is that the object was saved while it was in the middle of a transaction and this saved version has been restored. In this case, the preferred method to complete all partial transactions is to use the Apply Journaled Changes (APYJRNCHG) or Remove Journaled Changes (RMVJRNCHG) command. If the journal receivers needed for APYJRNCHG or RMVJRNCHG are not available, then as a last resort, the Partial transactions (PTLTNS) parameter can be used to allow the database file to be opened and used, without completing the transactions.
  2. The other reason that partial transactions may exist is that the object was involved in a long running rollback operation that was interrupted. In this case, APYJRNCHG and RMVJRNCHG cannot be used to complete the partial transactions. If there is no saved version of the file to restore, then as a last resort, the Partial transactions (PTLTNS) parameter can be used to allow the file to be opened and used, without completing the transaction.

If a change does not apply to an object type, the objects of that type are ignored and processing continues with the next object. Also, if the object already has the correct value for the attribute being changed no error will be returned.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
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
OBJPATH Objects Values (up to 300 repetitions): Element list Optional
Element 1: Name Path name
Element 2: Include or omit *INCLUDE, *OMIT
OBJFID File identifier Values (up to 300 repetitions): Hexadecimal value Optional
SUBTREE Directory subtree *NONE, *ALL Optional
PATTERN Name pattern Values (up to 20 repetitions): Element list Optional
Element 1: Pattern Character value, *
Element 2: Include or omit *INCLUDE, *OMIT
ATR Attribute *IMAGES, *OMTJRNE, *INHERIT, *PTLTNS Optional
IMAGES Images *SAME, *AFTER, *BOTH Optional
OMTJRNE Omit journal entry *SAME, *NONE, *OPNCLOSYN Optional
INHERIT New objects inherit journaling *SAME, *NO, *YES Optional
PTLTNS Partial transactions *SAME, *ALWUSE Optional
Top

Objects (OBJ)

Specifies an object or list of objects for which their journaling attributes are to be changed.

Element 1: Object

Qualifier 1: Object

*ALL
All objects in the specified library of the specified type who are currently being journaled have their journaling attributes changed. 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 processing continues with the next object. Objects that match the specified selection criteria, but are not currently being journaled are ignored.
name
Specify the name of the object that is to have its journaling attributes changed.

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

Specify the object type of the object that is to have its journaling attributes changed.

*DTAARA
Journaling attributes for data areas are changed.
*FILE
Journaling attributes for database file members are changed.
Top

Objects (OBJPATH)

Specifies a maximum of 300 objects for which journaling attributes are to be changed. Only objects whose path name identifies an object of type *STMF, *DIR, *SYMLNK, *DTAARA, or *FILE that is in the "root" (/), QOpenSys, or user-defined file systems are supported. Objects found that match the specified selection criteria but are not currently being journaled are ignored.

Element 1: Name

path-name
Specify the name of the object that is to have its journaling attributes changed.

Symbolic links within the path name will not be followed.

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.

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.

Note: The SUBTREE parameter specifies whether the subtrees are included or omitted.

Element 2: Include or omit

*INCLUDE
The objects that match the object name pattern are to be included in the list of objects for which journaling attributes are to be changed, unless overridden by an *OMIT specification.
*OMIT
The objects that match the object name pattern are not to be included in the list of objects for which journaling attributes are to be changed. This overrides an *INCLUDE specification and is intended to be used to omit a subset of a previously selected pattern.
Top

File identifier (OBJFID)

Specifies a maximum of 300 file identifiers (FIDs) for which journaling attributes are to be changed. FIDs are a unique identifier associated with integrated file system related objects. This field is input in hexadecimal format. Only objects whose FID identifies an object of type *STMF, *DIR, *SYMLNK, *DTAARA, or *FILE are supported.

file-identifier
Objects identified with the FID have their attributes changed.
Top

Directory subtree (SUBTREE)

Specifies whether the directory subtrees are included in determining the objects for which journaling attributes are to be changed.

Note: This parameter is only valid if one or more path names were specified on the Objects (OBJPATH) parameter.

*NONE
Only the objects that match the selection criteria are processed. The objects within selected directories are not implicitly processed.
*ALL
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.
Top

Name pattern (PATTERN)

Specifies a maximum of 20 patterns to be used to include or omit objects for which journaling attributes are to be changed.

Note: This parameter is only valid if one or more path names were specified on the Objects (OBJPATH) parameter.

Element 1: Pattern

'*'
All objects that match the OBJPATH parameter are to be included.
name-pattern
Specify the pattern to be used to include or omit objects for which journaling attributes will be changed. 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.

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.

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.

Element 2: Include or omit

*INCLUDE
The objects that match the object name pattern are included in the operation, unless overridden by an *OMIT specification.
*OMIT
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.
Top

Attribute (ATR)

Specifies which attribute will be selected to be changed.

*IMAGES
The attribute controlled by the Images (IMAGES) parameter is to be changed.
*OMTJRNE
The attribute controlled by the Omit journal entry (OMTJRNE) parameter is to be changed.
*INHERIT
The attribute controlled by the New objects inherit journaling (INHERIT) parameter is to be changed.
*PTLTNS
The attribute controlled by the Partial transactions (PTLTNS) parameter is to be changed.
Top

Images (IMAGES)

Specifies the kinds of images that are written to the journal receiver for changes to objects.

*SAME
This value does not change.
*AFTER
Only after images are generated for changes to objects.
*BOTH
The system generates both before and after images for changes to objects.

Note: The value *BOTH is only valid for data area (*DTAARA) and database file (*FILE) objects.

Top

Omit journal entry (OMTJRNE)

Specifies the journal entries that are omitted.

*SAME
This value does not change.
*NONE
No entries are omitted.
*OPNCLOSYN
Open and close entries are omitted for *FILE objects. Open, close and force entries are omitted for *DIR and *STMF objects. Open, close and force operations on the specified objects do not generate open, close and force journal entries. This prevents the use of TOJOBO and TOJOBC entries on the Apply Journaled Changes (APYJRNCHG) command, but it saves some storage space in the journal receivers.

Note: The value *OPNCLOSYN is only valid for *FILE, *DIR and *STMF objects.

Note: The value *OPNCLOSYN is the same as OMTJRNE(*OPNCLO) on the STRJRNPF command for *FILE objects.

Top

New objects inherit journaling (INHERIT)

Specifies whether new objects created within a journaled directory should inherit the journal options and the journal state of its parent directory.

Note: The INHERIT parameter is only valid for *DIR objects.

*SAME
This value does not change.
*NO
New objects created within the directory will not inherit the journal options and journal state of the parent directory.
*YES
New objects created within the directory will inherit the journal options and journal state of the parent directory.
Top

Partial transactions (PTLTNS)

Specifies whether an object that contains changes for partial transactions can be used or not.

Note: The PTLTNS parameter is only valid for *FILE objects.

*SAME
This value does not change.
*ALWUSE
The object that contains changes for partial transactions is changed to allow it to be used but the partial transactions are not themselves completed. Any changes to the object that are pending because of the partial transactions will remain in the object.

Note: All object (*ALLOBJ) special authority is required if *ALWUSE is specified.

Top

Examples

Example 1: Change File Journaling Attribute IMAGES

CHGJRNOBJ   OBJ((LIBA/FILEA *FILE))  ATR(*IMAGES) IMAGES(*BOTH)

This command will change the attribute of file FILEA in library LIBA to now journal both before and after images for the file without having to end journaling and start journaling of the file.

Example 2: Change File Journaling Attribute OMTJRNE

CHGJRNOBJ   OBJ((LIBB/FILEB *FILE))  ATR(*OMTJRNE) OMTJRNE(*OPNCLOSYN)

This command will change the attribute of file FILEB in library LIBB to now omit open and close entries.

Example 3: Change Object Journaling Attribute OMTJRNE

CHGJRNOBJ   OBJFID(00000000000000007E09BDB000000009)
            ATR(*OMTJRNE) OMTJRNE(*OPNCLOSYN)

This command will change the attribute of the object represented by the specified file identifier to now omit open, close and force entries. This object can be an object of type *DIR or *STMF.

Example 4: Change File Attribute PTLTNS

CHGJRNOBJ   OBJ((LIBC/FILEC *FILE))  ATR(*PTLTNS) PTLTNS(*ALWUSE)

This command will change the file so that it can be used again, however the partial transactions are not themselves completed. This method should only be used in rare circumstances when the file could not be recovered by applying or removing the journaled changes.

Top

Error messages

*ESCAPE Messages

CPF7057
*LIBL not allowed with FILE(*ALL) or OBJ(*ALL).
CPF70B1
&1 of &2 objects changed.
CPF70B2
&2 may not be specified with ATR(*&1).
CPF70B3
Not authorized to use the PTLTNS parameter.
Top