Considerations for database data sets

Reorganization Manager of the Smart Reorg utility uses database data sets and DD names in specific ways. This topic helps you build your JCL correctly.

The following items are discussed in this topic:

  • How to specify DD names and data set names of original data sets and shadow data sets1 for database and primary index.
  • How to specify DD names and data set names for secondary indexes to be built by the Index Builder task.
  • How the names of the output data sets2 for a database are determined and how they are allocated dynamically.
  • Restrictions on data set names.
  • Data set names after reorganization.
  • Deleting original data sets.

See also NAMESWAP control statement.

Subsections:

Database, primary index, and ILDS

For all database data sets, regardless of the NAMESWAP option, the original_dbds DD names defined by the DBD are used to specify the original (disorganized) input data sets. The shadow DD names defined by DDNMAP control statements are used to specify the shadow (reorganized) data sets.

An HDAM database requires at least two unique DD names and two unique data set names: that is, a DD name and a data set name are required for each data set group for input and shadow database.

A HIDAM database requires at least four DD names and four data set names: that is, a DD name and a data set name are required for primary index and each data set group for input and shadow database.

A HISAM database requires at least four DD names and four data set names: that is, the primary data sets for input and shadow databases require a DD name and a data set name, and so do the overflow data sets for input and shadow databases.

A SHISAM database and root-only HISAM require at least two DD names and two data set names: that is, the primary data sets for input and shadow databases require a DD name and a data set name.

If the database contains multiple data set groups, each data set group requires two pairs of DD names and data set names, one for the input and the other for the shadow.

A PHDAM database requires at least three unique DD names and three unique data set names for each partition to be reorganized: that is, for each input and shadow partition, a DD name and a data set name are required for each data set group; and for each input partition, a DD name and a data set name are required for the indirect list data set (ILDS).

A PHIDAM database requires at least four DD names and four data set names for each partition to be reorganized: that is, for the primary index and each data set group, a DD name and a data set name are required for each input and shadow partition.

If a logical parent of a unidirectional logical relationship, a bidirectional logical relationship, or a partitioned secondary index is defined for the database, a DD name and a data set name are required for the shadow ILDS. To process ILDS properly, either of the following conditions must be met:
  • Dynamic allocation of shadow data sets is designated and all shadow ILDS exist.
  • The shadow ILDS of all partitions that are to be reorganized are specified in the JCL stream.
If either of the conditions is met and also if ILDSBLD=YES is specified, the Smart Reorg utility always initializes the shadow ILDS. Furthermore, if NAMESWAP=YES is specified, the Smart Reorg utility does name swapping between the original ILDS and the shadow ILDS.

If multiple data set groups are defined for PHDAM or PHIDAM, each data set group of each partition needs two pairs of DD names and data set names, one for the input and the other for the shadow.

By default, the original database data sets and the shadow database data sets are allocated dynamically. For details, see Dynamic allocation of original and shadow data sets. For how the DD names for shadow data sets are determined, see DDNMAP control statement.

IBM® recommends that you have IMS Database Reorganization Expert allocate input and shadow database data sets dynamically. Original data sets of HALDB partitions are always allocated dynamically.

For how the DD names of shadow data sets for non-HALDB are determined, see DDNMAP control statement. The following table shows how the DD names of shadow data sets for a HALDB partition are determined. Note that for an online reorganization capable HALDB partition, the shadow DD names are determined by whichever the data sets are active.

Table 1. DD name suffixes of shadow data sets for a HALDB partition
Data set type DD name suffix for the data set
When A-J and X side is active When M-V and Y side is active
Original data set Shadow data set Original data set Shadow data set
DSG A A M M A
DSG B B N N B
DSG C C O O C
DSG D D P P D
DSG E E Q Q E
DSG F F R R F
DSG G G S S G
DSG H H T T H
DSG I I U U I
DSG J J V V J
ILDS L Z L Z
PINDEX X Y Y X
Note: DSG denotes the data set group, ILDS is the indirect list data set, and PINDEX is the primary index.

Secondary indexes

Secondary indexes can be created during parallel reorganization of a database by specifying INDEXBLD=YES or PSINDEXBLD=YES.

If INDEXBLD=YES or PSINDEXBLD=YES is specified, the secondary index data sets are allocated dynamically by default. If DYNALLOC=(xxx,xxx,NO) is specified, you must code the DD statements for the secondary indexes in the job step. Use the DD names that are defined in the DBD. The secondary index data sets must be reusable or empty.

The data set names to be specified for the DD names depend on the DBSHARE option:
  • If you specify DBSHARE=YES, specify new names other than the current (original) names that are already registered to DBRC. In this case, you must specify INDEXBLD=YES,NEW.
  • If you specify DBSHARE=NO, specify either the new names or the current names. If you want to rebuild secondary indexes in new data sets, specify INDEXBLD=YES,NEW; if you want to rebuild in the current data sets, specify INDEXBLD=YES,CURRENT.

If you specify NAMESWAP=YES and INDEXBLD=YES,NEW, the data set names are swapped after rebuilding the secondary indexes; that is, the output secondary indexes are renamed to the original names and the original secondary indexes are renamed to temporary names. If the original data set does not exist, only the cluster names are renamed but the component names are not renamed. Regardless of whether the component names are renamed, you can get access to the database. If you need to rename the component names, see Performing manual name swapping.

