Associating data set templates with keywords

You can associate templates with Db2 utility data sets and with Db2 Admin Tool work data sets.

About this task

Many Db2 utilities support the use of templates for data sets that they use. Those data sets are identified in the utility statement by a DD name keyword. For example, REORG TABLESPACE has a DISCARDDN keyword to identify the data set to use for discarded records. For these utility keywords, you can specify either a DD name or a template name to identify the data set. In Db2 Admin Tool, you can associate a template with these DD name keywords.

The Db2 Admin Tool work data sets that support the use of templates do so by using a template keyword. For example, the keyword ALDDL is used for the work data set that the ALT function uses for the DDL that is extracted from the catalog.

Procedure

To associate a template with a utility DD name keyword or a Db2 Admin Tool template keyword:

  1. On the DB2 Administration Menu (ADB2) panel, select option 5, and press Enter.
  2. On the Utility generation using LISTDEFs and TEMPLATEs (ADB25) panel, specify the TEMPLATE control table that contains the template definitions that you want to use:
    Figure 1. Utility generation using LISTDEFs and TEMPLATEs (ADB25) panel
    ADB25 min ----- DD1A Utility generation using LISTDEFs and TEMPLATEs ---- 00:33
    Option ===>                                                                    
                                                                                   
       L - Manage LISTDEFs                                   DB2 System: DD1A      
       T - Manage TEMPLATEs                                  DB2 SQL ID: ADM001     
      TU - Specify TEMPLATE usage                                                  
                                                                                   
      CL - Create LISTDEF control table                                            
      UL - Upgrade LISTDEF control table                                           
      CT - Create TEMPLATE control table                                           
      UT - Upgrade TEMPLATE control table                                          
                                                                                   
     LISTDEF control table:                                                        
         Table owner . . . DSNACC   >                                              
         Table name  . . . UTLIST            >                                     
                                                                                   
     TEMPLATE control table:                                                       
         Table owner . . . DSNACC   >                                              
         Table name  . . . UTTEMPLATE        >    
  3. Specify option TU, and press Enter.
    The Specify TEMPLATE Usage (ADB25TU3) panel is displayed:
    Note: For the CLONE template type, panel ADB25TU4 is displayed.
    Figure 2. Specify TEMPLATE Usage (ADB25TU3) panel
     ADB25TU3 ------------------ DD1A Specify UTILITY TEMPLATE Usage --------- 11:45
     Command ===>                                                                   
                                                                                    
     Line commands:                                                                 
      T - Toggle Use On/Off   C - Clear data   ? - Choose Template for the Keyword  
      E - Edit Template                                                             
      Template type . . . . . . UTIL      (UTIL,CHG,MIG,MISC,CLONE)                 
      Generate templates  . . . YES       (Yes/No)                                   
     Sel Keyword      Use Template Comment                                          
     --- ------------ --- --------  ------------------------------------------------
         COPYDDN    1  /  SCOPY                                                     
         COPYDDN    2  /  COPYLOC                                                   
         DISCARDDN     /  COPYREM                                                   
         ERRDDN        /  COPYREM                                                   
         FILTERDDN     /  COPYREM2                                                  
         INDDN         /  COPYREM2                                                  
         MAPDDN        /  COPYREM                                                   
         PUNCHDDN      /  SPUNCH                                                    
         RECOVERYDDN1  /  COPYLOC                                                   
         RECOVERYDDN2  /  SRCPY1                                                    
         UNLDDN        /  UNLDDN                                                    
         WORKDDN    1  /  WORKDDN                                                   
         WORKDDN    2  /  SORTOUT                                                   
         LOBCOLDDN     /  CLOBDD                                                    
         XMLCOLDDN     /  CXMLDD                                                    
        

    This panel indicates whether a template is actively associated with a keyword and the template name. If a keyword is listed twice (keyword 1 and keyword 2 ), that keyword allows two parameters. For example, in the previous screen, COPYDDN 1 corresponds to the first parameter of the COPYDDN keyword and COPYDDN 2 corresponds to the second parameter of the COPYDDN keyword.

    For utility keywords (Template type = UTIL), a slash in the USE column indicates that a TEMPLATE statement is to be generated for any utility that supports templates for that keyword.

  4. Optional: To change the template type that is displayed, overwrite the value in the Template Type field, and press Enter.
    The following values are valid:
    UTIL
    Utility data set keywords that are used by Db2 utilities.
    CHG
    Non-utility data set keywords that are used by the Db2 Admin Tool Alter (ALT) function, Db2 Object Comparison Tool, or Change Management.
    MIG
    Migrate data set keywords that are used by the Db2 Admin Tool migrate function.
    MISC
    SYSPRINT data set keywords that are used by Db2 Admin Tool to generate work statement lists (WSLs) online.
    CLONE
    Utility templates that are used for cloned table spaces.

    For a description of the keywords for each of these types, see Keywords that can be associated with templates

  5. To associate a template with a specific keyword, specify ? in the SEL column next to the keyword, and press Enter.
    The TEMPLATEs (ADB25T) panel displays a list of defined templates.
  6. To select a template, specify a plus sign (+) in the SEL column next to the template name, and press Enter.
    The Specify TEMPLATE Usage (ADB25TU3) panel includes a slash (/) in the Use column next to the keyword for which you selected a template. The template name and any comments are also displayed.
  7. Repeats steps 5 and6 as needed to assign other templates.