Map To panel

The Map To panel is used to select or create a copybook or template that can be used as the “To” template in a copy action or the “New” template in a compare action. The templates stores your manually-edited field mappings. The panel can be accessed by entering either the MC or MT commands on the Template Workbench.

Panel and field definitions

Figure 1. The Map To panel
  Process   Options   Help
 ──────────────────────────────────────────────────────────────────────────────
 Map from HFM.SHFMSAM1(HFMCCPY)

 CC Create template from copybook       EM Edit mapping
 CM Create template from model          U  Update template from copybook
 GM Generate corresponding map          GE Generate and edit mapping

 To Copybook:
    Data set name . 'HFMUSER.COPYBOOK'___________________________________
    Member  . . . . HFMCCPY 
 To Template:
    Data set name . 'HFMUSER.TEMPLATE'___________________________________
    Member  . . . . HFMCCPY 
 Model Template:
    Data set name . _____________________________________________________
    Member  . . . . ________




 Command ===> ________________________________________________________________
  F1=Help      F2=Split     F3=Exit      F4=CRetriev  F6=Describe  F7=Backward
  F8=Forward   F9=Swap     F10=Actions  F12=Cancel
Map from
The name of the copybook or template that contains the record descriptions for the “From” data set.
Map from commands
The Map from commands that you can use are listed at the top of the panel. You can position the cursor on the required command and press Enter or you can type them on the Command Line and press Enter.
Note: The RT and RC commands are only displayed and available when this panel is displayed by invoking one of the supported Z Data Tools copy functions in advance-function mode. The command is not available when the Template Workbench is displayed using the AF function or a Z Data Tools function other than a copy function.

These commands are:

CC
The CC command is used to create a template from a copybook. You can edit the template before running a function with it. You can also save the template for later use.

You must specify the PDS member name of the copybook you want to use. The copybook you specify is validated by compiling it. Z Data Tools includes the copybook in a shell program, and invokes the compiler to syntax-check the copybook, and to produce an ADATA file. If the compilation completes without errors, the information in the ADATA file is processed to create a template. If the compilation completes with errors, a pop-up menu is displayed. From the pop-up menu you can choose to:

  • View the compilation listing.
  • Abort the template creation process.
  • Retry the compilation.

    Before you select this option, you should first view the compilation listing and correct any errors in the copybook. While you are viewing the compilation listing, you can use the split screen facility to swap to another session and use your editor to correct the errors in the copybook.

  • Ignore the errors and proceed with creating the template.

    This option is only available if Z Data Tools is able to create a template. Some compilation errors, such as warnings, might have no effect on the creation of the template. If you are unsure, you should view the compilation listing. If the compilation error is too severe, Z Data Tools cannot create a template.

If Z Data Tools is able to create a template and you provide the name of a sequential data set or PDS member in which the template is to be saved, Z Data Tools saves it for you to use later with other functions. If you do not provide a template name, the template is kept in storage until the end of the current function. You can still use other Template Workbench commands to work with the template, but it is not automatically saved. However, if, at any time before the end of the current function, you decide to save the template you can specify a template name and save it using the SAVE command.

CM
The CM command is used to create a new template by copying an existing template.

You must provide the data set name or PDS member name of the existing template. If you provide the name of a data set or PDS member in which the new template is to be saved, Z Data Tools saves it for you to use later with other functions. If you do not provide a template name, the template is kept in storage until the end of the current function. You can still use other Template Workbench commands to work with the template, but it is not saved for later use. If, at any time before the end of the current function, you decide to save the template you can specify a template name and save it using the SAVE command.

EM
The EM command is used to edit field mapping specifications in an existing template.

Field mapping allows you to change the layout of records when copying from one data set to another. The template you edit can be either a permanent one previously saved in a data set or PDS member, or a temporary one created for the current function. You can create a temporary template by using the CC command. (You can also create a temporary template by using either the GE, or the GM command, but you should only use these commands if you want Z Data Tools to perform automatic mapping of fields with corresponding names.) Alternatively, you can let Z Data Tools automatically create one for you. To do this, specify the member name of a COBOL copybook, but do not specify a template data set name or member name. Then, when you issue the EM command, Z Data Tools automatically creates a temporary template.

