LISTDEF and TEMPLATE

LISTDEF and TEMPLATE are Db2 utilities that provide facilities for other utilities. You can use LISTDEF to define reusable lists of objects for other utilities to process. You can use TEMPLATE to define templates for data sets that are allocated by other utilities. LISTDEF and TEMPLATE are often used together.

LISTDEF

When you define a list with the LISTDEF utility, you can specify the objects that you want to include in the list by using either explicit names or naming patterns with wildcard characters. You can then specify this list by name in other utility control statements. Using such predefined lists saves you from having to specify all of these objects each time you run a utility or having to run the utility multiple times. These lists can also help ensure that an object is not accidentally omitted. For example, if you want to make an image copy of every table space in database ABC, you can specify such a list (LISTDEF ABCLIST INCLUDE TABLESPACES DATABASE ABC) and then run the COPY utility on this list. Utility processing builds the list of objects during execution.

Tip: Colloquially, the lists that are defined by the LISTDEF utility are also referred to as LISTDEFs, or list definitions. So be aware that LISTDEF can either refer to the utility or the list itself.

TEMPLATE

When you define a data set template by using the TEMPLATE utility, you specify the data set naming convention as well as other data set attributes. You can then specify this template in other utility statements instead of DD names. Those utilities will use the template specifications when allocating the data set. The data set name is constructed during utility processing based on the data set name expression that is specified in the TEMPLATE utility control statement. That expression often includes an object-identifying pattern, such as database or space name, and other variables. These patterns allows a single utility job step to include many objects.

Using templates eliminates the need for certain JCL DD statements during utility processing. Templates can also help standardize data set names.

You can use templates together with lists that were defined by LISTDEF. For example, a single utility can process many objects from a LISTDEF list and then dynamically define the target output data sets by using templates. However, you do not have to use templates with such lists; a utility that is not processing a list can still use one or more templates.

Db2 Admin Tool also supports the use of templates for Db2 Admin Tool work data sets that are created and used in the jobs that are generated for the following functions: alter, restore, redefine, migrate, and object comparison. As with the utility data sets, templates allow you to define your own data set naming convention and also control other allocation attributes for the data sets. The set of variables that can be specified for the data set names for these non-utility work data sets depends on the Db2 Admin Tool function.

Important: Both Db2 Admin Tool and Db2 Object Comparison Tool support the use of REORG and COPY utilities in the Alter, OC, and CM functions. If COPYDDN 1 and COPYDDN 2 templates are specified, specify a unique symbolic variable to prevent conflicts.