Db2 for z/OS stored procedures use of ODBA

Db2 for z/OS® stored procedures connecting to ODBA must run in a z/OS Workload Manager-managed (WLM-managed) stored procedures address space.

Db2 for z/OS establishes the ODBA environment by specifying either the INIT subfunction or the CONNECT subfunction of the CIMS call for the stored procedure address space. If the CIMS INIT call is issued, the connection to a specific IMS DB occurs when the APSB call is issued. If the CIMS CONNECT call is used, the connection to one or more IMS DB systems can optionally occur either when the CIMS CONNECT call is issued or when the APSB call is issued.

Each stored procedure running in the stored procedure address space runs under its own TCB that is established by Db2 for z/OS when the stored procedure is initialized. Db2 for z/OS issues the commit call on behalf of the stored procedure when control is returned to Db2 for z/OS. Only the PREP subfunction of the DPSB call should be issued by the stored procedures.

Restriction: If stored procedures are nested under a single WLM stored procedure address space and call IMS ODBA, the ODBA threads will hang.

The following figure illustrates the connection from a Db2 for z/OS stored procedures address space to an IMS DB subsystem. This connection allows DL/I data to be presented through an SQL interface, either locally to this Db2 for z/OS or to DRDA connected Db2 for z/OS databases.

Figure 1. Db2 for z/OS stored procedures connection to IMS DB
Begin figure description. tables communicate through ODBA and DRA in stored procedures Address Space, which communicates with IMS Database Manager, which communicates with IMS databases. End figure description.
The following figure illustrates the general relationships involved with using Db2 for z/OS stored procedures and IMS DB together.
Figure 2. Db2 for z/OS stored procedures relationships
begin figure description. This figure is described in the surrounding text. end figure description.