IEBCOMPR (Compare Data Sets) Program
- The data sets contain the same number of records.
- Corresponding records and keys are identical.
- Corresponding members contain the same number of records.
- Note lists are in the same position within corresponding members.
- Corresponding records and keys are identical.
- Corresponding directory user data fields are identical.
If all these conditions are not met for a specific type of data set, those data sets are considered unequal. If records are unequal, the record and block numbers, the names of the DD statements that define the data sets, and the unequal records are listed in a message data set. Ten successive unequal comparisons stop the job step, unless you provide a routine for handling error conditions.
Load module partitioned data sets that reside on different types of devices should not be compared. Under most circumstances, the data sets will not compare as equal.
Partitioned data sets or PDSEs can be compared only if all the names in one or both of the directories have counterpart entries in the other directory. The comparison is made on members that are identified by these entries and corresponding user data.
Figure 1 shows the directories of two partitioned data sets. Directory 2 contains corresponding entries for all the names in Directory 1; therefore, the data sets can be compared.

Figure 2 shows the directories of two partitioned data sets. Each directory contains a name that has no corresponding entry in the other directory; therefore, the data sets cannot be compared, and the job step will be ended.

User exits are provided for optional user routines to process user labels, handle error conditions, and modify source records.
If IEBCOMPR is invoked from an application program or TSO, you can dynamically allocate the data sets by calling dynamic allocation (SVC 99) or the TSO ALLOCATE command before calling IEBCOMPR.
Related reading: For information about the linkage conventions for user routines, see Specifying User Exits with Utility Programs.