Previous Topic: Keywords

Next Topic: COPY

COMPARE Program Report

The report generated by COMPARE PROGRAM consists of the following three parts:

For more information on Binder, how it structures programs and the meaning of the reported fields, refer to IBM publication “MVS Program Management: Advanced Facilities.”

Global Program Information

The global program information at the beginning of the report shows the results of the comparison of the global program properties.

Program information

Identifies the program's total size and link date as follows:

TOTALSIZE–Identifies the report size as an 8-byte hexadecimal value

LINKDATE–Identifies the report date in YYYY.DDD format and the time in 24-hour hh:mm:ss format

Note: The time may not be available for old load modules

ENTRYPOINT

Identifies the entry point name, the section in which it is located, and the hexadecimal offset within that section.

Note: With CSECTCOMPARE(BYNAME), the section name is reported. With CSECTCOMPARE(BYORDER), the section number is reported. For more information about the CSECTCOMPARE keyword, see COMPARE Command Keywords Summary.

Attributes

Identifies the following program attributes:

RENT or NORENT–Reentrancy

REUS or NOREUS–Usability

REFR or NOREFR–Refreshability

AMODE–Addressing mode

RMODE–Residence mode

AC–Authorization code

SSI–System status index

Section Information

The section information contains details about the compare results for each section in the program. The following list describes the sample text from the compare report.

+++++++++ Section <name>

Marks the start of the section

CSECTNAME <name>

Identifies the section name

CSECTSIZE <size>

Shows the section size as an 8-byte hexadecimal value

TRANSLATOR <id>

Shows the identification of the translator or compiler

CSECTDATE <date>

Shows the date on which the section was generated in YYYY.DDD format

Binder class <class_name>

Identifies the name of the binder class

Note: Each of the binder classes that contain data has a section in the report identifying the name of the binder class followed by the results of the comparison of the binder class data.

Summary Information

The summary information provides the following global statistics on the compare:

COMPARE Examples

Example 1

Demonstrates how COMPARE produces a report formatting the data as defined by the copybook member, CUSTNAME, in the LAYOUTFILE keyword. All fields are printed and fields that mismatch are flagged. Each record is formatted separately.

COMPARE,
  LAYOUTFILE(CUSTOMER.COPYBOOK(CUSTNAME)),
  FORMAT(S),
  COMPREPORT(A),
  FIELDDISPLAY(A)

Compare Report Old File CUSTOMER.OLDFILE Rec Length = 80 New File CUSTOMER.NEWFILE Rec Length = 80 Match Old Rec #1 New Rec #1 Pos *----------FIELD NAME-------------* FORMAT *---+----1----+----2----+----3----+----4 *---+----1----+----2----+----3----+----4 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 Intl Widget 21 03 COMPANY-ADDRESS C 30 534 Commerce Way 51 03 COMPANY-CITY C 10 Denver 61 03 COMPANY-STATE-CODE C 2 CO 63 03 FILLER C 18 Change Old Rec #2 New Rec #2 Pos *----------FIELD NAME-------------* FORMAT *---+----1----+----2----+----3----+----4 *---+----1----+----2----+----3----+----4 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 Acme Widgets 21> 03 COMPANY-ADDRESS C 30 974 EZ Street 1627 Helen Ave. 51> 03 COMPANY-CITY C 10 Miami Jupiter 61 03 COMPANY-STATE-CODE C 2 FL 63 03 FILLER C 18 Delete Old Rec #3 Pos *----------FIELD NAME-------------* FORMAT *---+----1----+----2----+----3----+----4 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 Best Widgets 21 03 COMPANY-ADDRESS C 30 2424 Highland Dr. 51 03 COMPANY-CITY C 10 Boise 61 03 COMPANY-STATE-CODE C 2 ID 63 03 FILLER C 18 Match Old Rec #4 New Rec #3 Pos *----------FIELD NAME-------------* FORMAT *---+----1----+----2----+----3----+----4 *---+----1----+----2----+----3----+----4 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 CT Widgets 21 03 COMPANY-ADDRESS C 30 8021 Hartford Blvd 51 03 COMPANY-CITY C 10 Farmington 61 03 COMPANY-STATE-CODE C 2 CT 63 03 FILLER C 18 Insert New Rec #4 Pos *----------FIELD NAME-------------* FORMAT *---+----1----+----2----+----3----+----4 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 MA Widgets Co. 21 03 COMPANY-ADDRESS C 30 981 Springfield Blvd 51 03 COMPANY-CITY C 10 Chicopee 61 03 COMPANY-STATE-CODE C 2 MA 63 03 FILLER C 18 S U M M A R Y R E P O R T Old Records Read 4 New Records Read 4 Records Matched 2 Records Changed 1 Records Inserted 1 Records Deleted 1 The following files are compared: DDNAME DSN OLD => SYSUT1 CUSTOMER.OLDFILE NEW => SYSUT1C CUSTOMER.NEWFILE All records on OLD and NEW files are reported with mismatches identified. Record display is single record formatted with line(s) for each field. All fields in the record are displayed.

