Start Journal Object (STRJRNOBJ)

The Start Journal Object (STRJRNOBJ) 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) and Data Queues (*DTAQ). For more information about 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".

Additionally, 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:

Restrictions:

Parameters

Keyword Description Choices Notes
OBJ Object Values (up to 300 repetitions): Qualified object name Required, Positional 1
Qualifier 1: Object Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB
OBJTYPE Object type *DTAARA, *DTAQ Required, Positional 2
JRN Journal Qualified object name Required, Positional 3
Qualifier 1: Journal Name
Qualifier 2: Library Name, *LIBL, *CURLIB
IMAGES Images *AFTER, *BOTH Optional
LOGLVL Logging level *ERRORS, *ALL Optional

Object (OBJ)

Specifies a maximum of 300 qualified object names for which changes are to be journaled.

This is a required parameter.

Qualifier 1: Object

*ALL
All objects of the specified type in the specified library will have their changes written to the journal.
generic-name
Specify the generic name of the object for which changes are to be journaled. A generic name is a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, all objects of the specified object type that have names with the same prefix as the generic name will have their changes journaled.
object-name
Specify the name of the object for which changes are to be journaled.

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.

Object type (OBJTYPE)

Specifies the object type for which changes are to be journaled.

This is a required parameter.

*DTAARA
Changes for data area objects are to be journaled.
*DTAQ
Changes for data queue objects are to be journaled.

Journal (JRN)

Specifies the journal that receives the journaled changes.

This is a required parameter.

Qualifier 1: Journal

journal-name
Specify the name of the journal that receives the journaled changes.

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.

Images (IMAGES)

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

*AFTER
Only after images are generated for changes to objects.
*BOTH
The system generates both before and after images to the journal for changes to objects.

Note: The value *BOTH is only valid for *DTAARA objects.

Logging level (LOGLVL)

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

*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

STRJRNOBJ   OBJ(DTALIB/MYDTAARA)  OBJTYPE(*DTAARA)
            JRN(MYLIB/JRNLA)

This command journals all changes to data area MYDTAARA in library DTALIB to journal JRNLA in library MYLIB. Only the after images of updates are written to the journal.

Error messages

*ESCAPE Messages

CPF6979
Journal &1 in library &2 is unusable.
CPF700A
&1 of &2 objects have started journaling.
CPF705A
Operation failed due to remote journal.
CPF7057
*LIBL not allowed with *ALL or *ALLLIB or a generic name.
CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF9810
Library &1 not found.
CPF9820
Not authorized to use library &1.
CPF9825
Not authorized to device &1.
CPF9830
Cannot assign library &1.
CPF9873
ASP status is preventing access to object.
CPF9875
Resources exceeded on ASP &1. Press HELP.