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

发布于 2024-10-28 12:05:04 字数 1066 浏览 0 评论 0原文

当我尝试预编译包含嵌入式 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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别低头,皇冠会掉 2024-11-04 12:05:04

查看示例代码,您似乎从第 1 列开始编码。

传统大型机编译器期望在特定列中编写代码:

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

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. 
一身软味 2024-11-04 12:05:04

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文