Syntax and options of the LISTDEF control statement
The LISTDEF utility control statement, with its multiple options, defines a list of table spaces, index spaces, or both on which other utilities can operate.
You can create a control statement with the ISPF/PDF edit function. After you create it, save it in a sequential or partitioned data set. When you create the JCL for running the job, use the SYSIN DD statement to specify the name of the data set that contains the utility control statement.
Syntax diagram
- 1 You must specify TABLESPACES or INDEXESPACES if you specify DATABASE.
- 2 HISTORY or ARCHIVE can be specified either before or after the BASE, LOB, XML, and ALL keywords. However, HISTORY and ARCHIVE are always processed last, after all other keywords are handled.
Option descriptions
- LISTDEF list-name
- Defines a list of Db2 objects and
assigns a name to the list. The list name makes the list available for subsequent execution as the
object of a utility control statement or as an element of another LISTDEF statement.
list-name is the name (up to 18 alphanumeric characters in length) of the defined list.
list-name cannot be a utility keyword name.
You can put LISTDEF statements either in a separate LISTDEF library data set or before a Db2 utility control statement that references the list-name.
- INCLUDE
- Specifies that the list
of objects that results from the expression that follows is to be added to the list. You must first
specify an INCLUDE clause. You can then specify subsequent INCLUDE or EXCLUDE clauses in any order
to add to or delete clauses from the existing list.
Referencing a large number of databases in a single LISTDEF list might fill the EDM DBD pool and result in an abend 04E with reason code 00C90089. If this situation occurs, decrease the number of databases that are referenced in the LISTDEF statement. If this condition occurs frequently, increase the size of your EDM DBD pool.
Related information: - EXCLUDE
- Specifies, after the initial INCLUDE clause, a list of objects to exclude. The expression that follows the EXCLUDE keyword determines this list of objects to exclude. These objects are excluded from the existing LISTDEF list if the objects are already in the list. If the objects are not in the existing list, they are ignored, and Db2 proceeds to the next INCLUDE or EXCLUDE clause.
- TABLESPACES
- Specifies that the
INCLUDE or EXCLUDE object expression is to create a list of related table spaces.
TABLESPACES is the default type for lists that use a table space or a table for the initial search. For more information about specifying these objects, see the descriptions of the TABLESPACE and TABLE options.
No default type value exists for lists that use other lists for the initial search. The list that is reference in the LIST option is used unless you specify TABLESPACES or INDEXSPACES. Likewise, no type default value exists for lists that use databases for the initial search. If you specify the DATABASE option, you must specify INDEXSPACES or TABLESPACES. For more information about specifying lists and databases, see the descriptions of the LIST and DATABASE options.
The result of the TABLESPACES keyword varies depending on the type of object that you specify in the INCLUDE or EXCLUDE clause. These results are shown in The following table.
Table 1. Result of the TABLESPACES keyword based on the object type that is specified in the INCLUDE or EXCLUDE clause. Object type that is specified in INCLUDE or EXCLUDE clause Result of the TABLESPACES keyword DATABASE Returns all table spaces that are contained within the database TABLESPACE Returns the specified table space TABLE Returns the table space that contains the table INDEXSPACE Returns the table space that contains the related table INDEX Returns the table space that contains the related table LIST of table spaces Returns the table spaces from the expanded referenced list LIST of index spaces Returns the related table spaces for the index spaces in the expanded referenced list LIST of table spaces and index spaces Returns the table spaces from the expanded referenced list and the related table spaces for the index spaces in the same list - INDEXSPACES
- Specifies that the INCLUDE or EXCLUDE
object expression is to create a list of related index spaces.
INDEXSPACES is the default type for lists that use an index space or an index for the initial search. For more information about specifying these objects, see the descriptions of the INDEXSPACE and INDEX options.
No default type value exists for lists that use other lists for the initial search. The list that is referenced in the LIST option is used unless you specify TABLESPACES or INDEXSPACES. Likewise, no type default value exists for lists that use databases for the initial search. If you specify the DATABASE option, you must specify INDEXSPACES or TABLESPACES. For more information about specifying lists and databases, see the descriptions of the LIST and DATABASE options.
The result of the INDEXSPACES keyword varies depending on the type of object that you specify in the INCLUDE or EXCLUDE clause. These results are shown in The following table.
Table 2. Result of the INDEXSPACES keyword based on the object type that is specified in the INCLUDE or EXCLUDE clause. Object type that is specified in INCLUDE or EXCLUDE clause Result of the INDEXSPACES keyword DATABASE Returns all index spaces that are contained within the database TABLESPACE Returns all index spaces for indexes over all tables in the table space TABLE Returns all index spaces for indexes over the table INDEXSPACE Returns the specified index space. INDEX Returns the index space that contains the index LIST of table spaces Returns the related index spaces for the table spaces in the expanded referenced list LIST of index spaces Returns the index spaces from the expanded referenced list LIST of table spaces and index spaces Returns the index spaces from the expanded referenced list and the related index spaces for the table spaces in the same list - COPY
- Specifies whether indexes with
COPY YES or COPY NO attributes are to be included or excluded in this portion of the list. If you
omit COPY, all index spaces that satisfy the INCLUDE or EXCLUDE expression, regardless of their COPY
attribute, are included or excluded in this portion of the list. If specified, this keyword must
immediately follow the INDEXSPACES keyword. If you specify this keyword elsewhere, it is interpreted
as the start of the COPY utility control statement.
- YES
- Specifies that only index spaces that were defined with or altered to COPY YES are to be included in this portion of the list. Use INCLUDE with COPY YES to develop a list of index spaces that the COPY utility can process.
- NO
- Specifies that only index spaces that were defined with or altered to COPY NO are to be included in this portion of the list. Use EXCLUDE with COPY NO to remove indexes that the COPY utility cannot process from a larger list.
- LIST referenced-list
- Specifies the name of a
previously defined object list that is to be expanded and used for the initial search for the
object.
referenced-list is the name of the list. You must explicitly specify this name. You cannot specify pattern-matching characters (%,*, ?, and _) for lists.
No default type value exists for lists that are developed from the LIST option. The list is expanded as defined, and it is then modified by subsequent keywords, if any.
You can specify a type-spec of TABLESPACES to create a list of only table spaces. If the list to be processed contains index spaces, the TABLESPACES keyword creates a list that includes related table spaces.
You can specify a type-spec of INDEXSPACES to create a list of only index spaces. If the list to be processed contains table spaces, the INDEXSPACES keyword creates a list that includes related index spaces.
You can use the LIST keyword to perform any of the following actions:- Make aggregate lists of lists
- Exclude entire lists from other lists
- Develop lists of objects that are related to other lists
The partitions or partition ranges can be specified in a list.
- DATABASE database-name
- Specifies the database
that is to be used for the initial search for the object.
You can specify the database-name explicitly or as a pattern-matched name.
DATABASE *
andDATABASE %
are not supported.If you specify DATABASE, you must also specify either TABLESPACES or INDEXSPACES as the list type. Depending on the list type that you specify, Db2 includes all table spaces or index spaces in database-name that satisfy the pattern-matching expression in the list.
You cannot specify DSNDB01, DSNDB06, DSNDB07, or user-defined work file databases in a LISTDEF.
Use caution when you specify an implicit DATABASE name. Authorization to access objects that are within an implicit database is not uniform. Use the OPTIONS EVENT (ITEMERROR, SKIP) control statement to continue processing when authorization errors occur.
- TABLESPACE database-name.table-space-name
- Specifies the table
space that is to be used for the initial search for the object.
If you specify TABLESPACE, the default list type is TABLESPACES. All table spaces that satisfy the pattern-matching expression are included in the list unless the list is modified by other keywords.
TABLESPACE *.*
andTABLESPACE %.%
are not supported.database-name specifies the name of the database to which the table space belongs. The default value is DSNDB04.
table-space-name specifies the name of the table space.
You can explicitly specify or use pattern-matching characters to specify database-name, table-space-name, or both. Pattern-matching is not supported for DSNDB01 and DSNDB06 objects.
You cannot include any objects in DSNDB07 or any user-defined work file databases in a LISTDEF.
- INDEXSPACE database-name.index-space-name
- Specifies the index
space that is to be used for the initial search for the object.
If you specify INDEXSPACE, the default list type is INDEXSPACES. All index spaces that satisfy the pattern-matching expression are included in the list unless the index spaces are excluded by other LISTDEF options.
INDEXSPACE *.*
andINDEXSPACE %.%
are not supported.database-name specifies the name of the database to which the index space belongs. The default value is DSNDB04.
index-space-name specifies the name of the index space.
You can explicitly specify or use pattern-matching characters to specify database-name, index-space-name, or both. Pattern-matching is not supported for DSNDB01 and DSNDB06 objects.
You cannot include any objects in DSNDB07 or any user-defined work file databases in a LISTDEF.
- TABLE creator-id.table-name
- Specifies the table that is
to be used for the initial search for the object.
If you specify TABLE, the default list type is TABLESPACES. All table spaces that contain tables that satisfy the pattern-matching expression are included in the list unless the list is modified by other keywords.
TABLE *.*
andTABLE %.%
are not supported.creator-id specifies the qualifier creator ID for the table. The default value is the user identifier for the utility. table-name specifies the name of the table. If you specify a table name with CLONED, the CLONED keyword is ignored.
You can explicitly specify or use pattern-matching characters to specify creator-id,table-name, or both. However, the underscore pattern-matching character is ignored in a table name.
Enclose the table name in quotation marks if the name contains a blank.
Catalog and directory tables cannot be specified
- INDEX creator-id.index-name
- Specifies the index that is
to be used for the initial search for the object.
If you specify INDEX, the default list type is INDEXSPACES. All index spaces that contain indexes that satisfy the pattern-matching expression are included in the list unless the list is modified by other keywords.
INDEX *.*
andINDEX %.%
are not supported.creator-id specifies the qualifier creator ID for the index. The default value is the user identifier for the utility.
index-name specifies the name of the index.
Enclose the index name in quotation marks if the name contains a blank.
You can explicitly specify or use pattern-matching characters to specify creator-id, index-name, or both. However, the underscore pattern-matching character is ignored in an index name.
- PARTLEVEL
- Specifies the partition granularity
for partitioned table spaces, partitioning indexes, and data-partitioned secondary indexes that are
to be contained in the list. You cannot specify the PARTLEVEL keyword with the RI keyword.
- (integer)
- integer
is the physical partition number where integer >= 0.
If you specify PARTLEVEL 0, the resulting list contains one entry for each nonpartitioned object.
If you specify PARTLEVEL with a nonzero operand, the resulting list contains one entry for the specified partition for partitioned objects and one entry for each nonpartitioned object.
If you specify PARTLEVEL without (integer), the resulting list contains one entry for each partition in the partitioned object and one entry for each nonpartitioned object.
- (integer1:integer2)
Designates a range of partitions to be specified in the list. integer1 and integer2 are physical partition numbers and must be greater than 1. You can specify the range in any order. For example, you can specify (100:199) or (199:100). In either case, partitions 100 through 199 are specified in the list. If integer1 is equal to integer2, only that one partition is specified. For example, if you specify (5:5), only partition 5 is specified.
An INCLUDE with the PARTLEVEL keyword can be removed from the list only by an EXCLUDE with PARTLEVEL.
For partition-by-growth objects, the PARTLEVEL keyword results in an entry for each partition that exists when the LISTDEF list is evaluated. Partitions that are added after the list is evaluated are not included in the list. If a partition is added during long-running job steps in which the list is reused, the partitions that were added are not included in the list and not processed. If a utility job that uses a PARTLEVEL list is restarted, the original list is saved during the original execution for a later restart. The list does not include any added partitions.
- CLONED
- Use the CLONED keyword to
have LISTDEF perform a final filtering of the INCLUDE or EXCLUDE clause contents based on the
existence or absence of clone data. This operation is performed last, after LISTDEF processes all
other keywords on the INCLUDE or EXCLUDE clause.
CLONED YES specifies that only table spaces and index spaces that contain cloned objects are to be returned in the INCLUDE or EXCLUDE clause. CLONED NO specifies that only table spaces and index spaces that do not contain cloned objects are to be returned in the INCLUDE or EXCLUDE clause. Omit the CLONED keyword if the existence of clone data is not a factor.
The use of CLONED YES or CLONED NO affects only the contents of the list. It does not determine whether clone or base data is later processed by the utility that uses the list. Only the presence or absence of the CLONE keyword on individual utility control statements determines whether clone or base data is processed.
- DEFINED
- Specifies whether table spaces or index spaces with defined or undefined data sets are to be returned in the INCLUDED or EXCLUDE clause. If you omit the DEFINED keyword, DEFINED YES is the default.
- RI
- Specifies that all objects that are referentially related to the object expression (PRIMARY KEY <--> FOREIGN KEY) are to be included in the list. Db2 processes all referential relationships repeatedly until the entire referential set is developed. You cannot specify RI with PARTLEVEL(n).
Auxiliary indicator keywords: Use one of four auxiliary indicator keywords to direct LISTDEF processing to follow auxiliary relationships to include related LOB or XML objects in the list. The auxiliary relationship can be followed in either direction. Auxiliary objects include the auxiliary table spaces, auxiliary tables, indexes on auxiliary tables, and their containing index spaces.
Incomplete LOB or XML definitions cause seemingly related objects to not be found. The auxiliary relationship does not exist until you create the AUX TABLE with the STORES keyword.
No default auxiliary indicator keyword exists. If you do not specify BASE, LOB, XML, or ALL, Db2 does not follow the auxiliary relationships.
- ALL
- Specifies that BASE, LOB, and
XML objects are to be included in the list. Auxiliary relationships are followed from all
objects that result from the initial object lookup. BASE, LOB, and XML objects remain in the
final enumerated list.
Any implicitly created LOB auxiliary indexes are not included in (or excluded from) the list when the INCLUDE (or EXCLUDE) clause specifies a base table name that has a LOB column and the ALL option. These implicit indexes are created by Db2 when an index is not explicitly created for a LOB column. They are created with a Db2-generated table name that is different from the base table name. Therefore, when your LISTDEF statement requests a list of indexes (with the INDEXSPACES option) and the INCLUDE (or EXCLUDE) clause specifies a base table name that has a LOB column and the ALL option, and no other index exists for any column on the base table name, the list will not include (or exclude) the LOB auxiliary index space, because the auxiliary table name differs.
The behavior of the ALL keyword is altered by the presence or absence of the HISTORY or ARCHIVE keywords. When ALL is specified with HISTORY, the resulting list clause contains all related history objects. When ALL is specified with ARCHIVE, the resulting list clause contains all related archive objects (table spaces and index spaces that contain archive tables and their related indexes). When ALL is specified without HISTORY or ARCHIVE, the resulting list clause contains all related objects that are not history or archive objects.
- BASE
- Specifies that only base
table spaces (non-LOB, non-XML) and index spaces are to be included in this element of the list. If
the result of the initial search for the object is a base object, auxiliary relationships are not
followed. If the result of the initial search for the object is a LOB or XML object, the auxiliary
relationship is applied to the base table space or index space. Only those base objects become part
of the resulting list.
The behavior of the BASE keyword is altered by the presence or absence of the HISTORY or ARCHIVE keywords. When BASE is specified with HISTORY, the resulting list clause contains only base history objects. When BASE is specified with ARCHIVE, the resulting list clause contains only base archive objects (base table spaces and index spaces that contain archive tables and their related indexes). When BASE is specified without HISTORY or ARCHIVE, the resulting list clause contains only base objects that are not history or archive objects.
- LOB
- Specifies
that only LOB table spaces and related index spaces that contain indexes on auxiliary tables are to
be included in this element of the list. If the result of the initial search for the object is a LOB
object, auxiliary relationships are not followed. If the result of the initial search for the object
is a base object, the auxiliary relationship is applied to the LOB table space or index space. Only
those LOB objects become part of the resulting list.
The behavior of the LOB keyword is altered by the presence or absence of the HISTORY or ARCHIVE keywords. When LOB is specified with HISTORY, the resulting list clause contains only LOB history objects (LOB table spaces and index spaces for history tables). When LOB is specified with ARCHIVE, the resulting list clause contains only LOB archive objects (LOB table spaces and index spaces for archive tables). When LOB is specified without HISTORY or ARCHIVE , the resulting list clause contains only LOB objects that are not history or archive objects.
- XML
- Specifies that only XML table
spaces and related index spaces that contain indexes on auxiliary tables are to be included in this
element of the list. If the result of the initial search for the object is an XML object, auxiliary
relationships are not followed. If the result of the initial search for the object is a base object,
the auxiliary relationship is applied to the XML table space or index space. Only those XML objects
become part of the resulting list.
The behavior of the XML keyword is altered by the presence or absence of the HISTORY or ARCHIVE keywords. When XML is specified with HISTORY, the resulting list clause contains only XML history objects (XML table spaces and index spaces for history tables). When XML is specified with ARCHIVE, the resulting list clause contains only XML archive objects (XML table spaces and index spaces for archive tables). When XML is specified without HISTORY or ARCHIVE, the resulting list clause contains only XML objects that are not history or archive objects.
- HISTORY
- Specifies that only
history (versioning) objects are to be included in the resulting list clause.
HISTORY is a filtering keyword that operates against the list clause contents after other keywords are applied. Use the keywords BASE, LOB, XML, or ALL with or without the HISTORY keyword to reference related objects. The order in which these keywords are specified has no meaning. Two INCLUDE or EXCLUDE clauses are required if both history and non-history objects are required.
- ARCHIVE
- Specifies that only
archive objects are to be included in the resulting list clause.
ARCHIVE is a filtering keyword that operates against the list clause contents after other keywords are applied. Use the BASE, LOB, XML, or ALL keywords with or without the ARCHIVE keyword to reference related objects. The order in which these keywords are specified has no meaning. Two INCLUDE or EXCLUDE clauses are required if both archive and non-archive objects are required.
ARCHIVE cannot be specified with the HISTORY or CLONED YES keywords
Related information: - BASIC
- Specifies that LISTDEF is to
perform a final filtering of the INCLUDE or EXCLUDE clause contents based on the basic format with
6-byte RBA or LRSN values. This operation is performed last, after LISTDEF processes all other
keywords on the INCLUDE or EXCLUDE clause.
- YES
- Specifies that only table spaces and index spaces that are in basic format with 6-byte RBA or LRSN values are to be returned in the INCLUDE or EXCLUDE clause. This option is the same as EXTENDED NO.
- NO
- Specifies that only table spaces and index spaces that are not in basic format with 6-byte RBA or LRSN values format are to be returned in the INCLUDE or EXCLUDE clause. This option is the same as EXTENDED YES.
If the clause also includes the PARTLEVEL keyword with either a non-zero operand or no operand, filtering is performed based on the RBA or LRSN format of the partition. If partitioned objects have partitions in different formats, PARTLEVEL must specify a non-zero operand or no operand to use BASIC or EXTENDED.
- EXTENDED
- Specifies that LISTDEF is
to perform a final filtering of the INCLUDE or EXCLUDE clause contents based on the extended format
with 10-byte RBA or LRSN values. This operation is performed last, after LISTDEF processes all other
keywords on the INCLUDE or EXCLUDE clause.
- YES
- Specifies that only table spaces and index spaces that are in extended format with 10-byte RBA or LRSN values are to be returned in the INCLUDE or EXCLUDE clause. This option is the same as BASIC NO.
- NO
- Specifies that only table spaces and index spaces that are not in extended format with 10-byte RBA or LRSN values format are to be returned in the INCLUDE or EXCLUDE clause. This option is the same as BASIC YES.
If the clause also includes the PARTLEVEL keyword with either a non-zero operand or no operand, filtering is performed based on the RBA or LRSN format of the partition. If partitioned objects have partitions in different formats, PARTLEVEL must specify a non-zero operand or no operand to use BASIC or EXTENDED.