Creating masks in a data set

The recommended way to create masks is to define them in the Change Management repository. However, if you do not have Change Management enabled, you can still use masks by defining them in a data set.

About this task

The easiest way to define masks in a data set is to do so in the context of using one of the following functions for which you want the mask:
  • Generate SQL to reverse engineer Db2 objects
  • Clone a work statement list (WSL)
  • Migrate objects, data, or catalog statistics

Procedure

To create masks in a data set:

  1. On one of the following panels, in the Use Masking field, specify Yes and press Enter:
    • Generate SQL from DB2 catalog (ADB2GENB) panel
    • Clone Work Statement List (ADB2W1Q) panel
    • Migrate Parameters (ADB28M) panel

    The panel that you use depends on which function you are using.

  2. On the Specify Masks (ADB2GENM) panel, specify a data set name. This data set is to store the mask definitions.

    The data set must adhere to TSO data set naming conventions and be one of the following types:

    • A fixed-block sequential data set (RECFM=Fx)
    • A member of a partitioned data set with a record length of 80 (LRECL=80)
  3. In the Edit Mask field, specify YES, and press Enter.

    The data set is created, and an ISPF edit panel is displayed where you can edit the data set. This mask data set is pre-populated with a list of mask names and their hierarchy in the MSG lines, as shown in the following figures:

    Figure 1. Edit Masks (ADB2EDIT) panel, part 1
    Start of change
    ADB2EDIT  --------------------  -------------------------- Columns 00001 00072 
    Command ===>                                                  Scroll ===> CSR  
                                                                                   
    ****** ***************************** Top of Data ******************************
    ==MSG>                                                                         
    ==MSG>  Mask Syntax:                                                           
    ==MSG>    field:[qual<.name>:]inmask,outmask                                   
    ==MSG>  Fields (hierarchy):                                                    
    ==MSG>    SINGLECH                                                             
    ==MSG>    COLNAME                                                              
    ==MSG>    NAME                                                                 
    ==MSG>      DBNAME,TSNAME,IXNAME,UDFNAME,CONSNAME,                             
    ==MSG>      UDTNAME,COLLNAME,PKGNAME,PGMNAME,PLNNAME                           
    ==MSG>      DBRMNAME,STPNAME,SFNAME,TGNAME,GRPNAME,                            
    ==MSG>      VCATNAME,GBPNAME,TCNAME,PMNAME,MKNAME                              
    ==MSG>      SEQNAME,GVNAME                                                     
    ==MSG>      TBNAME                                                             
    ==MSG>        SYNNAME,ALNAME,VWNAME                                            
    ==MSG>      BPNAME                                                             
    ==MSG>        TSBPNAME,IXBPNAME                                                
    ==MSG>      SGNAME                                                             
    ==MSG>        TSSGNAME,IXSGNAME                                                
    ==MSG>    AUTHID                                                               
    ==MSG>      SQLID                                                              
    ==MSG>      SCHEMA                                                  
    ==MSG>        IXSCHEMA,PMSCHEMA,MKSCHEMA,SETPATHSC                  
    ==MSG>        TGSCHEMA,UDTSCHEMA,SEQSCHEMA,STPSCHEMA                
    ==MSG>        UDFSCHEMA,GVSCHEMA                                    
    ==MSG>        TBSCHEMA                                              
    ==MSG>          ALSCHEMA,VWSCHEMA,SYNSCHEMA                         
    ==MSG>      OWNER                                                   
    ==MSG>        DBOWNER,TSOWNER,IXOWNER,SGOWNER                       
    ==MSG>        PKGOWNER                                              
    ==MSG>        TBOWNER                                               
    ==MSG>      GRANTID                                                 
    ==MSG>        GRANTOR,GRANTEE                                       
    ==MSG>      ROLE                                                    
    ==MSG>        DBROLE,TSROLE,TBROLE,IXROLE                           
    ==MSG>    XMLSCHID                                                  
    ==MSG>    WLMENV                                                    
    ==MSG>    LOCATION                                                  
    ==MSG>                                                              
    ==MSG>  Overwrite Syntax:                                           
    ==MSG>     Field:inmask,Overwrite_value                             
    ==MSG>   Fields:              Overwrite values:                     
    ==MSG>     COMPRESS           YES,NO,REXX exit     
    ==MSG>       TSCOMPRES        YES,NO,FIXED,HUFFMAN,REXX exit (table spaces only)
    ==MSG>       IXCOMPRES        YES,NO,REXX exit (indexes only)                             
    ==MSG>     SEGSIZE            n (4-64 must be multiple of 4),REXX exit 
    ==MSG>       TSDSSIZE         nG,REXX exit (table spaces only)               
    ==MSG>       IXDSSIZE         nG,REXX exit (indexes only)                       
    End of change
    Start of change
    Figure 2. Edit Masks (ADB2EDIT) panel, Part 2
    ==MSG>     PRIQTY             n,n%,REXX exit (table spaces and indexes)   
    ==MSG>       TSPRIQTY         n,n%,REXX exit (table spaces only)          
    ==MSG>       IXPRIQTY         n,n%,REXX exit (indexes only)               
    ==MSG>     SECQTY             n,n%,REXX exit (table spaces and indexes)   
    ==MSG>       TSSECQTY         n,n%,REXX exit (table spaces only)          
    ==MSG>       IXSECQTY         n,n%,REXX exit (indexes only)               
    ==MSG>     DEFER              YES,NO,REXX exit (indexes only)             
    ==MSG>     DEFINE             YES,NO,REXX exit (table spaces and indexes) 
    ==MSG>       TSDEFINE         YES,NO,REXX exit (table spaces only)        
    ==MSG>       IXDEFINE         YES,NO,REXX exit (indexes only)             
    ==MSG>     HASHSPC            nK,nM,nG,REXX exit                          
    ==MSG>     TBINLOBL           n,REXX exit (tables only)                   
    ==MSG>     DTINLOBL           n,REXX exit (distinct types only)           
    ==MSG>     AUDIT              CHANGES,ALL,NONE,REXX exit (tables only)    
    ==MSG>     CLOSE              YES,NO,REXX exit (table spaces and indexes) 
    ==MSG>       TSCLOSE          YES,NO,REXX exit (table spaces only)        
    ==MSG>       IXCLOSE          YES,NO,REXX exit (indexes only)             
    ==MSG>     TRACKMOD           YES,NO,REXX exit (table spaces only)        
    ==MSG>     DCAPTURE           NONE,CHANGES,REXX exit (tables only)             
    ==MSG>     FREEPG             n,REXX exit (table spaces and indexes)           
    ==MSG>       TSFREEPG         n,REXX exit (table spaces only)                  
    ==MSG>       IXFREEPG         n,REXX exit (indexes only)                       
    ==MSG>     PCTFREE            n,REXX exit (table spaces and indexes)           
    ==MSG>       TSPCTFREE        n,REXX exit (table spaces only)                  
    ==MSG>       IXPCTFREE        n,REXX exit (indexes only)  
    ==MSG>     TSPCTFUPD          n,REXX exit (table spaces only)                      
    ==MSG>     LOCKMAX            n,SYSTEM,REXX exit (table spaces only)           
    ==MSG>     ERASE              YES,NO,REXX exit (table spaces and indexes)      
    ==MSG>       TSERASE          YES,NO,REXX exit (table spaces only)             
    ==MSG>       IXERASE          YES,NO,REXX exit (indexes only)                  
    ==MSG>     RESONDROP          YES,NO,REXX exit (tables only) 
    ==MSG>     EDITPROC           string,REXX exit (tables only)
    ==MSG>     VALIDPROC          string,REXX exit (tables only)
    ==MSG>     TSPARTS            n,REXX exit (table spaces)
    ==MSG>     LOGGED             YES,NO,REXX exit (table spaces only)
    ==MSG>     LOCKSIZE           TABLE,TABLESPACE,PAGE,ROW,LOB,ANY,REXX exit
    ==MSG>                                         (table space only)
    ==MSG>     MAXROWS            n,REXX exit (tables only)
    ==MSG>     GBPCACH            SYSTEM,CHANGED,ALL,NONE,REXX exit
    ==MSG>                                         (table spaces and indexes)
    ==MSG>     TSGBPCACH          SYSTEM,CHANGED,ALL,NONE,REXX exit
    ==MSG>                                         (table spaces only)
    ==MSG>     IXGBPCACH          SYSTEM,CHANGED,ALL,NONE,REXX exit
    ==MSG>                                         (indexes only)
    ==MSG>     VOLATILE           YES,NO,REXX exit (tables only)
    ==MSG>     APPEND             YES,NO,REXX exit (tables only)
    ==MSG>     PADDED             YES,NO,REXX exit (indexes only)
    ==MSG>     COPY               YES,NO,REXX exit (indexes only)
    ==MSG>     MEMCLUS            YES,NO,REXX exit (table spaces only)
    ==MSG>     FIELDPROC          string,REXX exit (tables only)
    ==MSG>     INSALGO            n,REXX exit (table spaces only)
    ==MSG>     SGKEYLABL          string,NO,NOKEYLABEL,REXX exit (stogroup only) 
    ==MSG>     TBKEYLABL          string,NO,NOKEYLABEL,REXX exit (tables only)
    End of change
    Figure 3. Edit Masks (ADB2EDIT) panel, Part 3
                      
    ==MSG>                                                                         
    ==MSG>     Verification mask Syntax:                          
    ==MSG>        VER,Field:operand,value(,values),RC=x           
    ==MSG>            or                                          
    ==MSG>        VER,rexxField:REXX(exitproc,parm1,parm2,...parmn)                             
    ==MSG>       where:                                           
    ==MSG>      Field:         Same fields used by overwrites 
    ==MSG>      RexxField      Can be one of three options:
    ==MSG>                     1. same fields used by overwrites
    ==MSG>                     2. special REXX only field, OBJNAME
    ==MSG>                     3. two char object type code designation listed below:
    ==MSG>                      Object type code   Object type           Catalog record
    ==MSG>                         SG               Storage group         SYSSTOGROUP
    ==MSG>                         DB               Database              SYSDATABASE
    ==MSG>                         TS               Table space           SYSTABLESPACE
    ==MSG>                         TB               Table                 SYSTABLES
    ==MSG>                         IX               Index                 SYSINDEXES
    ==MSG>                         TG               Trigger               SYSTRIGGERS
    ==MSG>                         FK               Foreign Key           SYSRELS
    ==MSG>                         PK               Primary key           SYSTABCONST
    ==MSG>                         CK               Check Constraint      SYSCHECKS
    ==MSG>                         UQ               Unique Constraint     SYSTABCONST
    ==MSG>                         DT               Data type             SYSDATATYPES
    ==MSG>                         FU               Function              SYSROUTINES
    ==MSG>                         SP               Procedure             SYSROUTINES
    ==MSG>                         SQ               Sequence              SYSSEQUENCES
    ==MSG>                         SY               Synonyms              SYSSYNONYMS
    ==MSG>                         AL               Alias                 SYSTABLES
    ==MSG>                         VW               View                  SYSVIEWS
    ==MSG>                         GV               Global variable       SYSVARIABLES
    ==MSG>      Operand:       EQ     - Equal                     
    ==MSG>                     NE     - Not equal                 
    ==MSG>                     GT     - Greater than                               
    ==MSG>                     LT     - Less than                                  
    ==MSG>                     LIST   - list of values                             
    ==MSG>                     RANGE  - range of values from two input values      
    ==MSG>      value:         same values as overwrite values                     
    ==MSG>      RC=:           return code if expression is not met                
    ==MSG>      x:             return code value - 0,4,8,12
    
    Figure 4. Edit Masks (ADB2EDIT) panel, Part 4
    ==MSG>   Notes:                                                                
    ==MSG>     - n is a integer value                                              
    ==MSG>     - n% is the integer percentage of the current attribute value       
    ==MSG>     - REXX exit takes format of REXX(myexit,val1,val2...valn) where     
    ==MSG>       valn is the name of DB2 catalog field (such as PARTITIONS) or     
    ==MSG>       a variable with numeric/string value (such as BPOOL= 'BP1').      
    ==MSG>       + in col 72 indicates continuation of Rexx exit on next line      
    ==MSG>     - To support/migrate DB2V8 masking input,OWNER,TBOWNER and          
    ==MSG>       IXOWNER will mask both owner and schema fields.SCHEMA,            
    ==MSG>       TBSCHEMA and IXSCHEMA will be applied to schema fields only.      
    ==MSG>     - For DB2 synonyms, apply DB2 APAR PM42910 in DB2 V9 NFM and        
    ==MSG>       above and then use schema as the qualifier. SYNOWNER is           
    ==MSG>       migrated into SYNSCHEMA. Use SYNSCHEMA instead of SYNOWNER.       
    ==MSG>     - SINGLECH format is SINGLECH:<character>[,<escape character>]      
    ==MSG>       where the single character in a mask specification represents     
    ==MSG>       any character at that position. If the specified escape           
    ==MSG>       character precedes the specified single character, then the       
    ==MSG>       single character is treated as literal.                           
    ==MSG>     - The view, alias and synonym masks (both name and                  
    ==MSG>       schema/owner) will only apply to the CREATE statement for         
    ==MSG>       these objects (e.g. VWNAME only valid for CREATE VIEW).           
    ==MSG>       All other usages of these names and schemas are vague and         
    ==MSG>       can refer also to table names and schemas.  These other           
    ==MSG>       usages can only be masked by TBNAME for name and TBSCHEMA         
    ==MSG>       for schema; therefore, it is recommended to use both VWNAME       
    ==MSG>       and TBNAME if view names are being changed for both CREATE        
    ==MSG>       VIEW statement and SQL that uses this view.                       
    ==MSG>     - Use caution when specifying mask field SEGSIZE. This mask         
    ==MSG>       field might cause changes to the table space type. For            
    ==MSG>       example, specifying the SEGSIZE mask might convert a              
    ==MSG>       partitioned table space to a range-partitioned universal          
    ==MSG>       table space (UTS). If a table in a UTS has a partitioned          
    ==MSG>       index and the partitioned index needs to be recreated, DB2        
    ==MSG>       might generate SQLCODE=-662 during execution.                     
    ==MSG>     - The following masks can not have the object-specific              
    ==MSG>       qualifiers listed in the mask syntax:                             
    ==MSG>        NAME, SCHEMA, SETPATHSC, DBNAME, COLLNAME, SFNAME, GRANTID,      
    ==MSG>        GRANTOR, GRANTEE, ROLE, DBROLE, TSROLE, TBROLE, IXROLE,          
    ==MSG>        GBPNAME, TCNAME, XMLSCHID, AUTHID, SQLID, SGNAME, OWNER,         
    ==MSG>         OWNER, BPNAME, PLNNAME and SINGLECH.                            
    ==MSG>     - Verification mask checks attributes using expression given        
    ==MSG>       and if the expression is false, return code of value given        
    ==MSG>       will be issued.  If return code is greater than 4,                
    ==MSG>       processing will fail after all objects are processed and          
    ==MSG>       error messages will be in VALOUT file.                            
    ==MSG>     - Verification masks are only valid with the GEN and compare
    ==MSG>       process.  A warning stating that verification masks will 
    ==MSG>       be ignored will be issued for all other processes that 
    ==MSG>       allow masking.                          
    
    Start of change
    Figure 5. Edit Masks (ADB2EDIT) panel, Part 5
    ==MSG>     - OBJNAME is a special verification mask type that only is          
    ==MSG>       allowed with REXX exec syntax.  OBJNAME will provide three        
    ==MSG>       arguments to REXX exec, object type, object name and object       
    ==MSG>       schema.              
    ==MSG>     - TSPARTS is a special verification mask type.  The number
    ==MSG>       of parts will be passed for verification.  
    ==MSG>   Mask examples:                                                        
    ==MSG>     OWNER:ABC*,DEF*                                                     
    ==MSG>     NAME:PRE*,NPRE*                                                     
    ==MSG>     XMLSCHID:PO1,PO2                                                    
    ==MSG>     WLMENV:WLM33,WLM44                                                  
    ==MSG>     LOCATION:LOC3*,LOCT*                                                
    ==MSG>     SETPATHSC:SYSIBM,SYSFUN                                             
    ==MSG>     SINGLECH:_                                                       
    ==MSG>     SINGLECH:_,+                                                     
    ==MSG>                                                                      
    ==MSG>   Object-specific mask examples:                                     
    ==MSG>     TBSCHEMA:CREATOR1.TB2:CREATOR1,NEW_CRE1                          
    ==MSG>     IXNAME:IXOWN*.IX3*:IX3*,IX4*                                     
    ==MSG>     IXBPNAME:IXOWN1.INDX2:BP1,BP3                                    
    ==MSG>                                                                      
    ==MSG>   Overwrite examples:                                                
    ==MSG>     COMPRESS:MYDB*.MYTS*,YES                                         
    ==MSG>     SEGSIZE:MYDB*.MYTS*,8                                            
    ==MSG>     DSSIZE:MYDB*.MYTS*,4G                                            
    ==MSG>     PRIQTY:*.*,REXX(MYPRIQTY,DBNAME='MYDBTEST')                      
    ==MSG>     TSPRIQTY:MYDB*.MYTS*,30                                          
    ==MSG>     IXPRIQTY:MYCR*.MYIX*,25%                                         
    ==MSG>     IXSECQTY:MYCR*.MYIX*,REXX(MYSECQTY,IXNAME,IXCREATOR,PCT=20%)     
    ==MSG>     DEFER:USER001.*IXNAME,NO                                         
    ==MSG>     DEFINE:DBNAME*.*TSPC,REXX(MYDEFINE,DEFINE='YES')                 
    ==MSG>     HASHSPC:TBCREATOR.MYTBNAME,100M                                  
    ==MSG>     TBINLOBL:TBCREATOR.MYTBNAME.COLNAME,16000                        
    ==MSG>     DTINLOBL:DTCRE*.DTNAME*,16000                                    
    ==MSG>     IXCLOSE:MYCR*.MYIX*,NO                      
    ==MSG>     AUDIT:MYDB*.MYTB*,CHANGES                   
    ==MSG>     TRACKMOD:MYDB*.MYTS*,NO                     
    ==MSG>     DCAPTURE:TBCRE*.MYTB*,NONE                  
    ==MSG>     FREEPG:ABC*.DEF*,6                          
    ==MSG>     IXPCTFREE:IXSCH1.IXNAME1,9                  
    ==MSG>     LOCKMAX:DBTEST2.TSTEST2,SYSTEM              
    ==MSG>     TSERASE:DBTEST1.TSTEST1,NO                  
    ==MSG>     RESONDROP:TBCRE*.MYTB*,NO 
    ==MSG>     INSALGO:DB1.TS1,2 
    ==MSG>     SGKEYLABL:SG1,DB2SYS_KEY01
    ==MSG>     SGKEYLABL:SG1,NOKEYLABEL                  
    ==MSG>     SGKEYLABL:SG1,NO     
    ==MSG>     TBKEYLABL:TBCRE*.MYTB*,DB2SYS_KEY02
    ==MSG>     TBKEYLABL:TBCRE.MYTB,NOKEYLABEL**         
    ==MSG>     TBKEYLABL:TBCRE.MYTB,NO**                      
    ==MSG>                                                 
    ==MSG>   Verification mask examples:                   
    ==MSG>     VER,COMPRESS:EQ,YES,RC=4                    
    ==MSG>     VER,COMPRESS:NE,NO,RC=8                     
    ==MSG>     VER,TSPRIQTY:LT,30,RC=8                     
    ==MSG>     VER,PCTFREE:GT,20,RC=8                      
    ==MSG>     VER,SEGSIZE:LIST,4,8,12,RC=8                
    ==MSG>     VER,PCTFREE:RANGE,0,5,RC=4                  
    ==MSG>     VER,OBJNAME:REXX(OBJTST)                    
    ==MSG>     VER,SEGSIZE:REXX(SEGTST,MYSEGSZ)
    ==MSG>     VER,MEMCLUS:EQ,NO,RC=8 
    ==MSG>     VER,FIELDPROC:EQ,'',RC=8
    ==MSG>     VER,INSALGO:RANGE,0,2,RC=8
    ==MSG>     VER,TBKEYLABL:NE,DB2SYS_KEY02,RC=8 
    ==MSG>
    ==MSG>   Verification object type mask examples:
    ==MSG>     VER,IX:REXX(VERIX,TBCREATOR,TBNAME,NAME)
    ==MSG>     VER,DB:REXX(VERDB,NAME,CREATOR,BPOOL)
    
    End of change
  4. Issue the SAVE command to save the changes to the data set.
  5. Exit out of the ISPF editor.