Creating dynamic templates on the fly

When you create a dynamic template, for each field definition you build, you specify the field definition details and, optionally, selection criteria that Z Data Tools uses to filter records. When you specify selection criteria for a field, you do not necessarily have to supply all the field definition details as Z Data Tools supplies default values.

When you are building the definitions without selection criteria, you must supply the starting column, length and type of the data set fields that you wish to operate upon.

When you are building the definitions with selection criteria, you must supply the starting column and value for the data set fields that you wish to operate upon. If you do not supply the length of a field, Z Data Tools calculates it from the value you specify. Similarly, if you do not supply the data type or operator for a field, Z Data Tools uses default values.

In either case, you can, optionally, supply your own field name to identify the information.

You can edit these field definitions at any time.

Note: If you define a field with a type of VC (varying character), VG (varying graphic), or VD (varying DBCS), without also defining a 2-byte binary field immediately preceding it, when generating the template, Z Data Tools reduces the length of the field you have defined by 2 bytes and inserts a 2-byte binary length field with the field name, LEN, immediately before it.
  1. In the Copybook/template usage field of any relevant panel, select option 4. Create dynamic and press Enter.

    The Dynamic Template panel is displayed.

  2. For each field in the data set that you want to display without specifying selection criteria:
    • Specify values in the Start, Length, and Type fields.
  3. For each field in the data set that you want to display and for which you want to specify selection criteria:
    • Specify a value in the Start field.
    • Specify a value in the Value field.
    • Optionally, specify a value in the Length field. If you leave this field blank, Z Data Tools calculates the length from the value you specify in the Value field.
    • Optionally, specify a value in the Type field. (See note above for types VC, VG, and VD.) If you leave this field blank, it defaults to "AN" (alphanumeric).
    • Optionally, specify a value in the Op (Operator) field. If you leave this field blank, it defaults to "=".
  4. If you wish, specify a Field Name for your field definitions.

    If this field is left blank, a name is generated in the form @@DTnn where nn is the field number. Existing field names taking the form @@DTnn are regenerated to ensure that nn always reflects the current field number.

    Note: If you are running a screen width of 115 or greater, the Field Name field can be displayed at the same time as the Start, Length and Type fields. However, at any width less than this, you need to toggle the display between Field Name and Start, Length and Type. The default is to display Start, Length and Type. To toggle the display, ensure that your cursor is not in a Value field and press the Right function key (F10) or Left function key (F11).
  5. Press the Exit function key (F3). The Template Save pop-up panel is displayed.
  6. Type the name of an existing data set in the Data set name field.

    Templates can be stored in PDS or PDSE data sets, but cannot be stored in CA-Panvalet libraries.

  7. Type a name for your new template in the Member field.
  8. Press the Exit function key (F3). The template is saved and the next relevant panel (depending upon your entry point) is displayed.

Related topics