Data set naming conventions
When you define a data set, you must name it in the correct format.
The name of a data set has the following format:
catname.DSNDBx.dbname.psname.y0001.znnn
- catalog-name
- The catalog name or alias.
The data sets are VSAM linear data sets cataloged in the integrated catalog facility catalog that catalog-name identifies. For more information about catalog-name values, see Naming conventions in SQL.
Use the same name or alias here as in the USING VCAT clause of the CREATE TABLESPACE and CREATE INDEX statements.
- x
- C (for VSAM clusters) or D (for VSAM data components).
- dbname
- Db2 database name. If the data set is for a table space, dbname must be the name given in the CREATE TABLESPACE statement. If the data set is for an index, dbname must be the name of the database containing the base table. If you are using the default database, dbname must be DSNDB04.
- psname
- Table space name or index name. This name must be unique within the database.
You use this name on the CREATE TABLESPACE or CREATE INDEX statement. (You can use a name longer than eight characters on the CREATE INDEX statement, but the first eight characters of that name must be the same as in the psname for that data set.)
- y0001
- Instance qualifier for the data set.
If you plan to run any of the following utilities, define two data sets, one data set with a value of I for y, and one with a value of J for y:
- LOAD REPLACE SHRLEVEL REFERENCE
- REORG with SHRLEVEL CHANGE or SHRLEVEL REFERENCE
- CHECK DATA with SHRLEVEL REFERENCE
- CHECK INDEX with SHRLEVEL REFERENCE
- CHECK LOB with SHRLEVEL REFERENCE
Otherwise, define one data set for the table space or index with a value of I for y.
Tip: Instance numbers for cloned tables before and after an exchange: The instance numbers in the underlying VSAM data set names for the objects (tables and indexes) in a clone relationship toggle in the range 1–2. For example, suppose that a base table exists with the data set name *I0001.*. When the table is cloned, the clone's data set is initially named *.I0002.*. After an exchange, the base objects are named *.I0002.* and the clones are named *I0001.*. Each time that an exchange happens, the instance numbers that represent the base and the clone objects change. - znnn
- Data set number. The first digit z of the data set number is represented by the letter A, B, C, D, or E, which corresponds to the value 0, 1, 2, 3, or 4 as the first digit of the partition number.
For partitioned table spaces, if the partition number is less than 1000, the data set number is Annn in the data set name (for example, A999 represents partition 999). For partitions 1000 to 1999, the data set number is Bnnn (for example, B000 represents partition 1000). For partitions 2000 to 2999, the data set number is Cnnn. For partitions 3000 to 3999, the data set number is Dnnn. For partitions 4000 up to a maximum of 4096, the data set number is Ennn.
The naming convention for data sets that you define for a partitioned index is the same as the naming convention for other partitioned objects.
For simple or segmented (non-UTS) table spaces, the number is 001 (preceded by A) for the first data set. When little space is available, Db2 issues a warning message. If the size of the data set for a simple or a segmented (non-UTS) table space approaches the maximum limit, define another data set with the same name as the first data set and the number 002. The next data set will be 003, and so on.
You can reach the VSAM extent limit for a data set before you reach the size limit for a partitioned or a nonpartitioned table space. If this happens, Db2 does not extend the data set.