Creating IMS databases

To create a database, you must start with a CREATE DATABASE statement followed by the CREATE TABLESPACE and CREATE TABLE statements as they become applicable.

The default database description generated by a CREATE DATABASE statement is a database with an IMS PHIDAM OSAM access type. If you want a different database access type, then you can override it by specifying the desired type on the statement or use the LIKE keyword to generate a database description using attributes of an existing resource.

The following tables display the most commonly used DBD/PSB source and the equivalent DDL. For more information about type-1 and type-2 commands, see Equivalent IMS type-1 and type-2 commands.
Table 1. DDL equivalents for the DEDB DBD
Task With DBD source Similar DDL statement
Define a DEDB database
DEDB1 DBD NAME=DEDB0001,
ACCESS=DEDB,RMNAME=RMOD1

CREATE DATABASE
DEDB0001 ACCESS
DEDB RMNAME(RMOD1)

Table 2. DDL equivalents for the HDAM DBD
Task With DBD source Similar DDL statement
Define a HDAM database
DBD NAME=SKILLINV,
ACCESS=HDAM,RMNAME=
(DFSHDC40,20,500,824)

CREATE DATABASE
SKILLINV ACCESS
HDAM VSAM RMNAME
(DFSHDC40 RMANCH 20
RMRBN 500 RMBYTES 824)

Table 3. DDL equivalents for creating a root segment
Task With DBD source Similar DDL statement
Define a root segment in a database
SEGM NAME=A,BYTES=(48,27),
PARENT=0

CREATE TABLE
A INTERNALNAME A
MAXBYTES 48 MINBYTES 27
IN DATABASE SKILLINV

Multiple DDL statements are needed in order to describe the make-up of a database, such as:
  • databases organization and access method
  • table spaces
  • tables and columns mappings in a database record
  • relationships with other databases or tables
  • primary keys and foreign keys
  • programview (PSB) describing a programs characteristics and its use of tables, columns, and logical terminals

After you design your database and code the necessary DDL statements, you submit them to IMS through a Java™ IMS application. IMS continues to accept DDL statements to generate a DBD record until you also submit a COMMIT DDL statement, which ends the unit of work. IMS is then triggered to write the DBD record out to the IMS catalog and prepares for activation and use during database processing.