If you have deleted an original secondary index database data set before running IMS Database Reorganization Expert, IBM recommends that you reallocate the original secondary index database data set, and run IMS Database Reorganization Expert with INDEXBLD=YES,CURRENT. Name swapping is not needed for secondary indexes. In that case, if you want to cancel the reorganization processing, you must either build these secondary indexes or recover them for fallback of the database into the prereorganization status.

If you specify to allocate secondary index data sets dynamically, new data set names are determined automatically from the data set names defined in the DFSMDA members. For PSINDEXes, the data set names that are defined in the RECON data sets are used. For more information, see Dynamic allocation of original and shadow data sets and DYNALLOC control statement.

IBM recommends specifying that the data sets for secondary indexes be allocated dynamically.

Dynamic allocation of original and shadow data sets

The way in which original and shadow data sets for database and indexes are allocated is determined by the DYNALLOC control statement. The DASD space for shadow data sets is allocated by the SPACEALLOC control statement.

By default, the original database data sets of HISAM, SHISAM, HDAM, or HIDAM are allocated by using DFSMDA members. If DBRC is active, all databases including the primary index and the secondary indexes must be registered in RECON unless you disable the DYNALLOC option. If DBRC is active and DYNALLOC=(YES,xxx,xxx) is specified, the integrity of the data set names defined in DFSMDA members and those registered in DBRC is checked before the reorganization starts.

For a HALDB, the data sets of PHDAM or PHIDAM partition are always allocated dynamically by using RECON registration, not before the reorganization starts, but when the partition is first accessed.

By default, shadow data sets are allocated dynamically. For a non-partitioned database, the names of the shadow data sets are determined automatically. The shadow name consists of the name of the corresponding original input data set followed by a suffix (the default is .Z). For example, suppose your original data set is named IMS.TESTDB01. By default, the shadow data set is named IMS.TESTDB01.Z. If you specify DYNALLOC=,A, the shadow data set is named IMS.TESTDB01.A. You can specify any alphabetic character except T as the suffix. The same rule also applies to the shadow primary index of HIDAM database, shadow secondary index, and shadow indirect list data set of PHDAM or PHIDAM.

If the A-through-J and X data sets of PHDAM or PHIDAM partition are active, the same naming rule as the one applied to non-partitioned database is applied. If the M-through-V and Y data sets of PHDAM or PHIDAM partition are active, the shadow data set name for the partition is determined by the names of A-through-J and X data sets. For example, if your original data set name of DSG A is IMS.TESTDB01.M0001, the default shadow data set name is IMS.TESTDB01.A0001.Z (the corresponding A-side data set name IMS.TESTDB01.A0001 suffixed with .Z). And, by the name swapping process, the shadow data set is renamed to the A-side data set name IMS.TESTDB01.A0001. The original data set IMS.TESTDB01.M0001 is not renamed but remain as it is.

If both SPACALLOC=YES and the DDEFPDS2 DD statement are specified, this naming convention for shadow data sets does not apply. The names of shadow data sets are determined from the information defined in the DDEFPDS2 data set. For details, see SPACEALLOC control statement.

For details about dynamic allocation of original and shadow data sets, see DYNALLOC control statement and SPACEALLOC control statement. For details about data set name swapping, see NAMESWAP control statement.

Note: For VSAM data sets, .Z is not required for component names but it is required for the cluster name.

Restrictions on data set names

If you enable dynamic allocation or NAMESWAP=YES, the name of each original data set must contain 42 or fewer characters. For a VSAM data set, this restriction applies to both the cluster name and its component names. It is the user's responsibility to make sure that any data set name created by Reorganization Manager, when dynamic allocation is used or NAMESWAP=YES is specified, does not conflict with any existing data set name or cluster name.

Data sets after reorganization

If you specify NAMESWAP=YES, the names of the primary database and primary index data sets and the names of shadow ones are swapped. The secondary index databases are swapped only if the IMS Index Builder task is activated and the data set specified for the DD name of the secondary index is different from what is registered to DBRC.

For a non-partitioned database and PHDAM and PHIDAM partition whose A-through-J and X data sets are active, each original data set name, including the VSAM component name, is renamed to the original name plus suffix .T. For details about the name swapping process, see NAMESWAP control statement.

For PHDAM and PHIDAM partitions whose M-through-V and Y data sets are active, the original data sets are not renamed and remain as they are. In this case, shadow data sets are renamed to A-through-J and X data set names. If A-through-J and X data sets exist, shadow data sets are swapped with A-through-J and X data sets.

Renamed original data sets can be deleted or renamed to shadow data set names. For more information, see DISPOLDDS control statement.

In case name swapping fails, if you had specified NAMESWAPFAIL=BACKOUT, the data set names are restored to the names the data set had when the name swapping process started. For details, see NAMESWAPFAIL control statement.

You can see how the data sets were renamed by the Smart Reorg utility by checking the Result of Name Swapping report. See Result of Name Swapping report.

1 The term shadow data sets means the data sets in which the Reload task loads segments or the index builder loads index records.
2 In this information, the term output data sets means the database data sets or index data sets that are generated as a result of reorganization.