Thursday, March 6, 2008

Compare Spool files:

This method allows a user to compare two spooled files for differences. This is very handy when needing to compare test runs from before and after program changes to a particular program.
1. Create two physicals file in your library, as such:

CRTPF FILE(PHSLIB/PHSSPOOL1)
RCDLEN(132)
TEXT('physical file for compared spooled file #1')
SIZE(*NOMAX)

CRTPF FILE(PHSLIB/PHSSPOOL2)
RCDLEN(132)
TEXT('physical file for compared spooled file #2')
SIZE(*NOMAX)
2. Copy the two spooled files you want to compare to the files created above.

CPYSPLF FILE(TBLD_SRCG)
TOFILE(PHSLIB/PHSSPOOL1)
JOB(046095/PHILLIP/TBLDRV_SUR)
SPLNBR(1)
CPYSPLF FILE(TBLD_SRCG)
TOFILE(PHSLIB/PHSSPOOL2)
JOB(046250/PHILLIP/TBLDRV_SUR)
SPLNBR(1)
3. Now compare the two physical files as such. You can send the output to the screen immediately, or to a spooled file to look at. In this example, it is outputting to a spooled file. The results will give you the differences between the two.
CMPPFM NEWFILE(PHSLIB/PHSSPOOL2)
OLDFILE(PHSLIB/PHSSPOOL1)
OLDMBR(*FIRST)
RPTTYPE(*CHANGE)
OUTPUT(*PRINT)

1 comment:

Nisha said...

What sould be the Compare type value in Cmpfm command?