Comparing with the default field mapping
The following field mapping between Old
and New
templates could be generated:
With the above field mapping, an
Olddata set containing one record of each type defined in the
Oldtemplate:
├─ FIELD-A1 ─┼─ FIELD-A2 ─┼─ FIELD-A3 ─┤ ◄─ OLD-TYPE-A
├─ FIELD-B1 ─┼─ FIELD-B2 ─┤ ◄─ OLD-TYPE-B
├─ FIELD-C1 ─┼─ FIELD-C2 ─┤ ◄─ OLD-TYPE-C
and a Newdata set containing one record of each type defined in the
Newtemplate:
├─ FIELD-A1 ─┼─ FIELD-A2 ─┤ ◄─ NEW-TYPE-A
├─ FIELD-B1 ─┼─ FIELD-B2 ─┼─ FIELD-B3 ─┤ ◄─ NEW-TYPE-B
├─ FIELD-Z1 ─┼─ FIELD-Z2 ─┤ ◄─ REC-TYPE-C
would be compared as follows:- FIELD-A1 in the NEW-TYPE-A record is compared to FIELD-A1 in the OLD-TYPE-A record.
- FIELD-A2 in the NEW-TYPE-A record is compared to FIELD-A2 in the OLD-TYPE-A record.
- FIELD-A3 in the OLD-TYPE-A record is not compared with any field in any record in the
New
data set. ❷ - FIELD-B1 in the NEW-TYPE-B record is compared to FIELD-B1 in the OLD-TYPE-B record.
- FIELD-B2 in the NEW-TYPE-B record is compared to FIELD-B2 in the OLD-TYPE-B record.
- FIELD-B3 in the NEW-TYPE-B record is not compared with any field in any record in the
Old
data set.❸ - The REC-TYPE-C records are not compared because there is no mapping match between the fields in
the OLD-TYPE-C record and any record in the
New
template.❹
Notes:
- ❶
- File Manager pairs record types by matching field names within the record types; the names of the record types (level-01 group items, in the copybooks) are not important.
- ❷
- There is no matching FIELD-A3 in the
New
template NEW-TYPE-A, so this field is not mapped and is not used in the comparison. - ❸
- There is no FIELD-B3 in the
Old
template to map to this FIELD-B3 in theNew
template, so this field is not mapped and is not used in the comparison. - ❹
- There are no fields named FIELD-C1 or FIELD-C2 in any record type in the
New
template, so the OLD-TYPE-C record type in theOld
template is not paired with a record type in theNew
template.The
New
data in the REC-TYPE-C record is reported using the field descriptions in the NEW-TYPE-A record type. This is because the templates do not contain record identification criteria and NEW-TYPE-A is the first record type in theNew
template with a length matching the length of the REC-TYPE-C record in theNew
data set.The
Old
data is not reported because there is no mapping match between the fields in the OLD-TYPE-C record and any record in theNew
template. Instead, the message " *** Old data is not mapped to any data *** " is reported.