Reputation: 1902
I'm able to (on Windows XP) precompile, compile and link a sample (Fujitsu NetCobol) COBOL test program which contains embedded SQL. This test program is to read and display the number of rows in a DB2 (UDB 9.5 on Linux) database table.
At runtime I get following error message:
JMP0811I-U [PID:... TID:...] FAILURE IN LINKAGE RULES OR PARAMETER OF THE 'sqlgstrt' PROGRAM. PGM=DB2TST1
The precompile source code this error refers to looks as follows:
* ... in WORKING-STORAGE section:
01 SQLA-PROGRAM-ID.
05 SQL-PART1 pic 9(4) COMP-5 value 172.
05 SQL-PART2 pic X(6) value "AEAMAI".
05 SQL-PART3 pic X(24) value "gBSdTdJY01111 2 ".
05 SQL-PART4 pic 9(4) COMP-5 value 13.
05 SQL-PART5 pic X(13) value "ADMINISTRATOR".
05 SQL-PART6 pic X(115) value LOW-VALUES.
05 SQL-PART7 pic 9(4) COMP-5 value 8.
05 SQL-PART8 pic X(8) value "COBOL/DB".
05 SQL-PART9 pic X(120) value LOW-VALUES.
* .. in PROCEDURE DIVISION:
*EXEC SQL CONNECT TO :DB-SERVER USER :DB-USER USING :DB-PWD
* END-EXEC
CALL "sqlgstrt" USING
BY CONTENT SQLA-PROGRAM-ID
BY VALUE 0
BY REFERENCE SQLCA
Does anybody know what this error message means?
Upvotes: 0
Views: 1404
Reputation: 1902
The error description was due to: *) the CHECK(LINKAGE) compiler option (only available in NetCOBOL for Windows, not for Linux) without this option, the error is still there, but even less descriptive
The actual error was due to:
*) the CALL "sqlgstrt" USING ...
generated by the DB2 precompiler implies the wrong
(= COBOL) calling convention => manually changing the calls to
CALL "sqlgstrt" WITH STDCALL LINKAGE USING...
has resolved the runtime error
This solution implies changing the precompiler results though, so I'm still in search of a DB2 precompiler option to generate the right CALLs.
Upvotes: 1