Create RPG Template (CRTRPGTPL)

The CRTRPGTPL command is used to generate a compiled source member template used by the RPG-XML Suite 3 XML composition engine. Unlike with RXS 2, newer versions of RPG-XML Suite do not reference template files in the IFS at runtime. Intead, the template source member generated with CRTRPGTPL is included in your programs using the /COPY compiler directive and is compiled directly into your program. By using these compiled templates, we remove this additional external runtime dependency, reducing the risk of errors caused by file changes and allowing your programs to be more self-contained. For more information, see our guide for creating an RXS template.

The CRTRPGTPL command is designed to be run against either your existing .tpl template files in the IFS, or new template files that are first created with BLDTPL and have been modified to add sections as needed. To generated a compiled template member, your .tpl template file requires at least one section.

As with all of your program source code members, the generated template source members should not be stored in the RXS library.

Note: It is imperative that you never edit or modify the source member generated by the CRTRPGTPL command in any way, unless directed to do so by a member of our support staff. If you need to make changes to your template, first update the corresponding .tpl file in the IFS, then run CRTRPGTPL on that updated .tpl file to regenerate the compiled template member.

Parameters

Stream file (STMF)

This is a required parameter.

Specify the full path of the IFS stream file, built manually or with the BLDTPL Command, which contains the template file to be processed.

Possible Values:

character-value
Qualified filepath of IFS stream file.

Source file (FILE)

This is a required parameter.

Specify the source physical file (and optionally the library) for the output source member that will contain the generated RPG source code.

Possible Values:

character-value
Name of the source physical file in which the template member will be generated.

Member (MBR)

This is a required parameter.

Specify the name of the source member to which the generated code will be written. This source member will be created if it does not already exist. Note that the default value of this parameter - *FIRST - is a placeholder and must be overwritten.

Possible Values:

character-value
Name of the source member.

Sections DS Name (SECTIONSDS)

Specify the name that will be given to the Sections data structure in the generated code. Setting this value allows the section and variable data structures to be qualified, and is strongly recommended.

Possible Values:

*NONE
No name is given to the Sections data structure.
character-value
This name will be assigned to the Sections data structure.

Variables DS Name (VARSDS)

Specify the name that will be given to the Variables data structure in the generated code. Setting this value allows the section and variable data structures to be qualified, and is strongly recommended.

Possible Values:

*NONE
No name is given to the Variables data structure.
character-value
This name will be assigned to the Variables data structure.

Coded Character Set Id (CCSID)

Specify the CCSID in which the IFS stream file should be processed. This will additionally control the output of the template source member to support multi-byte character sets when *STMF is selected.

Possible Values:

*JOB
The CCSID of the current job is used.
*STMF
The CCSID of the IFS stream file is used. This setting must be selected with multi-byte character sets (eg. CCSID 1208).

Trim Template Lines (TRIMLINES)

Specifies whether leading and trailing whitespace should be trimmed from template lines. Line control characters - carriage returns and line feeds - will always be preserved.

Possible Values:

*NO
Whitespace will be preserved.
*YES
Leading and trailing whitespace will be trimmed.