When you edit field mapping in a template, a series of panels is displayed on which you can specify the following information:

  • For a file containing multiple record types, which record types you want to map.
  • Which fields in the “From” data set record descriptions map to which fields in the “To” data set record descriptions.
GE
The GE command is used to automatically generate field mapping specifications using the GM command, and then invoke the EM command so you can review and, if necessary, modify the mapping. See the descriptions of these commands for details of how the mapping is done.
GM
The GM command is used to automatically generate field mapping specifications in an existing template.

Field mapping allows you to change the layout of records when copying from one data set to another and to specify which fields are included when comparing data sets. The template can be either a permanent one previously saved in a data set or PDS member, or a temporary one created for the current function.

You can create a temporary template by using the CC command. Alternatively, you can let Z Data Tools automatically create one for you. To do this, specify the member name of a COBOL copybook, but do not specify a template data set name or member name. Then, when you issue the GM command, Z Data Tools automatically creates a temporary template.

When you issue the GM command, Z Data Tools automatically maps record types and fields in the “From” template to record types and fields in the “To” template, as follows:

  • Record types (COBOL level-01 data items) are firstly paired by name. Each record type in the “From” template is paired with a record type with the same name in the “To” template, if one exists.
  • Once all record types with matching names have been paired, any unpaired record types are paired by position in the template. For example, if the first record type in the “From” template is unpaired, and the first record type in the “To” template is unpaired, the two record types are paired. Checking then continues with the second record type in each template, and so on. Pairing stops when there are no more record types in either the “From” or “To” template.
  • Once record types have been paired, fields in the paired record types are mapped using much the same rules as the COBOL MOVE CORRESPONDING statement. A field in a “From” record type is mapped to a field in a “To” record type if both fields have the same name and, in the case of a field that is an elementary field in a group field, the respective group fields have the same names.
RC
The RC command is used to run the current function using a temporary template created from a copybook.

The temporary template cannot be edited before the function is run, and is not saved. Use the CC command if you want to edit or save the template.

You must specify the PDS member name of the copybook you want to use, and the data set name or PDS member name of the template you want to update. The copybook you specify is validated by compiling it. For a description of this process, and information about what you can do if errors occur, see the description of the CC command.

This command is only available when the Template Workbench is displayed by invoking one of the supported Z Data Tools copy functions in advance-function mode. The command is not available when the Template Workbench is displayed using the AF function or a Z Data Tools function other than a copy function.

RT
The RT command is used to run the current function with an existing template.

The template can be either a permanent one previously saved in a data set or PDS member, or a temporary one created for the current function using the CC command.

This command is only available when the Template Workbench is displayed by invoking one of the supported Z Data Tools copy functions in advance-function mode. The command is not available when the Template Workbench is displayed using the AF function or a Z Data Tools function other than a copy function.

U
The U command is used to update an existing template from a copybook.

You should use this function when you have made minor changes to the copybook, and you want these changes reflected in the template you previously created from the copybook. If you have made significant changes to the copybook, the update process might not produce the results you expect, so you should instead use the CC command to recreate the template.

Minor changes that the update process supports include:

  • Changing field names without changing field data types
  • Changing field data types without changing field names
  • Changing the order of fields in a record
  • Deleting unreferenced fields
  • Inserting new fields
  • Changing record length
  • Changing the number of occurrences of fields in an array (table)

Major changes that might cause the update process to produce unwanted results include:

  • Changing field names and field data types
  • Changing field names and the order of fields in a record

You must specify the PDS member name of the copybook you want to use, and the data set name or PDS member name of the template you want to update. The copybook you specify is validated by compiling it. For a description of this process, and information about what you can do if errors occur, see the description of the CC command.

To Copybook
The name (data set and member) of the copybook that contains the record descriptions for the “To” data set.
To Template
The name (data set and, if required, member) of an existing template you want to run with or edit, or a new template you want to create. This template contains the record descriptions and field mappings for the “To” data set.
Model Template
The name (data set and, if required, member) of an existing template you want to use as a model for creating a new template.

Parent panels

Child panels

Related tasks and examples