XML templates

A Z Data Tools template can be exported to an external XML format using the Template Export utility.

All aspects of a template can be represented in an XML form. The XML can be created manually by specifying the elements and attributes described in XML definitions for a template, or by exporting an existing template.

An XML template can be used directly within the product as long as the XML provides all the elements required to create a new template. You can use an XML template anywhere you can specify a copybook or template. A good way to determine the XML required to create a template is to use the Template Export Utility to export a similarly defined template.

Exporting a template to XML format

You can export any type of template from any type of Z Data Tools session. The export utility is available from all template menus for convenience.

To use the foreground utility to export a Z Data Tools template, select one of these options:

  • Option 7.6 from the Z Data Tools Primary Options menu.
  • Option 7.2 from the ZDT/Db2 Primary Options menu.
  • Option 4.8 from the ZDT/IMS Primary Options menu.

With the foreground Template Export utility, you can display a member list with all types of templates supported. You can also invoke a template edit against any type of template using the E prefix command from the member list.

The batch utility for exporting a Z Data Tools template is TPEXP.

Importing a template in XML format

An XML template can be imported into the product using the Template Import utility. The import process can either create or update an existing template using the template definition in its XML format.

To use the foreground utility to import a Z Data Tools template, select one of these options:

  • Option 7.5 from the Z Data Tools Primary Options menu.
  • Option 7.1 from the ZDT/Db2 Primary Options menu.
  • Option 4.7 from the ZDT/IMS Primary Options menu.

The batch utility for importing a Z Data Tools template is TPIMP.

Db2: To import a Db2® template you must be running the import utility from a Z Data Tools/Db2 session, whether foreground or batch. The Db2® object referred to in the template XML must exist in the current subsystem for the ZDT/Db2 session.
IMS:
  • To import an IMS template, view, or criteria set you must be running the import utility from a ZDT/IMS session, whether foreground or batch.
  • The ZDT/IMS Extract process allows an XML template to be created, mapping the extract fields.

    You might have copies of the same IMS database information loaded under similar DBD names. This allows multiple IMS environments using similar data. Once the ZDT/IMS extract is completed, you can use the template created by the extract to change the database names and update other data in a formatted view.