Db2 coprocessor

When you use the Db2® coprocessor, the compiler handles your source programs that contain embedded SQL statements without you having to use a separate precompiler.

To use the Db2 coprocessor, specify the SQL compiler option.

When the compiler encounters SQL statements in the source program, it interfaces with the Db2 coprocessor. All text between EXEC SQL and END-EXEC statements is passed to the coprocessor. The coprocessor takes appropriate actions for the SQL statements and indicates to the compiler which native COBOL statements to generate for them.

Certain restrictions on the use of COBOL language that apply with the Db2 precompiler do not apply when you use the Db2 coprocessor:

  • You can identify host variables used in SQL statements without using EXEC SQL BEGIN DECLARE SECTION and EXEC SQL END DECLARE SECTION statements.
  • You can compile in batch a source file that contains multiple nonnested COBOL programs.
  • The source program can contain nested programs.
  • Extended source format is fully supported.

Related tasks  
Compiling with the SQL option
  

Related references  
SQL
  
SRCFORMAT