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:
-
On the DB2 Administration Menu (ADB2) panel, specify option
CM.
-
On the Change Management (CM) (ADB2C) panel, specify option
2.
-
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 . .
-
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.
-
Press F3 to return to the Manage Masks (ADB2C2) panel.
-
Specify option 1, and press Enter.
-
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
-
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.
-
Issue the SAVE primary command to save the mask definitions.
-
Exit back to the Manage Masks (ADB2C2) panel.