Example 2

The ability to define an implied key for a sequential file is demonstrated in the following example syntax. The implied key is treated like an actual key by the COMPARE command. COMPARE will treat columns 72 through 80 as a key field for both the old and new file.

COMPARE,
  OLDFILE(OLDSRC),
  NEWFILE(NEWSRC),                        
  SYNCKEY(72,8,72,ASCENDING)                   

Example 3

The ability to compare certain record positions to either the record position of the NEWFILE or a particular data type is demonstrated in this example. In this case, record positions 23 – 27 of the OLDFILE are compared to the record positions 35 – 39 of the NEWFILE. Also, record positions 54 and 55 of the OLDFILE are compared to the character string, 'CT'. These POSITION keywords alone determine the outcome of the COMPARE command.

COMPARE,
  OLDFILE(OLDMSTR),
  NEWFILE(NEWMSTR),                        
  POSITION(23,5,35),
  POSITION(54,C'CT')                   

Example 4

This example illustrates how to use the POSITION keyword with the COMPARE command to eliminate specific record positions from the comparison, by excluding them from the comparison.

No record positions greater than 72 are compared in this example. Setting an end position eliminates any erroneous mismatches from being reported, caused by any line numbering differences in those positions. This can be used with JCL and Assembler members.

COMPARE,
  OLDFILE(OJCL),
  NEWFILE(NJCL),
  POSITION(1,72)

Use the next example when comparing COBOL members. It only compares positions 7 to the end of the record.

COMPARE,
  OLDFILE(OCOBOL),
  NEWFILE(NCOBOL),
  POSITION(7,0)

Example 5

Using the SELRECIF keyword in the following example lets you select or eliminate records for processing. Any record that contains either the character string 'DATE:' or 'TIME:' in the first five positions of OLDFILE is not selected for further processing.

COMPARE,
  OLDFILE(OLDRPT),
  NEWFILE(NEWRPT),  
  SELRECIF(1,5,NE,C'DATE:'), 
  AND(1,5,NE,C'TIME:')

Example 6

The ability to compare specific record positions depending on the data found at a NEWFILE's record location is demonstrated in the following example. If record positions 65 and 66 are equal to the character string 'CT', then only the OLDFILE's record positions 76 – 78 are compared to the same record positions in the NEWFILE. Otherwise, the entire record is compared.

COMPARE,
  OLDFILE(OLDMSTR),
  NEWFILE(NEWMSTR), 
  IF(65,2,EQ,C'CT'),
    POSITION(76,3)     

Example 7

When comparing PDS members, specify the PDS members through the JCL parameter DSN, or by using the NEWFILE and OLDFILE keywords. The following example uses the JCL parameter DSN to reference the members to be compared.

//STEPLIB   DD   DSN=FM41.CAILIB,DISP=SHR
//SYSPRINT  DD   SYSOUT=*
//SYSLIST   DD   SYSOUT=*
//SYSUT1    DD   DSN=MY.OLDFILE.PDS(MEMBER),DISP=SHR
//SYSUT1N   DD   DSN=MY.NEWFILE.PDS(MEMBER),DISP=SHR
//SYSIN     DD   *
  COMPARE
