XML templates

A File Manager 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 File Manager session. The export utility is available from all template menus for convenience.

To use the foreground utility to export a File Manager template, select one of these options:

  • Option 7.6 from the File Manager Primary Options menu.
  • Option 7.2 from the FM/Db2 Primary Options menu.
  • Option 4.8 from the FM/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 File Manager 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 File Manager template, select one of these options:

  • Option 7.5 from the File Manager Primary Options menu.
  • Option 7.1 from the FM/Db2 Primary Options menu.
  • Option 4.7 from the FM/IMS Primary Options menu.

The batch utility for importing a File Manager template is TPIMP.

Db2: To import a Db2® template you must be running the import utility from a File Manager/Db2 session, whether foreground or batch. The Db2® object referred to in the template XML must exist in the current subsystem for the FM/Db2 session.
IMS:
  • To import an IMS template, view, or criteria set you must be running the import utility from a FM/IMS session, whether foreground or batch.
  • The FM/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 FM/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.