Creating a template
Before you create a template for a database, you need to know the name of the database, the name of the DBD load library that contains the DBD for the database, the name of the partitioned data set where you want to save the new template and the names of the partitioned data sets containing the copybooks that describe the segment layouts. You must also know which copybook member corresponds to each segment type.
To create a template:
- From the Primary Option menu, select option 4 Template. The Template/View/Criteria Set menu is displayed.
- Select option 1 Templates. The Template Entry Panel is displayed.
- In the Template data set name field, enter the name of the partitioned data set in which you want the template stored.
- In the Template Member field, enter the name of the database that you want the template for. If this member does not already exist, the Template dialog creates a template with the specified name and stores it in this member.
- Press Enter. The DBD Library List panel is displayed. On this panel, you enter the names of up to 6 DBD load libraries. FM/IMS searches these libraries for a DBD with the specified database name. The libraries are searched in the order in which they are specified and FM/IMS uses the first DBD it finds with the specified database name. The DBD library list you specify is saved in the template and is used for subsequent updates.
- Press Enter. FM/IMS displays the Copybook Library List panel.
On this panel, you specify the names of the copybook libraries that
contain the copybooks that you want the Template function to use.
The function searches the specified libraries for the layout members
you specify on the Template Specification panel.
The Copybook library list you specify is saved in the template
and is used for subsequent updates.
Note:
- You cannot use a mix of language copybooks to create a template; you can use only COBOL, HLASM, or PL/I copybooks.
- Library members may not be packed by ISPF.
- Press Enter. FM/IMS displays the Template Specification panel. This panel displays a list of the names of the segment types specified in the DBD for the database.
- For each segment type, enter in the Layout member fields,
the names of the copybooks that defines the layout or
layouts of the segment.
You can use prefix commands to copy (C, Cn, CC, with A or B),
insert (I, In), delete (D, Dn, DD), move (M, Mn, MM, with A or B),
overlay (O, On, OO,
with C, Cn, CC, M, Mn, or MM,),
or repeat (R, Rn, RR, RRn) rows on the panel.
You can also use prefix commands to
edit the segment layout (E), edit the copybook member (S),
view the copybook member (V),
update and edit the segment layout to which this copybook belongs (U)
or specify redefines and range parameters for a copybook (X).
You can enter the complete member name, enter a member name pattern or, for segment header records only, leave the member name blank; then press Enter to select the members from the Member Selection panel. This panel shows a list of all the member names from all the libraries specified on the Copybook Library List panel. The name of the current segment is also displayed. The panel is redisplayed for each segment in which you have left the member name blank or specified a pattern.
Tip: If your copybook members have the same name as their matching segments, you can copy and paste the segment names into the member name fields. - To insert a level-01 statement in a copybook, specify
Y
in the 01 column.To include a name in the generated 01 statement for the copybook, specify the required name in the Field name column.
- To generate multiple record layouts for a source
that contains more than one record definition within a single level-01 structure:
- Type an X in the Cmd field next to the required segment type to display the Redefines / Range Specifications pop-up panel.
- In the Level field, specify the source level value
to be used to identify REDEFINES or UNION-level clauses that are to
generate new record layouts.
Alternatively, to change the source before compile so that all matching levels are changed to 01, place a "/" against the Change all matching levels to 01 option.
- In the Field name field, specify the target field name of the REDEFINES clause or the field name with a UNION clause that identifies the REDEFINES or UNION statements that are to be used to direct FM/IMS to create new layouts.
- To adjust the offset value for each layout so that the starting location is the redefines or union field start location, enter a "/" in the Set offset field.
- To extract a subset of the copybook to be compiled
into the template:
- Type an X in the Cmd field next to the required segment type to display the Redefines / Range Specifications pop-up panel.
- In the From statement field, specify the starting line number for the extract.
- In the To statement field, specify the ending line number for the extract.
- In the From string field, specify the string that FM/IMS is to search the copybook for. The first statement that contains the string begins the extract.
- In the To string field, specify the string that FM/IMS is to search the copybook for. The first statement that contains the string ends the extract.
- To compile the specified copybooks from the Template Specification panel, and either update an existing template or create a new template, use the UPDATE primary command or the U prefix command.
- To edit the template for a given segment, use the E prefix command;
alternatively, you can use the E primary command to edit
the template for the segment at the top of the display.
Note: If you have made any changes, FM/IMS performs a compile and update.
- The “R? column contains the value
“
R
? if redefines or range parameters have been specified for the corresponding layout member.The “I? column is blank when a new template is being created. It contains the value “
I
? when the template has been created and either only one layout has been specified for the segment or criteria have been provided for each layout for a given segment.If the field is blank, then the copybook contains more than one layout for each segment type and you need to specify layout identification criteria in the template (see Specifying layout identification criteria).
FM/IMS does not require you to specify layout identification criteria. If you exit this panel with this field still being blank, FM/IMS saves the template. However, when browsing or editing a database using a view created from such a template, FM/IMS might display segments using an incorrect layout (or it might not display some segments at all).
Related topics