Skip to main content

Compile error - COBDB0114 on OPEN CURSOR statement

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Using Server Express, compiling a program with the DB2(IGNORE-NESTED) directive the following error appears:

413     EXEC SQL

   414       OPEN myCursor

   415     END-EXEC

* 801-S************                                                    (   8)**

**    External Compiler Module message

**    DB0114 Statement only allowed in the PROCEDURE DIVISION.

Resolution:

The DB2(IGNORE-NESTED) directive uses the PROGRAM-ID specified in the program source. If this does not match the program source name, it can lead to such compiler errors.

To resolve this, change the PROGRAM-ID clause to match the COBOL source name.

For further information, please refer to the documentation of the DB2(IGNORE-NESTED) directive.

Old KB# 2050