SYNCKEY supports the following parameters:
Use old-field-name when referencing a data field that is defined in the record's layout. The layout must be available to the job step. For more information on how to make the record's layout available, see the keyword LAYOUTFILE.
Note: When this parameter is supplied, the keyword's oldfile-position and length, are retrieved from the old-field-name definition.
Specifies the starting field position in the OLDFILE record to compare. Valid choices are the following:
The actual position number
Specifies the length of the data to compare. If 0, the SYNCKEY is from the position parameters to the end of the records. Valid values are 0 - 32760.
Use new-field-name when referencing a data field that is defined in the NEW file’s record layout. The layout must be available to the job step. For more information on how to make the NEW record's layout available, see the keyword LAYOUTFILEN.
Specifies the optional starting position in the NEWFILE record to compare. If this is omitted, the oldfile-position is used for the newfile-postion. Valid choices are the following:
The actual position number
Specifies a non-keyed compare. The data identified by the SYNCKEY positions is used to synchronize records within the old and new files. NOKEY is the default.
Specifies a keyed compare. The positions specified are treated as keys in ascending order to synchronize records.
Specifies a keyed compare. The positions specified are treated as keys in descending order to synchronize records.
SYNCKEY values are not printed in the COMPARE report. NOPRINT is the default with the NOKEY parameter.
SYNCKEY values are printed for each record in the COMPARE report. PRINT is the default when the ASCENDING or DESCENDING parameter is used.
This example syntax uses the first five positions of the old file and the positions 20 – 24 of the new files as the SYNCKEY value for the COMPARE command. These bytes are used to synchronize the two files. The POSITION keywords are used to compare only the positions that are defined by them.
COMPARE, SYNCKEY(1,5,20), POS(6,15,6), POS(25,0,25)
The same results can be obtained using the old-field-name parameter. In this case the position of the CUST-KEY must be the same in both the old and new files.
COMPARE , LAYOUTFILE(LAYOUT), SYNCKEY(CUST-KEY), POS(6,15,6), POS(25,0,25)
In this example a keyed comparison of the old and new files is performed using the data found in field CUST-KEY of both files as an ascending key, and the data in positions 20 through 22 of the old file with positions 26 through 28 of the newfile as a descending key. The keys are printed for each record in the report.
COMPARE, LAYOUTFILE(LAYOUT), SYNCKEY(CUST-KEY,ASC,PRINT), SYNCKEY(20,03,26,DESC,PRINT)
In this example a descending key comparison of the old and new files is performed. The position for CUST_KEY in the OLD file is found in the copybook referenced by LAYOUT. The position for NEW_CUST_KEY in the NEW file is found in the copybook referenced by LAYOUTN. The length will be determined by CUST_KEY in the OLD file.
COMPARE, LAYOUTFILE(LAYOUT), LAYOUTFILEN(LAYOUTN), SYNCKEY(CUST-KEY,NEW_CUST_KEY,DESC,PRINT)
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|