Figure 152. : Examples of TEMPLATE definitions
* Define a template for the type of a NAME
D standardName S 100A VARYING TEMPLATE
* Define a template for the type of an EMPLOYEE
D employee_type DS QUALIFIED TEMPLATE INZ
D name LIKE(standardName)
D INZ('** UNKNOWN **')
D idNum 10I 0 INZ(0)
D type 1A INZ('R')
D years 5I 0 INZ(-1)
* Define a variable like the employee type, initialized
* with the default value of the employee type
D employee DS LIKEDS(employee_type)
D INZ(*LIKEDS)
* Define prototypes using the template definitions
*
* The "id" parameter is defined like a subfield of a
* template data structure.
D getName PR LIKE(standardName)
D idNum
D findEmp PR N
D emp LIKEDS(employee_type)
D id LIKE(employee_type.idNum)
D CONST