Performing a quick and inexpensive table comparison (z/OS®)

You can quickly compare a replication source and target table for consistency by performing a metrics-based comparison. This method is useful for rapid verification of a table copy after a data upgrade, batch process, or maintenance activity to verify data validity before using the copy for business.

About this task

Comparing the actual data is expensive for regular consistency checking, especially for huge tables. Not all tables require a frequent full-fledged table comparison.

When you use the asntdiff utility in metrics mode, it checks each block (a set of rows) to ensure that source and target tables have the same number of rows and the identical sum of numeric and datetime columns. If any mismatches are found, asntdiff performs a full data comparison on the corresponding blocks and reports any differences. This mode can be used with live or non-live mode.

The asntdiff utility must be running in parallel mode to perform a quick comparison. To start the comparison, you invoke asntdiff with the COMPARE_MODE=stats parameter. For each block, the utility compares the number of rows and the sum values of the datetime and numeric columns that you specify by using the SOURCE_STATS_COLUMNS parameter.

For a specific block, if the statistics values from the source and target do not match, the asntdiff utility compares the actual data and outputs the differences. Because this statistics-based mode does not compare the actual data, the detection could miss actual differences between the source and target data.

Procedure

To run a quick comparison, invoke asntdiff with JCL that is similar to the following example:
//ASNTDIF1 EXEC PGM=ASNTDIFF,PARM='/-F'
//STEPLIB  DD DSN=ASNQ!!0.SASNLOAD,DISP=SHR
//         DD DSN=DSN!!0.SDSNLOAD,DISP=SHR
//MSGS     DD PATH='/usr/lpp/db2repl_10_01/msg/En_US/db2asn.cat'
//CEEDUMP  DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSUDUMP DD  DUMMY
//SYSIN    DD   *
DB2_SUBSYSTEM=DB1A
SOURCE_SERVER=DB1A
SOURCE_TABLE="CDL.T0001"
SOURCE_STORED_PROC="ASN.TDIFF"
TARGET_SERVER=DB2A
TARGET_STORED_PROC="ASN.TDIFFT"
TARGET_TABLE="CDL.TT001"
PARALLEL=Y
COMPARE_MODE=stats
SOURCE_STATS_COLUMNS="ACTNO,EMPTIME,EMSTDATE,EMENDATE"