Introduction to Template Code

A template consists of three basic components:

An application template may be used either as a "skeleton" or "model" for the generation of a complete RDML program, or may be used to generate a commonly used section of RDML code or logic.

The application template commands control how, when, and what RDML commands are generated. They usually do this by asking the user a question, and by using the answer to generate different RDML commands.

The RDML commands produced are stored as part of the template.  The template language controls which lines of code are written, and what values are used within the RDML commands.

The template HELP text is also stored as part of the template definition and is automatically displayed when the user presses the HELP key.

LANSA has a special Template Commands language. All commands conform to the normal LANSA command conventions.  For instance, positional or keyword parameter specification can be used, lists must be enclosed in brackets, etc. The template language is not compiled. It is an interpretive language.

All of LANSA's template commands begin with "@@".  For example, "@@QUESTION" is an application template command which will ask the user a question, and receive and store the answer.

The RDML generated by a template is stored as part of the template. The "@@" template commands control the generation of the RDML code.

The application template commands and RDML code can also make use of Template Special Variables. These variables will be substituted into the RDML code by LANSA before being added to the generated RDML program.

Reminder: A template definition exists across all partitions.  It can be accessed and maintained from any partition, provided authority is granted.  When deleted, it is deleted from all partitions.

A suggested way to familiarize yourself with application templates is to print one or more of the LANSA supplied application templates and work your way through them. Sample application template programs are also provided at the end of this section.

Also See

4.5.3 Application Template Program Examples