For sites with both CA-IDMS and DB2 databases, there may be a need to access both from within the same program. This is possible, but there are some limitations. This document provides details as to what can be accomplished and how.
It is possible to access DB2 data from within a CA IDMS program. However, there are some limitations in writing such a program. First, a single DML statement cannot reference data sources from both CA IDMS and DB2. Each DML statement must reference either a CA IDMS data source or a DB2 table, but not both. Second, if the program contains network DML for a CA IDMS database and SQL DML for a DB2 database, then these steps must be taken to compile the program:
A program compiled and linked in this way can run in batch mode to access both CA IDMS and DB2 databases.
In addition to the compile-time considerations, certain run-time restrictions are imposed by the DB2 architecture. When executing a program to access DB2, DB2 must be in control of the address space in order to access the DB2 database. This means you must initiate DB2 which then loads and executes the program under DB2 control. If a user has a batch program that needs to access both DB2 and IDMS it is necessary for the user to engage DB2 and have it control the program. Then that program can issue calls to CA IDMS and access a CA IDMS CV as an external run-unit or can start up a local mode CA IDMS run-unit (assuming DB2 has left enough of the address-space for IDMS to initialize).
If the program must run on-line, the following options are possible:
As noted above, there is no direct way to access a DB2 database from a program running within the IDMS CV, because of the restriction imposed by the DB2 architecture.