About the redefine Command

You will be prompted to run the redefine command when a data set is reorganized or when the Support Library is recompiled. (A Support Library recompile indicates that either the layout has changed, such as changes to ALTER or FILTER, or the SUPPORT option in the SOURCE declaration changed.)

In all of the aforementioned cases, DBEngine treats the situation like a reorganization and requires that you run a redefine command.

When you run the redefine command, it does the following:

  • Creates a backup of the client control tables for the data source by silently performing an unload command. The unload file is created in the data source's working directory when the Client first detects the reorganization. The unload file is named datasource_reorg_nnn.cct where nnn is the value of update_level prior to running the redefine command (and is saved to the old_update_level column of the DATASOURCES entry).
  • Re-creates the relational database layout for all data sets that are marked as needing to be redefined.
  • If you use user scripts (that is, not the Client Configurator), the redefine command runs these scripts to preserve changes to the client control tables.
  • Determines which data sets have tables whose layouts have changed, updates the ds_mode accordingly, and creates reorganization scripts that will alter the relational database tables to match the changes in the reorganized DMSII data sets.

Reorganized Data Sets

When a data set has been reorganized (status_bits = 8), the redefine command compares the layouts of tables mapped from the data set in the existing client control tables with the new layouts and does the following:

  • If no changes occur to the layouts of tables mapped from the data set, the redefine command sets the data set ds_mode to 2, indicating that the data set is ready to be updated.
  • For tables for which the layout has changed, the redefine command creates reorganization scripts that will modify the relational database tables to match the changes in the reorganized DMSII data sets.
  • If the DMSII reorganization introduces one or more new columns, one of the following occurs.

    If suppress_new_columns is

    Result

    True

    The active column is set to 0 for new items in the DATAITEMS client control table and for new tables in the DATATABLES client control table.

    The next process command does not reclone the data set.

    False

    The new columns are added to the tables in the client database. These columns will be set to the appropriate values based on their INITIALVALUE defined in the DASDL.

    The next process command will continue to populate the table including the new column. If new tables appear, the data set will be recloned.

  • If the reorganization introduces one or more new data sets, one of the following occurs.

    If suppress_new_datasets is

    Result

    True

    DATABridge Client sets the active column in the corresponding entry in the DATASETS client control table to 0, and the data set is not mapped.

    False

    DATABridge Client sets the active column in the corresponding entry in the DATASETS client control table to 1 (unless the data set is a REMAP), and the layout of the corresponding relational database tables is defined in the DATATABLES and DATAITEMS client control tables.

    You must run a reorg or generate command to create the scripts for these new tables. These data sets are automatically cloned the next time you run a process command.

  • For any reorganized data set whose active column is 0, the redefine command updates the corresponding client control table entries, leaving the active column to 0. This ensures that if you later decide to clone that data set, you only need to set the active column to 1 and execute a redefine and a generate command.