IEBCOMPR

IEBCOMPR

  • IEBCOMPR is used to compare a PS, PDS, PDSE dataset

  • It is useful for verifying the backups are done correctly

  • PS datasets are considered equal if the dataset contain the same number of records and the corresponding records are identical

  • PDS, PDSE datasets are considered equal if both contain same number of members, the same number of records and the corresponding records are identical

  • The data sets being compared must have same record length and format

  • Return code 0 if the files are identical

  • Return code 8 if the files are not identical

EXAMPLE:

Comparing two sequential data sets:

//IEBCOMPR JOB (12345),CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBCOMPR 
//SYSUT1 DD DSN=T12345.FILE1.PS, DISP=SHR 
//SYSUT2 DD DSN=T12345.FILE2.PS.DISP=SHR 
//SYSPRINT DD SYSOUT=* 
//SYSOUT DD SYSOUT=* 
//SYSIN DD * 
   COMPARE TYPORG=PS 
/* 
//

Explanation:

EXEC Statement:

  • Executes the IEBCOMPR program, which compares two datasets.

DD Statements:

  • SYSUT1 DD:

    • DSN=T12345.FILE1.PS: Name of the first dataset to compare.

    SYSUT2 DD:

    • DSN=T12345.FILE2.PS: Name of the second dataset to compare.

  • SYSIN DD:

    • COMPARE TYPORG=PS: Specifies the comparison type as PS (physical sequential dataset).

    • If COMPARE TYPORG=PO: Then it specifies the comparison type is PO (partitioned data sets)

If no difference found in SYSUT1 and SYSUT2 then return code is 0 if difference is found then return code is 8

Last updated

Was this helpful?