Search code examples
sqldb2precompileembedded-sql

How to solve or start solving DB2 problem?


When I try to pre-compile my DB2 Cobol application that contains embedded SQL statements, I get this error in my SYSTERM file:

********************************* TOP OF DATA **********************************
DSNH527I W     DSNHOPTS  THE PRECOMPILER OR DB2 COPROCESSOR ATTEMPTED TO USE THE
DSNH004I S     DSNHLEXC  PROCEDURE DIVISION COULD NOT BE FOUND

DSNH053I W     DSNHMAIN  NO SQL STATEMENTS WERE FOUND
SOURCE STATISTICS
SOURCE LINES READ: 205
NUMBER OF SYMBOLS: 10
SYMBOL TABLE BYTES EXCLUDING ATTRIBUTES: 1640
THERE WERE 3 MESSAGES FOR THIS PROGRAM.
THERE WERE 0 MESSAGES SUPPRESSED BY THE FLAG OPTION.
188712 BYTES OF STORAGE WERE USED BY THE PRECOMPILER.
RETURN CODE IS 12
******************************** BOTTOM OF DATA ********************************

I think the error is that it can't find the Procedure Division section, but it is in the code here:

*---------------------------------------------------------------*
*          P R O C E D U R E     D I V I S I O N                *
*---------------------------------------------------------------*
PROCEDURE DIVISION USING LK-TRANS-INPUT.
000-MAIN.

Solution

  • I fixed it by recreating the Datasets on the DB2 mainframe with the same data in them. There was something wrong with their setup parameters.