COBOL requirements for Datacom/SQL and DB2
search cancel

COBOL requirements for Datacom/SQL and DB2

book

Article ID: 38063

calendar_today

Updated On:

Products

Datacom DATACOM - AD Datacom/AD Datacom/DB

Issue/Introduction

This article describes how to have one program which accesses both Datacom/SQL and IBM DB2.

Environment

Release: All supported releases.

Resolution

You need to follow these considerations:

  • You cannot invoke Datacom SQL and IBM DB2 SQL statements from the same program.

  • You can split the program into 3 parts:
    • one main-program with no SQL calls,
    • one subprogram with Datacom SQL calls, and
    • one subprogram with IBM DB2 calls.
  • OR
  • One main program with Datacom SQL calls and one subprogram with IBM DB2. 

Compile and link the IBM DB2 program following the instructions in the IBM DB2 documentation. No reference to Datacom is required, for example, no URT is required.

Compile and link the Datacom SQL program following the instructions in the Datacom documentation. Remember to code the URT with DBUREND DBSQL=YES.

DATACOM SQL and IBM DB2 SQL calls are not possible from the same program. Mixed-mode processing, that is to say, ALL SQL statements in a program must be processed either by native IBM DB2 or by DATACOM/DB. Both DBMSs require the source program to embed the SQL statements in the same special statements (EXEC-SQL and END-SQL "bookends") and both DBMSs require the source to be manipulated by their own pre-compiler. Therefore, if the source was processed through one pre-compiler first, by the time it was passed to the other DBMS's pre-compiler, there would be no special statements left to process.