Using Db2 templates: Change Management (CM) batch interface

Managing templates when using the Change Management (CM) batch interface is done by specifying the Db2 TEMPLATE statement in ADBTEMPL DD. This enables installations to define a data set with Db2 TEMPLATE statements and to easily use these template statements in multiple Db2 subsystems.

About this task

Some Change Management (CM) batch interface parameters control whether user-provided templates or product default templates are used while others enable templates for utility type files.

Procedure

In the ADBTEMPL file, define each template on a separate line.
Depending on how you want to use templates, use the procedure in one of the following options.
Important: The first two words of a template statement must be TEMPLATE followed by the template name, with no SQL comments in between the first two words.
  • To control whether user-provided templates or product default templates are used, use the following settings in the generate_templates parameter:
    • Y: If the generate_templates parameter is set to Y, the use of TEMPLATEs is enabled. If you enable templates for a template type individually (for example: util_template_copyddn1_use = ‘S’, user templates are used for that template type if it is defined in the ADBTEMPL file. If you do not enable templates for a template type, default templates are used for that template type.
    • N: If the generate_templates parameter is set to N, this allows you to easily disable the use of user-specified TEMPLATEs without having to toggle off or on each template type individually. When the generate_templates parameter is set to N, the results is that product default templates are used when templates are needed.
  • To enable and make available templates for each utility file type, use the parameter names starting with util_template and util_clone_template.
    Note: The parameter names starting with util_clone_template define the templates used when processing a table space that has a clone table.
    For full descriptions of parameter names starting with util_template and util_clone_template, see CM batch parameter definitions.

Example

In the following example, templates COPY1 and LOBC are specified in the ADBTEMPL DD. The template named COPY1 is the product default template name for the first COPY data set. The template named LOBC is the product default template name for templates associated with LOB columns. The generate_templates parameter is set to Y, so these templates are used.
Note: The ADBTEMPL file is not processed to resolve product-specific and user-defined variables. The template statements are passed as is to Db2.
//LSCLIBS JCLLIB ORDER=DMTOOL.SGOCSAMP
//*
//GOCCM    EXEC GOCCM,SSID=DSNA,PLAN=ADB
//GOCCM.PARMS DD *
 CHANGE_NAME = 'AUTO:2011-12-11-15.24.28.803388'
ACTION_ANALYZE_CHANGE = 'Y'
generate_templates = 'Y'
take_an_image_copy = 'B'
run_reorg_rebuild = 'A'
run_check_data = 'Y'
prefix_for_data_sets = '&USERID..&ABC.'
;
 symbol_name = '&ABC.',symbol_value='TMPL';
/*
//ADBTEMPL DD *
TEMPLATE COPY1
  DSN 'DEMBIN2.TMPL.&SSID..COPY1.&UQ.'
TEMPLATE LOBC
  DSN 'DEMBIN2.TMPL.&SSID..LOB.&UQ.'
/* 
  • If the generate_templates parameter is set to N, the templates in ADBTEMPL DD are not used.
  • If the generate_templates parameter is set to Y and the util_template_copyddn1_name parameter is set to ZZZ, the COPY1 template is not used for the first COPY data set because template ZZZ is not defined in the ADBTEMPL DD. In this case, a product default template is used. The LOBC template is still used whenever a template is needed for LOB columns.
  • If the generate_templates parameter is set to Y, and util_template_copyddn1_use is set to ", the COPY1 template is not used for the first COPY data set because user-specified templates is disabled. The LOBC template is still used whenever a template is needed for LOB columns.