Command reference / ifs

STRJRN

Start Journal

The Start Journal (STRJRN) command is used to start journaling changes (made to an object or list of objects) to a specific journal. The object types which are supported through this interface are Data Areas (*DTAARA), Data Queues (*DTAQ), Stream Files (*STMF), Directories (*DIR), and Symbolic Links (*SYMLNK). Only objects of type *STMF, *DIR or *SYMLNK that are in the "root" (/), QOpenSys, and permanent user-defined file systems are supported. For more information about the possible journal entries which can be sent, see the Journal management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. Search for "journal entry finder". The user can specify that only the after image or both the before and the after images of an object of type *DTAARA be journaled. Before images are necessary to remove journaled changes using the Remove Journaled Changes (RMVJRNCHG) command. After journaling begins for the object, the user should save the journaled object to preserve its journal attribute information. Also, the object must be saved because, for example, journaled changes cannot be applied to a version of the object that was saved before journaling was in effect. For other ways to start journaling see the following commands: Access Paths - Start Journal Access Path (STRJRNAP) Physical Files - Start Journal Physical File (STRJRNPF) Libraries - Start Journal Library (STRJRNLIB) Other Objects - Start Journal Object (STRJRNOBJ)

Allowed environments: *ALL. Positional parameters: 0.

Restrictions

Parameters

OBJ Object

Specifies a maximum of 300 objects for which changes are to be journaled. Only objects whose path name identifies an object of type *STMF, *DIR, *SYMLNK, *DTAARA or *DTAQ are supported. 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.

Type
*CHAR
Required
Yes
Length
5000
Case
Mixed case
'object-path-name'
Specify the path name of the object for which changes are to be journaled. 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. Additional information about path name patterns is in the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
*INCLUDE
The objects that match the object name pattern are to be journaled, unless overridden by an *OMIT specification.
*OMIT
The objects that match the object name pattern are not be journaled. This overrides an *INCLUDE specification and is intended to be used to omit a subset of a previously selected path.

JRN Journal

Specifies the path name of the journal that receives the journaled changes. Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

Type
*CHAR
Required
Yes
Length
5000
Case
Mixed case
'journal-path-name'
Specify the path name of the journal that receives the journaled changes.

SUBTREE Directory subtree

Specifies whether the directory subtrees are included in the start journal operation. Note: This parameter is ignored if the OBJ parameter is not specified. Note: This parameter is ignored unless object-path-name is a directory (*DIR) object.

Type
*CHAR
Required
No
Default
*NONE
Length
5
Case
Uppercase

Allowed values: *NONE, *ALL

*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 subdirectories and the objects within those subdirectories. Once the command has begun processing a specific directory subtree, the objects which will be found and processed may be affected by operations that update the organization of objects within the specified directory tree. This includes, but is not limited to, the following: Adding, removing, or renaming object links Mounting or unmounting file systems Updating the effective root directory for the process calling the command Updating the contents of a symbolic link In order to process the directory subtree, the system code may increase the process-scoped maximum number of file descriptors that can be opened during processing. This is done so that the command is not likely to fail due to a lack of descriptors. This process-scoped maximum value is not reset when the command completes.

INHERIT New objects inherit journaling

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

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

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

IMAGES Images

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

Type
*CHAR
Required
No
Default
*AFTER
Length
6
Case
Uppercase

Allowed values: *AFTER, *BOTH

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

OMTJRNE Omit journal entry

Specifies the journal entries that are omitted.

Type
*CHAR
Required
No
Default
*NONE
Length
10
Case
Uppercase

Allowed values: *NONE, *OPNCLOSYN

*NONE
No entries are omitted.
*OPNCLOSYN
Open, close and force entries are omitted. 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 *DIR and *STMF objects.

LOGLVL Logging level

Specifies the error logging level used. This parameter is used to determine which messages will be sent.

Type
*CHAR
Required
No
Default
*ERRORS
Length
7
Case
Uppercase

Allowed values: *ERRORS, *ALL

*ERRORS
All diagnostic and escape messages are sent but the command will not send successful completion messages for each object. At the completion of this command, one completion message will be sent.
*ALL
The command sends all the messages that would be sent with *ERRORS and it will also send the successful completion message for each object.

Examples

STRJRN OBJ(('/mypath' *INCLUDE) ('/mypath/myobject' *OMIT)) JRN('/QSYS.LIB/MYLIB.LIB/JRNLA.JRN')

Start Journaling with Omit of Directory. This command journals all changes to all objects supported by this command within the first-level of directory '/mypath' except '/mypath/myobject' to journal '/QSYS.LIB/MYLIB.LIB/JRNLA.JRN'. None of the objects within the subdirectories of '/mypath' will be journaled. Only the after images of updated records are written to the journal.

STRJRN OBJ(('/mypath' *INCLUDE) ('/mypath/myobject.txt' *OMIT)) JRN('/QSYS.LIB/MYLIB.LIB/JRNLA.JRN') SUBTREE(*ALL) PATTERN(('*.TXT' *INCLUDE)) OMTJRNE(*OPNCLOSYN)

Start Journaling with Pattern Matching. This command journals changes to all objects that match pattern '*.txt' in directory '/mypath' except object '/mypath/myobject.txt'. The open, close and force entries are not journaled. Only the after images of updated records are written to the journal.

STRJRN OBJ(('/mypath/my*' *INCLUDE)) JRN('/QSYS.LIB/MYLIB.LIB/JRNLA.JRN') PATTERN(('*.DTA*' *OMIT))

Start Journaling with Omit by Pattern. This command journals changes to all objects within the first-level directories that match the pattern for path '/mypath/my*' and will omit all objects that match pattern '*.DTA*' (objects of type *DTAARA and *DTAQ). Only the after images of updated records are written to the journal.

STRJRN OBJFID(00000000000000007E09BDB000000009 00000000000000009E09BDB00000000A) JRN('/QSYS.LIB/MYLIB.LIB/JRNLA.JRN')

Start Journaling using File Identifiers. This command journals all changes to the objects represented by the specified file identifiers to journal '/QSYS.LIB/MYLIB.LIB/JRNLA.JRN'. Only the after images of updated records are written to the journal.

STRJRN OBJ(('/QSYS.LIB/MYLIB.LIB/MYDATA*.DTAQ')) JRN('/QSYS.LIB/MYLIB.LIB/MYJRN.JRN')

Start Journaling on a Set of Data Queues. This command starts the journaling of all changes to the objects of type *DTAQ in library MYLIB that begin with the characters 'MYDATA'.

IBM command documentation

Generated from os/cl/catalog/STRJRN.json and os/cl/help/STRJRN.json.