Hints and tips for specifying control statements

The Smart Reorg utility provides control statements that automate the operations and reduce your manual efforts.

How to stop the database automatically

When you run a Smart Reorg job in Conditional Reorganization mode, in Reorganization Diagnosis mode, or in Unconditional Reorganization mode, you must take the database offline or put it in read-only mode before you run the job. You can specify the Reorganization Manager of the Parallel Reorganization Service to take the database offline automatically by specifying either of the following options in the JCL:

  • IMSCMD=YES

    If you specify IMSCMD=YES,TOSI, the /DBD or the /DBR command is issued by IMS Database Reorganization Expert automatically. For details, see IMSCMD control statement.

  • DBRCAUTHCMD=YES

    If you specify DBRCAUTHCMD=YES, the CHANGE.DB NOAUTH or the CHANGE.DB READON command is issued by IMS Database Reorganization Expert automatically. For details, see DBRCAUTHCMD control statement.

In both cases, by default, the Smart Reorg job is stopped if IMS Database Reorganization Expert fails to get the required authorization by issuing the IMS command. If you want IMS Database Reorganization Expert to obtain an operator's response, specify AUTHFAIL=WTOR.

Note: If you specify AUTHFAIL=WTOR and you have not issued the /DBDUMP or the /DBRECOVERY command, IMS Database Reorganization Expert issues an operator message that notifies which command must be issued to which database.

How to build secondary indexes within reorganization job step

To build secondary indexes during a reorganization, specify the INDEXBLD=YES control statement. If INDEXBLD=YES, DASD space for the output secondary index data sets must also be allocated in the IDCAMS step. For more information, see INDEXBLD control statement. For partitioned secondary indexes, specify PSINDEXBLD=YES. For more information, see PSINDEXBLD control statement.

How to take image copies within reorganization job step

You can specify IC=YES so that the image copy processing can be completed within the Smart Reorg job step. Control statements for Image Copy processing and HASH pointer checking must be specified in the ICEIN data set.

How to automate name swapping

The name swapping processing swaps the names of the shadow database and the original database after a successful reorganization. This is one of the post-reorganization processing steps. You can automate this step by specifying NAMESWAP=YES. For more information, see NAMESWAP control statement.

You can also select the action that the Smart Reorg utility takes in case name swapping failure occurs by specifying the NAMESWAPFAIL control statement. For more information, see NAMESWAPFAIL control statement.

How to automate DBRC notification processing

The DBRC notification processing notifies DBRC about the reorganization. This step is one of the post-reorganization processing steps. You can automate this step by specifying NAMESWAP=YES. For details, see NAMESWAP control statement.

How to process a database that has logical relationships

For a database that has logical relationships, you must run the IMS Prefix Resolution and Prefix Update utilities after the Smart Reorg job step.

The following guidelines describe how to run the post-reorganization processing automatically:
  • For a HISAM, HDAM, or HIDAM database that has no secondary indexes and no logical relationships, specify NAMESWAP=YES.
  • For a HISAM, HDAM, or HIDAM database that has secondary indexes, specify INDEXBLD=YES and NAMESWAP=YES.
  • For an HDAM or HIDAM database that has only internal logical relationships, specify PREFIXRES=YES and NAMESWAP=YES.
  • For a PHDAM or PHIDAM database, specify ILDSBLD=YES, which is the default, and specify NAMESWAP=YES.

How to restart the database automatically

After a database is reorganized, you must start the database to make it active. You can automate this step by specifying the STARTDB=YES option. For details, see STARTDB control statement.

When processing HALDB partitions

Specifying the target partition
You must specify the name of the partition and the number of partitions to reorganize by coding the PARTITION control statement. For details, see PARTITION control statement.
Building ILDS within reorganization job step
To build indirect list data sets (ILDS) for one or more HALDB partitions during the reorganization, specify the ILDSBLD=YES control statement. If ILDSBLD=NO is specified, a DASD space for the shadow ILDS must be allocated for each partition. For details, see ILDSBLD control statement.
Requirement: You must do these tasks manually if any automatic processing fails.