Formatted comparison of unlike fields
When a formatted comparison is requested and the template mapping specifies that fields with unlike attributes are to be compared, File Manager attempts to compare the data in the fields in a meaningful way.
The first step is to classify each of the fields as being numeric data, bit string data, or character data. All internal (binary, packed decimal and floating point) and external (zoned decimal and external floating point) numeric data types are classified as numeric. Bit fields up to 64-bits long are classified as bit strings. All other fields, including any grouped items that have been mapped, are classified as character data.
The next step is to determine how to compare the fields. The following table shows what comparison method is used for each combination of data classifications (redundant combinations have been left blank).
Data type | numeric | bit string | character |
---|---|---|---|
numeric | numeric | numeric | numeric |
bit string | bit string | bit string | |
character | character |
- Numeric comparison
- Fields that are not defined as internal numeric types are first
converted to an internal numeric type compatible for comparison with the
other field. If the conversion fails, the fields do not match.
Packed and zoned decimal fields are validated before comparison, and if
the validation fails, the fields do not match. Other than conversion and
validation errors, and errors of precision for floating point numbers,
the data types and lengths of the fields do not affect the result of the
comparison.
Note: A character field containing an (external) floating point number is valid even if the field with which it is being compared is not defined as floating point.
- Bit string comparison
- Bit string comparison results in a match if corresponding bits in the two fields all match.
- Character comparison
- The result of a character comparison depends on which additional formatted Comparison Options were specified. If no additional options were specified then the fields must be the same length and corresponding bytes in each field must match exactly. You can use the additional options to specify that either leading or trailing blanks, or both, are ignored when a character comparison is performed. You can also specify an option that causes fields to match even when blank-delimited "words" have been reformatted in the field. With this option, the leading and trailing blanks options are redundant, because any contiguous series of blanks in either field is treated as if it were a single blank. To compare character fields of different lengths, specify one of these options, otherwise none of the records match. Finally, you can specify an option to ignore case when comparing character fields.