Setting up a mapping for a field

To set up or change the mapping for a field in the “To” template, enter S against the field name. The From Field Mapping panel is displayed, listing the fields in the “From” template that you can map to the “To” field:
Figure 1. The Field Mapping panel
  Process   Options   Help
 ──────────────────────────────────────────────────────────────────────────────
 Z Data Tools                     Field Mapping                     Line 1 of 7

 To          HFM.SHFMSAM1(HFMCCPY2)
 From        HFM.SHFMSAM1(HFMCCPY)

 Cmd Lv To Field Name       Type  Len   Lv From Field Name             Type  Len
        ****  Top of data  ****
      1 NEW-TYPE01           AN    84 |  1 REC-TYPE01                   AN    80
      2 REC-TYPE             AN     2 |  2 REC-TYPE                     AN     2
      2 NAME                 AN    20 |  2 NAME                         AN    20
      2 SERIAL-NO            BI     4 |
      2 AGE                  BI     2 |  2 AGE                          BI     2
      2 SALARY               PD     4 |  2 SALARY                       PD     4
      2 MONTH                BI     4 |  2 MONTH                        BI     4
        ****  End of data  ****




 Command ===>                                                       Scroll PAGE
  F1=Help      F2=Split     F3=Exit      F4=CRetriev  F5=RFind     F6=Describe
  F7=Up        F8=Down      F9=Swap     F12=Cancel                              

In the example panel above, note that there is no “From” field against the “To” field SERIAL-NO. This field is “unmapped”.

To set up or change the mapping for a field in the “To” template, enter S against the field name. The “From” Field Mapping panel is displayed, listing the fields in the “From” template that you can map to the selected “To” field:
Figure 2. The From Field Mapping panel
  Process   Options   Help
 ──────────────────────────────────────────────────────────────────────────────
 Z Data Tools                  From Field Mapping
 To   template/copybook : HFM.SHFMSAM1(HFMCCPY2)
 From template/copybook : HFM.SHFMSAM1(HFMCCPY)
 To field   . . . . . . : #4 SERIAL-NO
 From field . . . . . . :
 Corresponding(Y/N) . . : N               (Auto map for group items).

 Sel   Ref Lvl Old Field                                        Typ Start Length
               ****  Top of data  ****
 ___     D --  Delete "Old field"
 ___     1  1  REC-TYPE01                                       AN      1     84
 ___     2  2  REC-TYPE                                         AN      1      2
 ___     3  2  NAME                                             AN      3     20
 ___     4  2  EMPLOYEE-NO                                      BI     23      4
 ___     5  2  AGE                                              BI     27      2
 ___     6  2  SALARY                                           PD     29      4
 ___     7  2  MONTH(13)                                        BI     33      4
               ****  End of data  ****

 Command ===> _____________________________________________________ Scroll PAGE
  F1=Help      F2=Split     F3=Exit      F4=CRetriev  F7=Up        F8=Down
  F9=Swap     F12=Cancel                                                        

This screen is similar to the Primary Field Selection/Edit panel (Figure 1). You edit fields in the same way, by entering E against the field name. For copying in particular, you may wish to edit a field so that you can set the create attributes for the field. These are described in detail in Changing the attributes for an alphanumeric field and Changing the attributes for an alphanumeric field.

The information at the top of the panel shows you the current mapping. In the panel above, the “To” field is SERIAL-NO. There is currently no “From” field, because there is no “From” field that has the same name.

To specify a “From” field to map to SERIAL-NO, enter S against a “From” field. The information at the top of the panel changes immediately to reflect the new mapping. For example, if you enter S against field #4 (EMPLOYEE-NO), then the information at the top of the panel looks like this:
Z Data Tools                  From Field Mapping
 To   template/copybook : HFM.SHFMSAM1(HFMCCPY2)
 From template/copybook : HFM.SHFMSAM1(HFMCCPY)
 To  field  . . . . . . : #4 SERIAL-NO
 From field . . . . . . : #4 EMPLOYEE-NO
 Corresponding(Y/N) . . : N               (Auto map for group items).
⋮
Press the Exit function key (F3) to return to the Field Mapping panel. This panel now shows that EMPLOYEE-NO is mapped to SERIAL-NO.
Z Data Tools                     Field Mapping                     Line 1 of 7

To          HFM.SHFMSAM1(HFMCCPY2)
From        HFM.SHFMSAM1(HFMCCPY)

Cmd Lv To Field Name       Type  Len   Lv From Field Name             Type  Len
       ****  Top of data  ****
     1 NEW-TYPE01           AN    84 |  1 REC-TYPE01                   AN    80
     2 REC-TYPE             AN     2 |  2 REC-TYPE                     AN     2
     2 NAME                 AN    20 |  2 NAME                         AN    20
     2 SERIAL-NO            BI     4 |  2 EMPLOYEE-NO                  BI     2
     2 AGE                  BI     2 |  2 AGE                          BI     2
     2 SALARY               PD     4 |  2 SALARY                       PD     4
     2 MONTH                BI     4 |  2 MONTH                        BI     4
       ****  End of data  ****                                                 ⋮