0

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.
chustar
  • 12,225
  • 24
  • 81
  • 119

2 Answers2

1

Looking at the sample code it looks like you start coding in column 1.

Trad mainframe compilers expect code in particular columns:

----+----1----+-----
      *  comment star goes in column 7
       PROCEDURE DIVISION.
       PARAGRAPH_NAME.
      * All start between cols 8 and 11
      *
           ADD +1 TO COBVER.
      * Other operations start in col 12 or after.
      * Anything after column 71 will be ignored. 
James Anderson
  • 27,109
  • 7
  • 50
  • 78
0

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.

chustar
  • 12,225
  • 24
  • 81
  • 119