Previous Topic: Preparing ProgramsNext Topic: Statement Execution Table


Mixed Mode Programming

Mixed mode programming is the embedding of SQL statements in application programs where native CA Datacom/DB record-at-a-time and/or set-at-a-time commands are also coded.

The embedded SQL statements can be either CA Datacom/DB SQL statements or IBM DB2 SQL statements but not both, that is to say, CA Datacom/DB SQL and DB2 SQL calls cannot be made from the same program. All of the SQL statements in a program must be processed either by IBM DB2 or CA Datacom/DB but not both because both require the source program to embed the SQL statements in the same special statements (EXEC-SQL and END-SQL), and both require the source to be manipulated by their own Preprocessor. If the source was processed through a CA Datacom/DB Preprocessor first, for example, it could therefore not later be passed through an IBM Preprocessor, because at that point there would be no special statements left to process.

To make native CA Datacom/DB calls and CA Datacom/DB SQL calls from the same application program, see Embedding SQL Statements in Host Programs.

The following requirements must be met to make native CA Datacom/DB calls and IBM DB2 SQL calls from the same application program:

  1. The DBURINF User Requirements Table macro must have OPEN=USER and USRNTRY=program-id.
  2. The COBOL program must be compiled with the compiler option NODYNAM.
  3. The link-edit step must have:
    INCLUDE SYSLIB(-urt-name)
    ENTRY program-id
    NAME program-id(R)