High-level procedure for defining databases with DDL

IMS supports the standard CREATE, ALTER, and DROP DDL statements to create, modify, and delete IMS databases and program views.

The database (DBD) and program view (PSB) attributes and characteristics that you can specify on the DDL CREATE and ALTER statements are generally the same as the attributes and characteristics that you can specify on the macro instruction statements for the DBD and PSB generation utilities; however, the names of some parameters might be different, either to conform to the standard DDL terminology or for enhanced clarity.

To implement changes to an existing database, you must use the ALTER DATABASE statement. You can change existing tables, table spaces, or columns using the ALTER TABLE and ALTER TABLESPACE statements. You can also add or remove these objects from the database description using CREATE and DROP statements.

To make changes to an existing table in a database, use the ALTER TABLE statement.

To make changes to the columns, logical child (LCHILD), and map descriptions in the table, also use the ALTER TABLE statement.

Some things are general to all database types, for example the change data capture exit. Other things are specific to a DB type, for example the partition selection exit for HALDBs and randomizers for DEDBs, HDAMS, and PHDAMs.

Recommendation: Use the IMS Enterprise Suite Explorer for Development to create or modify database and program view definitions and submit them to IMS. Using IMS Explorer for Development, you can create new database and program view definitions from the existing databases and program views in your IMS system and then modify the definitions as necessary.

Procedure

  1. Code your DDL statements, defining the database, tables, and tablespaces.
    • If you are creating a new database, use CREATE statements.
    • If you are altering an existing database, you can use a combination of ALTER, CREATE, and DROP statements.
    • Include a final COMMIT statement.
  2. If you are creating a new database, make sure that the following steps are complete, planned for, or are handled automatically by IMS:
    • The creation of the database data sets.
    • The creation of a PSB to access the new database.
    • The creation of the runtime attribute control blocks (DDIRs and PDIRs) in the online IMS systems for the database and application programs.
  3. Submit the DDL statements to IMS by using either the IMS Enterprise Suite Explorer for Development or the IMS SQL Batch utility.
    Upon receiving the DDL with a COMMIT statement, IMS takes the following action:
    • Validates the DDL syntax and, if you are creating a new database, confirms that the database does not already exist.
    • Updates the DBD record in the IMS catalog
    • Generates the required application control blocks (ACBs) and, if the resources are not activated automatically, stores them in the staging data set of the IMS directory.
    • If you are creating a new database, executes any automation options that might be specified by the following parameters in the CATALOG section of the IMS DFSDFxxx PROCLIB member:
      AUTOIMPORT(CREATE)
      When specified, IMS takes the following actions automatically:
      • Loads the ACBs into the IMS directory.
      • Activates the ACBs in the online system.
      • Creates the runtime attribute blocks for the databases (DDIRs) and, if CREPGM=Y is specified, the program views (PDIRs) in the online systems.
      AUTOCREATE=YES
      For Fast Path DEDB databases, in addition to activating the ACBs and the runtime attribute control blocks, IMS automatically creates the database data sets.
    • Updates the resource list indicating that this database was updated.
  4. If you are altering an existing database, you might need to reorganize the database.
  5. If the database and program view definitions still needs to be activated in online IMS systems, issue the IMPORT DEFN SOURCE(CATALOG) command to activate the database and program definitions.