Editing the field mapping

You can edit the field mapping either when performing a copy or a compare, or by using the Template Workbench panel.

To access the field mapping when performing a copy, you must have specified both a “From” and a “To” template and selected the Edit template mapping option in the “To” panel (see Copying with a copybook or template).

To access the field mapping when performing a compare, you must have specified both an “Old” and a “New” template in the first two panels and selected the 2. Formatted Compare Type and Edit template mapping option in the third panel (see Comparing data sets).

To edit the field mapping from the Template Workbench panel:

  1. On the Template Workbench (option 7) panel, specify a copybook or template that you plan to use for a “From” or “Old” template.

    Although you need to specify this template before you can begin to edit the field mapping, you do not edit the mapping in this template: field mapping information is stored in the template that you specify on the next panel (“To” or “New”).

  2. Enter either an MC (Map from copybook) or an MT (Map from template) command.
  3. On the Map From panel, specify a copybook (if you want to create a new template) or an existing template that you plan to use for a “To” or “New” template.
  4. Enter an EM (Edit mapping) command to edit the field mapping in that template.
Note: Template mapping information is used by both the Compare and Copy Utilities. When using the Template Workbench , the panel labels are those used by the Copy Utility (“From” and “To”).

Regardless of the method used to edit the field mapping, one of the following occurs:

  • If the “To” template was generated from a copybook containing only one record type or was created as a dynamic template, the Template Mapping panel is displayed. (For panel details, see Field Mapping panel.)
  • If the “To” template was generated from a copybook containing more than one record type, the Record Type Mapping panel is displayed. (For panel details, see Record Type Mapping panel).
    Note: The examples in this section assume that you are editing the field mapping from within the Template Workbench.
    Figure 1. Record Type Mapping panel
      Process   Options   Help
     ──────────────────────────────────────────────────────────────────────────────
     File Manager                     Record Type Mapping
    
          TO FMN.SFMNSAM1(FMNCCPY2)              FROM FMN.SFMNSAM1(FMNCCPY)
     Cmd  Field name                      Len    Field name                      Len
               ****  Top of data  ****
     ___  NEW-TYPE01                       84 |  REC-TYPE01                       84
     ___  NEW-TYPE02                      100 |  REC-TYPE02                      100
               ****  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                              

To edit the mapping for a particular record type in the “To” template, type an S in the adjacent Sel column and press Enter.

File Manager displays the Field Mapping panel, showing the existing mapping between the fields in the “To” template record type and fields in the “From” template.