Record synchronization

File Manager synchronizes records for comparison in several ways.

1. One-to-one
When you select this option, the compare sets are assumed to contain records in a corresponding sequence.

Non-matching records are regarded as changed records. No attempt is made to resynchronize the compare sets when non-matching records are encountered, and comparison proceeds with the next record from each compare set. Trailing records in the “New” compare set are regarded as unpaired insertions, and trailing records in the “Old” compare set are regarded as unpaired deletions.

2. Read-ahead
The data sets are assumed to contain roughly corresponding records.

Specification requirements

When read-ahead synchronization is requested, you specify a limit and a length for read-ahead synchronization processing.

The read-ahead synchronization limit controls how far ahead File Manager looks for matching records when a pair of non-matching records is found. You should try to specify a read-ahead limit a little larger than the maximum number of contiguous non-matching records you expect to be encountered in the data sets.

The read-ahead synchronization length determines how many contiguous matching records must be found for synchronization to be recognized. If you are comparing "data" records, where false matches due to blank records or other commonly repeated records are unlikely, you should specify a small read-ahead synchronization length, such as the default value of 1. If you are comparing "text" or "source" records, where false matches due to blank records or other commonly repeated records might be common, you should specify a read-ahead synchronization length greater than one.

How the records are synchronized

When non-matching records are encountered, File Manager attempts to resynchronize the data sets by looking ahead in each data set by up to the number of records specified by the read-ahead limit. If the resynchronization is successful then the non-matching records are regarded as some combination of paired and unpaired insertions and deletions, depending on where the resynchronization occurred. If the resynchronization fails, then all of the "old" and "new" records from the first mismatch up to the resynchronization limit are regarded as paired insertions and deletions.

Note: Read-ahead synchronization can only produce matched records and inserted/deleted records. By definition there cannot be changed records, so selecting the Highlight changes option will not highlight changes or produce a changed line.
3. Keyed
When you select this option, the compare sets are assumed to be sequenced by a key, which consists of one or more segments of the record (up to sixteen). When you press Enter to process this panel (after having made your selections for the remaining options) the Keyed Synchronization Settings panel is displayed, in which you must specify at least one key segment (and up to sixteen key segments). Any existing key segment information, such as that drawn from an intrinsically keyed data set, is displayed in the panel. You can edit or modify these details.

When you have not used a template, the following applies:

  • If your data set contains an intrinsic key, as in KSDS data sets, File Manager automatically attempts to use this key as the first (or only) segment in the synchronization key.
  • You can specify the location, length and data type of your key segments in the Keyed Synchronization Settings panel that is displayed after the Compare Options panel. If a data type is not explicitly specified, type AN is used.

When you define multiple key segments, each segment is checked in the specified key segment order. If an alphanumeric key field falls partly or wholly outside of a record so that the key is truncated, the key comparison is performed as though the key were padded with hex zeros or the pad character if the padding option is on. For other key types, any truncated key after the first record results in a sequence error as well as a truncation error.

If the keys do not match, records are read from the compare set with the lower ordered key until a matching or greater ordered key is found. Non-matching records with matching keys are regarded as changed records (tallied as paired changes in the comparison summary). Records with non-matching keys are regarded as unpaired insertions and deletions. Records with keys that are out of sequence are flagged with a plus sign (+) in the comparison report. Records with truncated keys are flagged with a minus sign (-) in the comparison report. Records with keys that are both out of sequence and truncated are flagged with an asterisk (*) in the comparison report.

If you opt to use intrinsic keys for both your “Old” and “New” data sets and there is a length mismatch, File Manager uses the shorter of the two keys as the segment length. If there is any other type or length mismatch between key segments defined for the “Old” and “New” data sets, the Keyed Synchronization Settings panel contains additional columns that indicate the conflict.

You can ignore the conflict and process the panel using the values shown for the “Old” data set, or you can edit the “Old” key segment information and then continue.

4. Read-ahead Keyed
The data sets are assumed to contain roughly corresponding records.

Specification requirements

When read-ahead keyed synchronization is requested you specify a limit and a length for read-ahead synchronization processing plus key fields, which will be used for the synchronization process. Therefore, unlike Read-ahead, Read-ahead Keyed can detect and report changes to records that synchronize according to key fields but differ in regard to comparison. The order of the key fields is not used in the synchronization process.

The read-ahead keyed synchronization limit controls how far ahead File Manager will look for matching key fields when a pair of non-matching key fields is found. You should specify a read-ahead limit a little larger than the maximum number of contiguous non-matching key fields that you expect to be encountered in the data sets.

The read-ahead keyed synchronization length determines how many contiguous matching key fields must be found for synchronization to be recognized.
  • If you are comparing "data" records, where false matches due to blank records or other commonly repeated records might not occur, you should specify a small read-ahead keyed synchronization length, such as the default value of one.
  • If you are comparing "text" or "source" records, where false matches due to blank records or other commonly repeated records might be common, you should specify a read-ahead keyed synchronization length that is greater than one.

How the records are synchronized

When non-matching key fields are encountered, File Manager attempts to resynchronize the data sets by looking ahead in each data set by up to the number of records that are specified by the read-ahead limit. If the resynchronization is successful, the non-matching records will be regarded as some combination of paired and unpaired insertions and deletions depending on where the resynchronization occurred. If the resynchronization fails, all of the "old" and "new" records from the first mismatch up to the resynchronization limit will be regarded as paired insertions and deletions, and the comparison will be terminated.

You can also use record selection to affect the apparent synchronization of your data sets. As a simple example, imagine you have copied a file and inserted ten new records at the start. To verify that you have not corrupted any of the existing records you might compare the original data set with the new data set, and request a read-ahead comparison with a limit of ten, which would show the added records as unpaired insertions. Alternatively, you might request a one-to-one comparison with a skip count of ten on the “New” data set, which would create a New compare set that ignores the added records completely.