Sample LISTDEF control statements
Use the sample control statements as models for developing your own LISTDEF control statements.
Example 1: Defining a list of objects
The following control statement defines a list that includes the following objects:
- Table space DBLT0301.TLLT031A
- Index space DBLT0301.IXlT031A
- Table space DBLT0301.IPLT031C
- Table space that contains ADMF001.TBLT032A_1
The name of the list is NAME1. This list can be referenced by any subsequent utility statements.
LISTDEF NAME1 INCLUDE TABLESPACE DBLT0301.TLLT031A
INCLUDE INDEXSPACE DBLT0301.IXLT031A
INCLUDE TABLESPACE DBLT0301.TPLT031C
INCLUDE TABLESPACES TABLE ADMF001.TBLT032A_1
Example 2: Defining a list of all objects in a database
The following control statement defines a list (EXAMPLE2) that includes all table spaces and all index spaces in the PAYROLL database.
LISTDEF EXAMPLE2 INCLUDE TABLESPACES DATABASE PAYROLL
INCLUDE INDEXSPACES DATABASE PAYROLL
Example 3: Defining a list by using pattern-matching characters
The following control statement defines a list (PAYROLL) that includes the following objects:
- All table spaces in the PAYROLL database, except for any table spaces whose names begin with TEMP.
- All index spaces in the PAYROLL database that end with IX, except for those index spaces that begin with TMPIX.
The subsequent COPY utility control statement processes this list.
LISTDEF PAYROLL INCLUDE TABLESPACE PAYROLL.*
EXCLUDE TABLESPACE PAYROLL.TEMP*
INCLUDE INDEXSPACE PAYROLL.*IX
EXCLUDE INDEXSPACE PAYROLL.TMPIX*
COPY LIST PAYROLL …
Example 4: Defining a list of partitions and nonpartitioned table spaces
The following LISTDEF statement defines a list that includes one entry for each partition of the qualifying partitioned table spaces and one entry for each qualifying nonpartitioned table space. The list is named EXAMPLE4. The table spaces must satisfy the PAY*.* name pattern.
LISTDEF EXAMPLE4 INCLUDE TABLESPACE PAY*.* PARTLEVEL
Assume that three table spaces qualify. Of these table spaces, two are partitioned table spaces (PAY2.DEPTA and PAY2.DEPTF) that each have three partitions and one is a nonpartitioned table space (PAY1.COMP). In this case, the EXAMPLE4 list includes the following items:
- PAY2.DEPTA partition 1
- PAY2.DEPTA partition 2
- PAY2.DEPTA partition 3
- PAY2.DEPTF partition 1
- PAY2.DEPTF partition 2
- PAY2.DEPTF partition 3
- PAY1.COMP
If you specified PARTLEVEL(2) instead of PARTLEVEL, the EXAMPLE4 list includes the following items:
- PAY2.DEPTA partition 2
- PAY2.DEPTF partition 2
- PAY1.COMP
If you specified PARTLEVEL(0) instead of PARTLEVEL, the EXAMPLE4 list includes only PAY1.COMP.
Example 5: Defining a list of COPY YES indexes
The following control statement defines a list (EXAMPLE5) that includes related index spaces from the referenced list (EXAMPLE4) that were defined or altered to COPY YES.
LISTDEF EXAMPLE5 INCLUDE LIST EXAMPLE4 INDEXSPACES COPY YES
Example 6: Defining a list that includes all table space partitions except for one
The following control statement defines a list (EXAMPLE6) that includes all partitions of table space X, except for partition 12. The INCLUDE clause adds an entry for each partition, and the EXCLUDE clause removes the entry for partition 12.
LISTDEF EXAMPLE6 INCLUDE TABLESPACE X PARTLEVEL
EXCLUDE TABLESPACE X PARTLEVEL(12)
If the PARTLEVEL keyword is not specified in both clauses, as in the following two sample statements, the INCLUDE and EXCLUDE items do not intersect. For example, in the following statement, table space X is included in the list in its entirety, not at the partition level. Therefore, partition 12 cannot be excluded.
LISTDEF EXAMPLE6 INCLUDE TABLESPACE X
EXCLUDE TABLESPACE X PARTLEVEL(12)
In the following sample statement, the list includes only partition 12 of table space X, so table space X in its entirety cannot be excluded.
LISTDEF EXAMPLE6 INCLUDE TABLESPACE X PARTLEVEL(12)
EXCLUDE TABLESPACE X
Example 7: Defining a LISTDEF library and referencing a list in a QUIESCE job
In this example, the first two LISTDEF control statements define the NAME1 and NAME2 lists. The NAME1 list is stored in a sequential data set (JULTU103.TCASE.DATA2). The NAME2 list is stored in a member of a partitioned data set (JULTU103.TCASE.DATA3(MEM1)). These output data sets are identified by the SYSUT2 DD statements (in the JCL for the CREATE1 and CREATE2 jobs).
The LISTLIB DD statement (in the JCL for the QUIESCE job) defines a LISTDEF library. When you define a LISTDEF library, you give a name to a group of data sets that contain LISTDEF statements. In this case, the library is to include the following data sets:
- The sequential data set JULTU103.TCASE.DATA2 (which includes the NAME1 list)
- The MEM1 member of the partitioned data set JULTU103.TCASE.DATA3 (which includes the NAME2 list).
When you define such a library, you can later reference a group of LISTDEF statements with a single reference.
The OPTIONS utility statement in this example specifies that the library that is identified by the LISTLIB DD statement is to be used as the default LISTDEF definition library. This declaration means that for any referenced lists, DB2® is to first search SYSIN for the list definition. If DB2 does not find the list definition in SYSIN, it is to search any data sets that are included in the LISTLIB LISTDEF library.
The last LISTDEF statement defines the NAME3 list. This list includes all objects in the NAME1 and NAME2 lists, except for three table spaces (TSLT032B, TSLT031B, TSLT032C). Because the NAME1 and NAME2 lists are not included in SYSIN, DB2 searches the default LISTDEF library (LISTLIB) to find them.
Finally, the QUIESCE utility control statement specifies this list of objects (NAME3) for which DB2 is to establish a quiesce point.
//CREATE1 JOB 'USER=NAME',CLASS=A,...
//*------------------------------------------------------
//* Create an input data set.
//*------------------------------------------------------
//LOAD1 EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD DSN=JULTU103.TCASE.DATA2,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=2400)
//SYSUT1 DD *
LISTDEF NAME1 INCLUDE TABLESPACE DBLT0301.TLLT031A
INCLUDE TABLESPACE DBLT0301.TSLT031B
/*
//CREATE2 JOB 'USER=NAME',CLASS=A,...
//*------------------------------------------------------
//* Create an input data set.
//*------------------------------------------------------
//CRECNTL EXEC PGM=IEFBR14
//CNTL DD DSN=JULTU103.TCASE.DATA3,UNIT=SYSDA,
// VOL=SER=SCR03,
// SPACE=(TRK,(2,2,2)),DCB=(DSORG=PO,
// LRECL=80,RECFM=FB,BLKSIZE=4560),
// DISP=(NEW,CATLG,CATLG)
/*
//*------------------------------------------------------
//* Create member of input data set.
//*------------------------------------------------------
//FILLCNTL EXEC PGM=IEBUPDTE
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=JULTU103.TCASE.DATA3,DISP=OLD
//SYSUT2 DD DSN=JULTU103.TCASE.DATA3,DISP=OLD
//SYSIN DD DATA
./ ADD NAME=MEM1
LISTDEF NAME2 INCLUDE TABLESPACE DBLT0302.TLLT032A
INCLUDE TABLESPACE DBLT0302.TSLT032B
INCLUDE TABLESPACE DBLT0302.TPLT032C
./ ENDUP
/*
//QUIESCE JOB 'USER=NAME',CLASS=A,...
//*******************************************************
//* QUIESCE LISTDEF DD LILSTDEF data sets
//*******************************************************
//STEP1 EXEC DSNUPROC,UID='JULTU103.QUIESC2',
// UTPROC='',SYSTEM='SSTR'
//LISTLIB DD DSN=JULTU103.TCASE.DATA2,DISP=SHR
// DD DSN=JULTU103.TCASE.DATA3(MEM1),DISP=SHR
//SYSIN DD *
OPTIONS LISTDEFDD LISTLIB
LISTDEF NAME3 INCLUDE LIST NAME1
INCLUDE LIST NAME2
EXCLUDE TABLESPACE DBLT0302.TSLT032B
EXCLUDE TABLESPACE DBLT0301.TSLT031B
EXCLUDE TABLESPACE DBLT0302.TPLT032C
QUIESCE LIST NAME3
/*
Example 8: Defining a list that includes related objects
The following LISTDEF control statement defines a list (EXAMPLE8) that includes table space DBLT0101.TPLT011C and all objects that are referentially related to it. Only base table spaces are included in the list. The subsequent RECOVER utility control statement specifies that all objects in the EXAMPLE8 list are to be recovered.
//STEP2 EXEC DSNUPROC,UID='JULTU101.RECOVE5',
// UTPROC='',SYSTEM='SSTR'
//SYSIN DD *
LISTDEF EXAMPLE8 INCLUDE TABLESPACE DBLT0101.TPLT011C RI BASE
RECOVER LIST EXAMPLE8
/*
Example 9: Defining a list of cloned data
- Clone tables
- Table spaces that contain clone tables
- Indexes on clone tables
- Index spaces that contain indexes on clone tables
LISTDEF REORG_TBSP INCLUDE TABLESPACE DB42240*.T*
CLONED YES
EXCLUDE TABLESPACE DB42240*.TL4224L*
EXCLUDE TABLESPACE DB42240*.TL4224B*
EXCLUDE TABLESPACE DB42240*.TL4224C*
EXCLUDE TABLESPACE DB42240*.TL4224D*
EXCLUDE TABLESPACE DB42240*.TL4224E*
EXCLUDE TABLESPACE DB42240*.TL4224F*
EXCLUDE TABLESPACE DB422401.TSHR5702