/*

The previous example compares the members named member in MY.OLDFILE.PDS to the one in MY.NEWFILE.PDS.

Example 8

The ability to write compared records to a sequential file based on their COMPARE results follows. Records that are identified as being INSERTED are written to the sequential file referenced by the ddname DDINSERT; DELETED records are written to DDDELETE, and MATCHED records are written to DDMATCH. For records identified as being CHANGED, only the newfile's changed records are written to the ddname DDCHANGE.

COMPARE,
  OLDFILE(OLDSRC),
  NEWFILE(NEWSRC), 
  INSERTED(DDINSERT),
  DELETED(DDDELETE),
  CHANGED(DDCHANGE,NEW),
  MATCHED(DDMATCH)

Example 9

This example illustrates how to compare programs.

All parameters use default values, so all program properties are included in the comparison.

COMPARE PROGRAM,
  OLDFILE(OLDPROG),
  NEWFILE(NEWPROG)

Example 10

This example illustrates how to use the CSECTINCLUDE and CSECTEXCLUDE parameters when comparing programs.

Only CSECTs that match the specifications in CSECTINCLUDE and do not match the specifications in CSECTEXCLUDE are compared.

COMPARE PROGRAM,
  OLDFILE(OLDPROG),
  NEWFILE(NEWPROG),
  CSECTINCLUDE(CAWAC*,I*-R*),
  CSECTEXCLUDE(ISPDCOD*,L*,PP-P9)

Example 11

This example illustrates how to use the PROPERTIESINCLUDE and PROPERTIESEXCLUDE parameters when comparing programs.

To compare all program properties except selected ones, use the PROPERTIESEXCLUDE parameter.

COMPARE PROGRAM,
  CSECTCOMPARE(BYNAME),
  CSECTINCLUDE(CAWAUR-CAWAUZT),
  PROPEXC(CONTENT,IDRUSER,IDRZAP),
  OLDFILE(OLDPROG),
  NEWFILE(NEWPROG),
  LINEPAGE(9999),
  FORMAT(C),
  COMPREPORT(A)

Input SYSIN parameters to batch process are displayed below COMPARE PROGRAM, CSECTCOMPARE(BYNAME), CSECTINCLUDE(CAWAUR-CAWAUZT), PROPEXC(CONTENT,IDRUSER,IDRZAP), OLDFILE(OLDPROG), NEWFILE(NEWPROG), LINEPAGE(9999), FORMAT(C), COMPREPORT(A) *** CAWA2100I DDNAME OLDPROG opened for DSN=CAIPROD.FILEMSTR.R85S0A.CDBILOAD(CAWABATC) File is NonVSAM LRECL=0,BLKSIZE=6144,RECFM=U,Mode=PS *** CAWA2100I DDNAME NEWPROG opened for DSN=TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWABATC) File is NonVSAM LRECL=0,BLKSIZE=27998,RECFM=U,Mode=PS Compare Report Old File CAIPROD.FILEMSTR.R85S0A.CDBILOAD(CAWABATC) New File TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWABATC) Change Program Info: TOTALSIZE 00002248 LINKDATE 2010.179 at 14:08:38 Program Info: TOTALSIZE 00002248 LINKDATE 2011.293 at 21:50:36 * *** ** ** * Match ENTRYPOINT CAWABATC in section CAWABATC + 00000000 Match Attributes: RENT REUS NOREFR AMODE(31) RMODE(31) AC(0) SSI(0120302F) +++++++++ Section CAWAURPT Match CSECTNAME CAWAURPT Change CSECTSIZE 000002A0 TRANSLATOR 569623400 CSECTDATE 2010.006 CSECTSIZE 000002A0 TRANSLATOR 569623400 CSECTDATE 2011.293 * *** ... Binder class B_ESD Match Symbol: CAWAURPT Type: SD(SD) Name_space: 00 Scope: Signature: Class: Align: 00 Symbol_attr: 00 Load_flags: 00 Record_format: 0000 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 00 Segment: 0001 Length: 00000000 Amode: 31 Usability: 00 Bind_cntl: 00 Region: 0001 Priority: 00000000 Rmode: LE_attr: 00 Status: 00 Match Symbol: B_TEXT Type: ED Name_space: 01 Scope: Signature: Class: B_TEXT Align: 03 Symbol_attr: 00 Load_flags: 00 Record_format: 0001 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 00 Segment: 0000 Length: 000002A0 Amode: Usability: 00 Bind_cntl: 00 Region: 0000 Priority: 00000000 Rmode: ANY LE_attr: 00 Status: 00 Match Symbol: CAWAURPT Type: LD(LD) Name_space: 01 Scope: M Signature: Class: B_TEXT Align: 00 Symbol_attr: 80 Load_flags: 00 Record_format: 0000 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 80 Segment: 0000 Length: 00000000 Amode: 31 Usability: 00 Bind_cntl: 00 Region: 0000 Priority: 00000000 Rmode: LE_attr: 00 Status: 00 +++++++++ Section CAWAUTOT Match CSECTNAME CAWAUTOT Change CSECTSIZE 000002B0 TRANSLATOR 569623400 CSECTDATE 2010.006 CSECTSIZE 000002B0 TRANSLATOR 569623400 CSECTDATE 2011.293 * *** ... Binder class B_ESD Match Symbol: CAWAUTOT Type: SD(SD) Name_space: 00 Scope: Signature: Class: Align: 00 Symbol_attr: 00 Load_flags: 00 Record_format: 0000 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 00 Segment: 0001 Length: 00000000 Amode: 31 Usability: 00 Bind_cntl: 00 Region: 0001 Priority: 00000000 Rmode: LE_attr: 00 Status: 00 Match Symbol: B_TEXT Type: ED Name_space: 01 Scope: Signature: Class: B_TEXT Align: 03 Symbol_attr: 00 Load_flags: 00 Record_format: 0001 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 00 Segment: 0000 Length: 000002B0 Amode: Usability: 00 Bind_cntl: 00 Region: 0000 Priority: 00000000 Rmode: ANY LE_attr: 00 Status: 00 Match Symbol: CAWAUTOT Type: LD(LD) Name_space: 01 Scope: M Signature: Class: B_TEXT Align: 00 Symbol_attr: 80 Load_flags: 00 Record_format: 0000 Elem_offset: 00000000 Autocall: 00 Fill: 00 Bind_flags: 80 Segment: 0000 Length: 00000000 Amode: 31 Usability: 00 Bind_cntl: 00 Region: 0000 Priority: 00000000 Rmode: LE_attr: 00 Status: 00 S U M M A R Y R E P O R T Old Records Processed 13 Old Sections Processed 2 New Records Processed 13 New Sections Processed 2 Records Matched 10 Sections Matched 0 Records Changed 3 Sections Changed 2 Records Inserted 0 Sections Inserted 0 Records Deleted 0 Sections Deleted 0 The following files are compared: DDNAME DSN OLD => OLDPROG CAIPROD.FILEMSTR.R85S0A.CDBILOAD(CAWABATC) NEW => NEWPROG TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWABATC) All records on OLD and NEW files are reported with mismatches identified. Records are displayed in character format. For changed records, only lines that contain differences are displayed. *** CAWA2536I OLDPROG and NEWPROG files do not match - Return Code set to 4 *** CAWA2550I COMPARE completed RC set to 4 High RC = 4 CAWA2001I SYSLIST output was directed to SYSPRINT CAWA2000I Utility ending, Max CC=4

To compare only selected program properties, use the PROPERTIESINCLUDE parameter.

COMPARE PROGRAM,
  CSECTCOMPARE(BYNAME),
  PROPINC(CONTENT,IDRUSER,IDRZAP),
  OLDFILE(OLDPROG),
  NEWFILE(NEWPROG),
  LINEPAGE(9999),
  FORMAT(C),
  COMPREPORT(M)

Input SYSIN parameters to batch process are displayed below COMPARE PROGRAM, CSECTCOMPARE(BYNAME), PROPINC(CONTENT,IDRUSER,IDRZAP), OLDFILE(OLDPROG), NEWFILE(NEWPROG), LINEPAGE(9999), FORMAT(C), COMPREPORT(M) *** CAWA2100I DDNAME OLDPROG opened for DSN=AD1DEV.FMMVS.CHLOG.FORCE.LOADLIB(CAWAOPTS) File is NonVSAM LRECL=0,BLKSIZE=27998,RECFM=U,Mode=PS *** CAWA2100I DDNAME NEWPROG opened for DSN=TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWAOPTS) File is NonVSAM LRECL=0,BLKSIZE=27998,RECFM=U,Mode=PS Compare Report Old File AD1DEV.FMMVS.CHLOG.FORCE.LOADLIB(CAWAOPTS) New File TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWAOPTS) +++++++++ Section CAWAOPTS ... Binder class B_TEXT Change +000000: 0000009B D4D6C47E 40404040 40404040 40D9C5D3 7EF94BF0 404040F0 F861F0F4 *....MOD= REL=9.0 08/04* +000000: 0000009B D4D6C47E 40404040 40404040 40D9C5D3 7EF94BF0 404040F1 F061F2F1 *....MOD= REL=9.0 10/21* * * * * ** ** Change +000020: 61F1F140 F0F84BF1 F940C3C1 40C68993 8540D481 A2A38599 40D793A4 A2404040 */11 08.19 CA File Master Plus * +000020: 61F1F140 F1F54BF5 F840C3C1 40C68993 8540D481 A2A38599 40D793A4 A2404040 */11 15.58 CA File Master Plus * * * * * ** ** Change +0001E0: 40404040 00000000 00000001 00000001 E86CE4C9 C4D7D9C5 C64BC6D4 D4E5E24B * ............Y%UIDPREF.FMMVS.* +0001E0: 40404040 00000000 00000000 00000000 D56CE4C9 C4D7D9C5 C64BC6D4 D4E5E24B * ............N%UIDPREF.FMMVS.* * * ** * ... Binder class B_IDRU Change +000000: F2F0F1F1 F2F1F600 0028F065 14962000 01459665 6C700030 660565E3 88000189 *2011216...0..o....o.%......Th..i* +000000: F2F0F1F1 F2F9F400 0028F065 14962000 00206214 00000030 660565E3 88000189 *2011294...0..o.............Th..i* * * ******* *** ** * * Change +000020: 45C75000 04165000 00003101 06C33316 D8F04040 40404040 40404040 40404040 *.G&...&......C..Q0 * +000020: 45C75000 17644000 00003201 02C61717 26F04040 40404040 40404040 40404040 *.G&... ......F...0 * ***** * * *** * ** * * * ... Binder class B_IDRZ Delete IDRZAP data RO123456 Date applied 2011.224 S U M M A R Y R E P O R T Old Records Processed 22 Old Sections Processed 1 New Records Processed 21 New Sections Processed 1 Records Matched 16 Sections Matched 0 Records Changed 5 Sections Changed 1 Records Inserted 0 Sections Inserted 0 Records Deleted 1 Sections Deleted 0 The following files are compared: DDNAME DSN OLD => OLDPROG AD1DEV.FMMVS.CHLOG.FORCE.LOADLIB(CAWAOPTS) NEW => NEWPROG TFM.MOTM.FMMVS.BASE.P2.LOADLIB(CAWAOPTS) Mismatched records (inserts, deletes, and changes) are reported. Records are displayed in character format. For changed records, only lines that contain differences are displayed. *** CAWA2536I OLDPROG and NEWPROG files do not match - Return Code set to 4 *** CAWA2550I COMPARE completed RC set to 4 High RC = 4 CAWA2001I SYSLIST output was directed to SYSPRINT CAWA2000I Utility ending, Max CC=4