Comparing data sets

When you are using File Manager under ISPF, you can use the Compare Utility (option 3.11) to compare data from one data set with data in a second data set; when you are programming a batch job, REXX procedure or TSO clist, you can use the equivalent function, DSM (Data Set Compare). Typically, the first data set contains the original version of some data (the “Old” data set), and the second data set contains an updated version of the data (the “New” data set).

Note: The terms “Old” and “New” do not imply any significance in regard to the dates on which the data sets or templates were created or modified. Any data set or template can be specified as either “Old” or “New”.

Whether you are using the panel or the function, you can compare data without using templates, or by specifying a template to format either the “Old” data set (the “Old” template) or the “New” data set (the “New” template), or for both “Old” and “New” data sets, in order of increasing flexibility.

Record selection can be performed at the record level using the Start key, Skip count, and Compare count fields, or at the field level using conditional expressions defined in the template, or at a combination of both levels. The Start key (or slot) and Skip count fields are honored before field-level selection takes place. The Number of differences to report option allows you to limit the number of differences reported by the compare operation.

To perform field-level selection you must specify a template or copybook. If field-level selection is in effect, the compare count is not met until the specified number of records have been selected.

Note: The subset of data set records defined by the total of all record and field-level selection criteria is referred to as the “compare” set.

You can use the Compare Utility to:

  • Compare data from any supported data set to data in any other supported data set.
  • Select the records to be compared (the compare set), using the start key (VSAM only), skip and copy count fields, a conditional expression defined in a template, or a combination of all of these.
  • Perform a field-level comparison. By using an “Old” copybook or template with a “New” copybook or template you can compare selected fields, with the result of the comparison reflecting the types of data in the fields.
  • Restrict the number of differences reported with the Compare Utility option, Number of differences to report.
  • Create output data sets containing records identified as inserted, deleted, old and new changed records, and old and new matched records.
  • Perform load module comparison. Load module and CSECT information from both "Old" and "New" versions of the module is extracted and compared. By selecting from various compare criteria, you can see differences between specific attributes of load modules like load module size, link date, CSECT names, and compilers used.

The compare operation can be performed in the background (batch execution) or in the foreground.

With or without templates, you can compare records where the “Old” and “New” data sets have different:

  • Record formats
  • Record lengths
  • Block sizes