Compare two data sets

With ZOAU, you can compare two data sets and print the results to stdout with any of the following ways:

  • Issuing a shell command:

    If the files are the same, the return code is zero. If the files are different, the return code is non-zero.

    • Option 1:
    ddiff "${prefix}.my.diff(fileone)" "${prefix}.my.diff(filetwo)"
    
    • Option 2:
    args='LINECMP,LOCS,LONGLN,NOPRTCC,NOSUMS,DELTAL'
    mvscmd --pgm=ISRSUPC --args="${args}" --sysin=dummy --sysprint=* --olddd="${prefix}.my.diff(fileone)" --newdd="${prefix}.my.diff(filetwo)"
    
  • Calling an API in Python programs:

    datasets.compare("%s.my.diff(fileone)" % HLQ, "%s.my.diff(filetwo)" % HLQ)
    

Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:

//*
//* Compare the PDSE members FILEONE and FILETWO from
//* the PDSE @@HLQ@@.ZOASAMP.MY.DIFF.
//* and write the results to OUTDD.
//* Return code from step is 0 if they are the same,
//* non-zero if different
//*
//DDIFF EXEC PGM=ISRSUPC,                                             +
//      PARM='LINECMP,LOCS,LONGLN,NOPRTCC,NOSUMS,DELTAL'
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//OLDDD  DD DSN=@@HLQ@@.ZOASAMP.MY.DIFF(FILEONE),DISP=SHR
//NEWDD  DD DSN=@@HLQ@@.ZOASAMP.MY.DIFF(FILETWO),DISP=SHR
//OUTDD  DD SYSOUT=*