Template Workbench panel

The Template Workbench is a central area from which you can create, edit and maintain your templates. It can be accessed from the File Manager Primary Options menu (Option 7. Templates), or by issuing the TView primary command on either the View or the Edit panel.

Panel and field definitions

Figure 1. The Template Workbench panel from the Primary Options Menu
 Process   Options   Help
──────────────────────────────────────────────────────────────────────────────
File Manager                  Template Workbench

CC Create template from copybook       E  Edit field/record in template
CM Create template from model          U  Update template from copybook
MC Map from copybook                   MT Map from template

Copybook:
   Data set name . COPYBK3                                      
   Member  . . . .         
Template:
   Data set name . 'USERID.TEMPLATE'                            
   Member  . . . . COPY01  
Model Template:
   Data set name . TEMPLATE                                     
   Member  . . . . TUTDYN  

Processing Options:
 Enter "/" to select option
 /  Advanced copybook selection

Command ===> _________________________________________________________________
 F1=Help      F2=Split     F3=Exit      F4=CRetriev  F6=Describe  F7=Backward
 F8=Forward   F9=Swap     F10=Actions  F12=Cancel
Note: If the Template Workbench is accessed from an editor session, two additional options (RC - Run using copybook and RT Run using template) appear on the panel.
Figure 2. The Template Workbench panel from an editor session
 Process   Options   Help
──────────────────────────────────────────────────────────────────────────────
File Manager                  Template Workbench

RC Run using copybook                  RT Run using template
CC Create template from copybook       E  Edit field/record in template
CM Create template from model          U  Update template from copybook
MC Map from copybook                   MT Map from template

Copybook:
   Data set name . 'FMNUSER.COPYBOOK'____________________________
   Member  . . . . COPY01____
Template:
   Data set name . 'FMNUSER.TEMPLATE'____________________________
   Member  . . . . TEMP0102
Model Template:
   Data set name . ______________________________________________
   Member  . . . . ________

Processing Options:
 Enter "/" to select option
 /  Advanced copybook selection
Command ===> _________________________________________________________________
 F1=Help      F2=Split     F3=Exit      F4=CRetriev  F5=RT        F6=Describe
 F7=Backward  F8=Forward   F9=Swap     F10=Actions  F12=Cancel
Template Workbench commands
The workbench 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. These are:
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 workbench has been invoked from an editor session using the TEdit or TView commands.

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 workbench has been invoked from an editor session using the TEdit or TView commands.
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. File Manager 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 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.

If File Manager 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, File Manager 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, File Manager 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.
E
The E command is used to edit 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. You can create a temporary template by using the CC command. Alternatively, you can let File Manager 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 E command, File Manager automatically creates a temporary template.
When you edit 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 be selected for processing.
  • For a file containing multiple record types, what criteria File Manager should use to identify each record type.
  • If you only want to process certain records, such as those containing specified values, what criteria File Manager should use to select those records.
  • If you don't want to process all fields within a record, which fields you do want to process.
  • What headings you want to use for fields when they are displayed on the screen or printed using the SNGL or TABL display or print formats.
  • For numeric fields, whether you want leading zero suppression when they are displayed on the screen or printed using the SNGL or TABL display or print formats.
  • When you use the template to help generate test data, what data patterns File Manager should use for each field.
MC
The MC command is used to map the records and fields in one COBOL copybook to the records and fields in another copybook or in a template. You can use the MC command when you want to copy all records in one data set to another data set, and you want to reorganize the fields in the “From” data set before they are copied to the “To” data set. Do not use the MC command if you want to select which records in the “From” data set you want to copy. Instead, you should first create a template, edit it to specify the record selection criteria, and then use the MT command to do the field mapping.

You must specify the PDS member name of the COBOL copybook you want to use. This copybook describes the contents of the “From” data set. The copybook you specify is validated by compiling it with the COBOL compiler. For a description of this process, and information about what you can do if errors occur, see the description of the CC command.

If File Manager is able to create a template from the copybook, another panel is displayed where you specify the name of a COBOL copybook or the name of a template that describes the contents of the “To” data set. From this panel you can specify how you want the fields in the “From” data set mapped to the “To” data set.

MT
The MT command is used to map the records and fields in one template to the records and fields in another template or in a COBOL copybook. You can use the MT command when you want to copy all or selected records in one data set to another data set, and you want to reorganize the fields in the “From” data set before they are copied to the “To” data set.

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 template describes the contents of the “From” data set, and the record selection criteria for the records you want to copy. If you want to use a previously saved template, you must specify the data set name (and member name, if required) of the template.

When you use the MT command, another panel is displayed where you specify the name of a template or the name of a COBOL copybook that describes the contents of the “To” data set. From this panel, you can specify how you want the fields in the “From” data set mapped to the “To” data set.

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
Copybook
The name (data set and member) of the copybook that contains the record description of your data.
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.
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.
Advanced copybook selection
When selected, specifies that you want to:
  • Use one or more copybooks to create your template
  • Be able to specify how these copybooks are interpreted by File Manager
This option applies to the CC and U commands and is provided to enable a template to be generated from more than one copybook which may be located in one or more libraries. If this option is selected, a number of panels may be displayed.

Parent panels

Child panels

Related tasks and examples