CL Command Reference - CMPJRNIMG

CL Command List > CMPJRNIMG Reference

Description:

The Compare Journal Images (CMPJRNIMG) command gives you the capability to compare and note the differences between (1) the before and after images of record-level changes (updates, deletes, rollback-updates, and rollback-deletes) for a specific file member (IMAGES(*BOTH) must be specified for the Start Journal Physical File (STRJRNPF) command), or (2) the after and previous after images of a particular relative record (IMAGES(*AFTER) is specified for the STRJRNPF command). The output of the command is directed to a printer.

If before and after images are compared, the journaled changes can be compared for only one or all of the records in the specific file or member. The comparison can also be limited by a specific journal receiver range, or by a range of journal entries in a specific journal receiver range.

The printed output shows the record image before the change was made, followed by the record image after the change, followed by a line that indicates (with asterisks) the specific change in the record on a character-by-character basis, instead of on a field-by-field basis. If the journaled file has null-capable fields, the null value indicators that correspond to the before-image of the record are compared with the null value indicators that correspond to the after-image of the record. This is done on a field-by-field basis.

If there is no journal entry satisfying the search value specified, the command ends.

Restrictions:

. The result of the comparison is sent only to the system printer.

. The file and member specified must currently exist on the system and must have been journaled.

. Only one member can be processed per command.

. The comparison of journal images ends if one of the following conditions occurs:
每 The member was saved with storage freed.
每 The member was restored.
每 The member was cleared.
每 The member was initialized.
每 The member was reorganized.
每 The member was deleted.
每 The member was in use when the system ended abnormally.
每 Journaling the member was stopped.
每 The member had the journaled changes applied or removed (by the Apply Journaled Changes (APYJRNCHG) command or the Remove Journaled Changes (RMVJRNCHG) command).

. If the sequence number is reset in the range of receivers specified, the first occurrence of the FROMENT, FROMENTLRG, TOENT, or TOENTLRG value is used if the prompt is specified.

. The FROMENT, FROMENTLRG, and FROMTIME parameters are mutually exclusive, as are the TOENT, TOENTLRG, and TOTIME parameters.

. The JOB, PGM, and USRPRF parameters cannot be used to specify selection criteria 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.

. This command cannot be used on or with a remote journal.

. If this command is used to compare journal images for a file that contains any fields of data type BLOB (binary large object), CLOB (character large object), or DBCLOB (double-byte character large object), these fields are not included in the comparison. All other fields in the file are compared.

. This command cannot be used if one or more journal receivers in the specified range was attached to a journal that had MINENTDTA (minimize entry specific data) specified for *FILE objects.


Examples:

Example 1: Comparing Before-Images with After-Images

CMPJRNIMG FILE(QGPL/PF)

This command compares the journaled record-level changes for the first member of file PF in the QGPL library. The entries compared are in the journal receiver that is currently attached when the comparison begins, starting with the first entry and ending with the last entry. All entries with both before-images and after-images that satisfy the selection values are eligible to be compared. The before-images of the entries are compared with the after-images of the entries.



Example 2: Comparing After-Images with Previous After-Images

CMPJRNIMG FILE(MYLIB/PAYROLL) MBR(APRIL)
RCVRNG((RCVLIB/RCV3) (*CURRENT))
FROMENT(200) TOENT(500) CMPOPT(*AFTER)
RCDNBR(999) OUTFMT(*HEX)

This command compares the journaled record-level changes for the member named APRIL in file PAYROLL in MYLIB, beginning with receiver RCV3 in RCVLIB and ending with the journal receiver that is currently attached at the start of the comparison. The range of entries compared starts with entry 200 and ends with entry 500. Only the after-images and previous after-images are compared. The comparison is limited to record number 999. The output is printed in hexadecimal format.

Example 3: Specifying Journal Entry Date and Time

CMPJRNIMG FILE(USERLIB/MYFILE) MBR(*FIRST)
RCVRNG((RCV2) (USERLIB/RCV5))
FROMTIME(*7/04/87* 120000) TOENT(1000)

This command compares the journaled record-level changes for the first member of file MYFILE in USERLIB, beginning with receiver RCV2 in *LIBL and ending with receiver RCV5 in USERLIB. The date and time of the first journal entry to be compared is 7/4/87 12:00:00, and the ending record sequence number considered for the comparison is 1000.