如何解决或开始解决DB2问题?

时间:2011-04-02 08:43:09

标签: sql db2 precompile embedded-sql

当我尝试预编译包含嵌入式SQL语句的DB2 Cobol应用程序时,我在SYSTERM文件中收到此错误:

********************************* 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 ********************************

我认为错误是它无法找到Procedure Division部分,但它在这里的代码中:

*---------------------------------------------------------------*
*          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.

2 个答案:

答案 0 :(得分:1)

查看示例代码,看起来就像在第1列开始编码一样。

Trad大型机编译器需要特定列中的代码:

----+----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. 

答案 1 :(得分:0)

我通过在DB2主机上重新创建数据集并使用相同的数据来修复它。他们的设置参数有问题。