CMPJRNIMG (Compare Journal Images)

CMPJRNIMG Command syntax diagram

 

Purpose

The Compare Journal Images (CMPJRNIMG) command allows the user 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 and/or member (IMAGES(*BOTH) must be specified for the Start Journal Physical File (STRJRNPF) command), or (2) the after and previous after image 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:

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

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

  3. Only one member can be processed per command.

  4. 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).


  5. If the sequence number is reset in the range of receivers specified, the first occurrence of FROMENT or TOENT is used if the parameters are specified.

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

  7. 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 that had a RCVSIZOPT or FIXLENDTA option specified that omitted the collection of that data. >

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

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

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

 

Required Parameters

FILE
Specifies the qualified name of the physical database file for which the journaled record-level changes are compared.

The name of the physical file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list 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, the QGPL library is used.

library-name: Specify the name of the library to be searched.

physical-file-name: Specify the name of the physical file.

 

Optional Parameters

MBR
Specifies the name of the member in the file that has its journal entries compared.

*FIRST: The first member in the database file is used.

member-name: Specify the name of the member for which record-level changes are compared.

RCVRNG
Specifies the starting and ending journal receivers used in the comparison. The system starts the comparison with the starting journal receiver (specified by the first value) and proceeds through receivers until the ending journal receiver (specified by the last value) is processed. If dual receivers are used at any time, the first of the dual receivers is always used when chaining through the receivers.

If any problem (such as damaged receivers or receiver not found) occurs in the receiver chain before the comparison starts, the system tries to use the second of the dual receivers. If the second of the receivers is damaged or not found, or if a problem occurs during the operation, the comparison ends.

Note:If the maximum number of receivers in the range is exceeded (256), an exception is sent and no entries are compared.

Single Value

*CURRENT: The journal receiver that is currently attached when starting to compare journal entries is used.

Element 1: Starting Journal Receiver

The name of the journal receiver can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list 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, the QGPL library is used.

library-name: Specify the name of the library to be searched.

starting-journal-receiver: Specify the name of the first journal receiver that contains the journal entries that are compared.

Element 2: Ending Journal Receiver

*CURRENT: The journal receiver that is currently attached when starting to compare journal entries is used.

The name of the journal receiver can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list 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, the QGPL library is used.

library-name: Specify the name of the library to be searched.

ending-journal-receiver: Specify the name of the last journal receiver that contains the journal entries to be compared.

FROMENT
Specifies the first journal entry to be compared.

*FIRST: The first journal entry in the journal receiver range specified is the first entry considered for the comparison.

starting-sequence-number: Specify the sequence number at which the comparison begins.

FROMTIME
Specifies the date and time of the first journal entry to be compared. The journal entry with the specified date and time or the next later journal entry is the starting point for the comparison.

Element 1: Date When Comparison Starts

starting-date: Specify the date on which comparison of the first entry starts.

Element 2: Time When Comparison Starts

starting-time: Specify the time at which comparison of the first entry starts. The time is specified in 24-hour format with or without a time separator as follows:

  • With a time separator, specify a string of 5 or 8 digits, where the time separator for the job separates the hours, minutes, and seconds. If you issue 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 fails.

  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.

TOENT
Specifies the last entry considered for the comparison.

*LAST: The last journal entry in the journal receivers specified is the final entry compared.

ending-sequence-number: Specify the sequence number of the last journal entry to be compared.

Note:The values specified for the FROM and TO parameters can be the same (for example, FROMENT(234) and TOENT(234) can be specified).

TOTIME
Specifies the date and time of the last journal entry to be compared. The journal entry with the specified date and time or the latest earlier journal entry is the ending point for the comparison of journal entries.

Element 1: Date When Comparison Ends

ending-date: Specify the date on which the comparison ends.

Element 2: Time When Comparison Ends

ending-time: Specify the time at which the comparison ends. The time is specified in 24-hour format with or without a time separator as follows:

  • With a time separator, specify a string of 5 or 8 digits, where the time separator for the job separates the hours, minutes, and seconds. If you issue 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 fails.

  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.

CMPOPT
Specifies the type of record images that are compared for record-level changes in the specified file.

*BOTH: The before-images of the journal entries are compared with the after-images of the journal entries.

*AFTER: The after-images of the record (specified in the RCDNBR parameter) are compared with previous after-images.

Note: If this value is specified, (1) the default value *ALL must be specified on the JOB, PGM, USRPRF, and CMTCYCID parameters and (2) a relative record number must be specified on the RCDNBR parameter.

RCDNBR
Specifies the relative record number in the file for which the journal entry images are compared.

*ALL: The journaled changes for all records in the physical member are compared.

relative-record-number: Specify the relative record number in the physical member for which images are compared. If a value is specified, only changes for the specified record are compared.

JOB
Specifies that the comparison is of journal entries for a particular job.

A job identifier is either the special value *ALL or a qualified name with up to three elements. For example:

*ALL
job-name
user-name/job-name
job-number/user-name/job-name

More information on this parameter is in Commonly used parameters.

*ALL: The comparison is not limited to entries for a particular job.

job-name: Specify the name of the job whose journaled changes are considered for comparison.

user-name: Specify the name of the user of the job whose journaled changes are considered for comparison.

job-number: Specify the number of the job whose journaled changes are considered for comparison.

PGM
Specifies that the comparison is of journal entries for a particular program.

*ALL: The comparison is not limited to entries for a particular program.

program-name: Specify the name of the program whose record-level changes are to be considered for comparison. Only changes journaled for this program are considered for comparison.

USRPRF
Specifies that the comparison is of journal entries for a particular user profile name. The user profile name is the user profile under which the job is run that causes the entries to be journaled.

*ALL: The comparison is not limited to entries for a particular user profile.

user-name: Specify the name of the user profile that has journaled changes to be compared. Only journaled changes for this user profile are to be considered for comparison.

CMTCYCID
Specifies the commit cycle identifier of the specific journal that participated in a logical unit of work for which a comparison of journal entries is made.

*ALL: The journal entries for all commit cycle identifiers are included in the comparison.

commit-cycle-identifier: Specify the identifier for the commit cycle whose journaled changes are to be considered for comparison. A journal entry's commit cycle identifier can be found by using the Display Journal (DSPJRN) command and selecting option five.

OUTFMT
Specifies the format in which the objects are shown.

*CHAR: The record images are shown in character format.

*HEX: The record images are shown in hexadecimal format.

Examples for CMPJRNIMG

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.

Error messages for CMPJRNIMG

*ESCAPE Messages

CPF7002
File &1 in library &2 not a physical file.
CPF7006
Member &3 not found in file &1 in &2.
CPF701B
Journal recovery of an interrupted operation failed.
CPF7027
Operation cannot be performed beyond entry &1.
CPF7028
Member &3 file &1 in &2 never journaled.
CPF7029
Image comparison failed. Ending sequence number &1.
CPF7036
File &1 in &2 not journaled with before images.
CPF7038
No entries compared for member &3.
CPF705A
Operation failed due to remote journal.
CPF7053
Values for RCVRNG parameter not correct; reason code &1.
CPF7054
FROM and TO values not valid.
CPF709C
JOB, PGM, and USRPRF not valid for receiver range.
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.
CPF9812
File &1 in library &2 not found.
CPF9815
Member &5 file &2 in library &3 not found.
CPF9820
Not authorized to use library &1.
CPF9822
Not authorized to file &1 in library &2.
CPF9845
Error occurred while opening file &1.
CPF9846
Error while processing file &1 in library &2.
CPF9850
Override of printer file &1 not allowed.