Skip to content

Templating Examples

Typical templating examples include:

  • Replacing characters at an offset

  • Adding characters at the end

  • Replacing characters at the end

  • Deleting characters at the end

  • Replacing a character string with another string

  • Adding an OWNER parameter

  • Adding a QUALIFIER parameter

Replace Characters At an Offset

Use ? (question marks) in the Target field to define the offset of characters you want to change in a parameter value.

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
ABCDEFG ??X??**YZ ABXDE**YZ
ABCDEFG **X XBCDEFG

Add Characters at the End

Use ? (question marks) in the Target field to define an offset that is as long or longer than an input parameter value, followed by characters that you want to add to the end of the value.

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
ABCDEFG ???????**XYZ ABCDEFG**XYZ
ABCDEFG ?????????**X ABCDEFG**X

Replace Characters at the End

Use * (asterisk) followed by n characters in the Target field to define the n characters you want to replace at the end of a parameter value.

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
ABCDEFG ***XYZ ABCD**XYZ
ABCDEFG ***X ABCDEF**X

Delete Characters at the End

Use ¬ (not) in the Target field to specify a parameter value character that you want to replace with a space. Since spaces are not valid in the middle of a parameter value, use ¬ to delete characters at the end of a value.

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
ABCDEFG ????**¬¬¬ ABCD
ABCDEFG **WXYZ¬¬¬¬¬ **WXYZ

Replace a Character String with Another String

Use the Source field to specify a string to be replaced in a parameter value and use the Target field to define the string to replace it. The search string and the replace string may be different lengths.

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
ABCDEFG XYZ                **ABC XYZDEFG
ABCDEFG WXYZ             **DEF ABCWXYZG

Add an Owner Parameter

Specify a value in the Insert field to add an OWNER parameter and value. To insert an OWNER parameter, the following must be true:

There is no OWNER= parameter in the input BIND command.

 This control statement is input to the plan lookup program CMNDB2PL at DDname CMNPLCTL:

  AUTHORITY=OWNER,INSERT

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
                                                  **XYZ **OWNER(XYZ)

Add a Qualifier Parameter

Specify a value in the Insert field to add a QUALIFIER parameter and value. To insert a QUALIFIER parameter, the following must be true:

  • There is no QUALIFIER= parameter in the input BIND command.
  • This control statement is input to the plan lookup program CMNDB2PL at DDname CMNPLCTL:

    BIND PLAN Example

    INSERTQUAL

Input Parameter Value          Logical Subsystem Fields    Templated Output Value
Target            Source             **Insert
                                                  **XYZ **QUALIFIER(XYZ)