Module 6: JCL Utilities
IEBCOMPR utility is used to:-
- Compare and locate data-differences between two sequential data sets
- Compare and locate data-differences between two partitioned data sets
If no difference found between two compared files, return code ‘0’ will be returned else return code ‘8’ will be returned. Comparison occurs at record level. The data sets being compared must have same record length and format (however block size can be different)
This utility is mostly used in case when we have to ensure accuracy of back-ups taken.
SYSIN must have following command to specify whether we are comparing between PS files or PDS files:-
data-set-type, should be ‘PS’ for sequential files and ‘PO’ for partitioned data set. Here, PS stands for Physical Sequential and PO stands for Partitioned Organization.
Comparing two sequential data sets
//STEPNAME EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=DEPT.FILE1,DISP=SHR //SYSUT2 DD DSN=DEPT.FILE1.BACKUP,DISP=SHR //SYSIN DD * COMPARE TYPORG=PS /* //
Comparing two partitioned data sets
//STEPNAME EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=ENDV.PROD.JCLLIB,DISP=SHR //SYSUT2 DD DSN=DEPT.BKUP.JCLLIB,DISP=SHR //SYSIN DD * COMPARE TYPORG=PO /* //