Previous Topic: CommandsNext Topic: Syntax


COMPARE

Use the COMPARE command to identify differences between two sequential, VSAM, or partitioned data sets. If the data set is partitioned, you can use the MEMBER keyword to specify the members to compare. If you do not specify members, all members are compared. Use COMPARE PROGRAM to compare load modules or program objects.

You can use keywords to exclude records based on selection criteria, compare part of a record or the entire record, or compare records in a sequential file based on an implied key.

Use the OLDFILE and NEWFILE keywords to specify the ddnames of the files to be compared. If you omit these keywords, the installation defaults for OLDFILE and NEWFILE are SYSUT1 and SYSUT1N. These defaults may have been changed by the &BAT_OLDFILE and &BAT_NEWFILE installation options.

The default compare report prints the mismatched records from both the OLDFILE and the NEWFILE. Use keywords to format reports by using copybooks to map the data and to print records in character or hex mode. You can customize the report to print all records compared, only mismatched records, or a compare summary report. The compare report writes to the SYSLIST DD statement. If a SYSLIST statement is omitted, then the report is written to SYSPRINT.

Use the POSITION keyword to include specific record positions in the comparison

You can write records identified as CHANGED, DELETED, INSERTED, and MATCHED to their own output file. For example, you can generate a file that contains only the DELETED records.

Compare Program

You can specify FORMAT(INSTRUCTION) to compare the content of a program at the machine instruction (or disassembled) level.

The following rules apply to the COMPARE PROGRAM command: