Creating masks in the Change Management repository

The recommended way to define a mask is in the Change Management (CM) repository. When you define masks through CM, the masks are stored in Db2® tables in the CM repository, which makes them easy to share, manage, and recover.

The alternative to creating masks in the CM repository is to define them in a data set. (See Creating masks in a data set.)

Restriction: Masks that are used when you import changes through CM must be defined in the CM repository, not in a data set.

Before you begin

Before you create masks in CM, the CM repository tables must be defined as part of the process of customizing Db2 Administration Tool.

About this task

This procedure shows you how to define masks before you begin using any functions where the masks are needed. Alternatively, you can define masks while using a function, such as cloning a work statement list or reverse engineering a Db2 object. For that procedure, see Creating masks in the CM repository while using another function.

Procedure

To create a mask in the Change Management repository:
  1. On the DB2 Administration Menu (ADB2) panel, specify option CM.
  2. On the Change Management (CM) (ADB2C) panel, specify option 2.
  3. On the Manage Masks (ADB2C2) panel, specify option 2:
    DB2 Admin ------------------- CM - Manage Masks   ----------------------- 18:03
    Option ===> 2                                                                   
                                                                                   
                                                                                   
       1 - Display masks                                     DB2 System: DD1A      
       2 - Create a mask                                     DB2 SQL ID: ADM001     
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
    Enter display selection criteria (Using a LIKE operator, criteria not saved):  
    Name . . . . . . .                    >  Created by . .          >             
    Owner  . . . . . .          >            Altered by . .          >             
    Created within . .                       Mask ID  . . .                        
    Altered within . .                                                             
                                                                                   
    
  4. On the Insert Mask (ADB2C22) panel, specify an owner, a name for the mask row in the repository table, and optionally a comment, and press Enter.

    A message confirms that an INSERT statement was executed. That statement inserted a row with the specified name into a mask table in the CM repository.

  5. Press F3 to return to the Manage Masks (ADB2C2) panel.
  6. Specify option 1, and press Enter.
  7. On the Masks (ADB2C21) panel, issue the ML line command next to the row that you just created so that you can add mask lines, or mask definitions for that row:
    ADB2C21 n ------------------- CM - Masks --------------------- Row 1 to 1 of 1 
                                                                                   
    Line commands:                                                                 
     U - Update  DEL - Delete  INS - Insert  ML - Mask lines  CH - Changes         
     E - Edit  I - Details on mask  ? - Show all line commands                                                 
                                                                                   
    Sel          ID Owner    Name                           Comment                
                  * *        *                              *                      
    --- ----------- -------- ------------------------------ ---------------------- 
    ML            1 MYID     MYMASK2                                                
    ******************************* END OF DB2 DATA *******************************
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
    Command ===>                                                  Scroll ===> PAGE 
  8. On the Mask Lines (ADB2C2L) panel, define the masks. To define the first mask, complete the existing row that has a 1 in the Sequence column.
    For each row, specify values for the following columns:
    Req
    The mask request. Specify VER for verification masks or leave blank for name or overwrite masks.
    Type
    The mask type. Possible values are:
    • A valid name mask or overwrite mask, as listed in Mask names.
    • One of the following rename types: RENAMEDB, RENAMETS, RENAMETB, RENAMEIX, RENAMEGV, RENAMECOL
    • For verification masks, a valid two-character object type code, as listed in Verification masks.
    From
    The input mask. For verification masks, specify the verification operand and verification values.
    To
    The output mask. For verification masks, specify the verification return code.

    For more information about mask names, types, and syntax, and processing see Mask definitions.

    To add more masks, use the I line command to insert more rows.

    For example, to define a mask that translates table name TB_TEST to TB_PROD and a column name from CELLNO to MOBILENO, enter the values as shown:
    DB2 Admin ----------------- CM - Mask Lines --------------------- Row 1 from 2 
    Command ===>                                                  Scroll ===> PAGE 
                                                                                   
    Mask lines for mask "MYID"."MYMASK2"                                           
    Commands: SAVE                                                                 
    Line commands:                                                                 
      I - Insert  D - Delete  R - Repeat  M - Move  A - After  B - Before          
                                                                                   
    Sel    Sequence Type      From                  To                    Oper.  T 
                  * *         *                     *                     *      * 
    --- ----------- --------- --------------------> --------------------> ------ - 
                                                                                   
    *             1 TBNAME    TB_TEST               TB_PROD               UPDATE   
    *             2 COLNAME   CELLNO                MOBILENO              UPDATE   
    *             3 SINGLECH  _                     +
    *             4 ALNAME    ALS+_TEST             ALS+_PROD                      
    ***************************** END OF DB2 DATA *******************************
    

    You can also use the D and R line commands to delete and repeat mask lines. You can use the M line command to move the mask lines. When you specify the M line command, also specify the A or B line command to indicate which row you want the line moved after (A) or before (B). The order of the mask lines is important, because Db2 Administration Tool uses the first mask that matches. Therefore, put the most specific translation masks at the beginning and the more general ones at the end.

  9. Issue the SAVE primary command to save the mask definitions.
  10. Exit back to the Manage Masks (ADB2C2) panel.

Creating masks in the CM repository while using another function

If you are using a Db2 Admin Tool function, such as reverse engineering, migrating Db2 data, or cloning work statement lists, and need a mask that is not already defined, you can create the mask in the CM repository during the process of running that other function.

Before you begin

Change Management must be enabled.

Procedure

To create a mask in the CM repository while using another function:
  1. Ensure that you specify that you want to use masking (Use Masking = YES).
    The panel where you specify this choice varies depending on what function you are using.
  2. When you are prompted to specify the masks on either the Specify Compare Masks (GOC3) panel or the Specify Masks (ADB2GENM) panel, specify the following values, and press Enter:
    • Specify an owner and name for the table row in the CM mask repository.
    • Leave the Mask DSN field blank.
    • In the Edit Mask field, specify YES.
    Figure 1. Specify Compare Masks (GOC3) panel
    Compare --------------------- Specify Compare Masks --------------------------
    Option ===>                                                                   
                                                                                  
                                                                                  
    Mask Table Entry:                                                             
      Owner . .  MYID     >            (? to look up)                             
      Name  . .  MYMASK             >  (? to look up)                             
    Data Set:                                                                     
      Mask DSN  . .                                                               
    Options:                                                                      
      Edit Mask . .  YES (Yes/No)                                                 
    
  3. On the Insert Mask (ADB2C22) panel, confirm the owner and name, and press Enter.

    A message confirms that an INSERT statement was executed. That statement inserted a row with the specified name into a table in the CM repository.

  4. Press F3 to display the Mask Lines (ADB2C2L) panel.
  5. Define the masks for that row in the CM repository by completing steps 8 through 10 (in Creating masks in the Change Management repository).