Comparing data sets

When you are using Z Data Tools 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:

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: