![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello I'm trying to run simple stored procedure written in COBOL on DB2. However I have no idea how to force it to work... ![]() Procedure code is as follows (file HELLO.cob): IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. DISPLAY "Hello, World!". STOP RUN. File has been compiled to executable, static library and shared library with TinyCOBOL compiler -> results are accordingly HELLO, HELLO.a, HELLO.so. All of these files have been put to directory /home/db2inst1/sqllib/ function and their privileges have been changed to 777. I tried to create stored procedure using these files in several ways like this: CREATE PROCEDURE PROCEDURE () EXTERNAL NAME 'HELLO' EXTERNAL NAME 'HELLO!HELLO' EXTERNAL NAME '/home/db2inst/sqllib/function/HELLO.so' EXTERNAL NAME '/home/db2inst/sqllib/function/HELLO.so!HELLO' LANGUAGE COBOL PARAMETER STYLE SQL But when I try to call procedure from DB2 I always get something like this: Routine "PROCEDURE" (specific name "SQL090630090438500") is implemented with code in library or path ".../sqllib/function/HELLO", function ".../sqllib/function/HELLO" which cannot be accessed. Reason code: "4".. SQLCODE=-444, SQLSTATE=42724, DRIVER=4.7.89 Routine "PROCEDURE" (specific name "SQL090630091203800") is implemented with code in library or path ".../sqllib/function/HELLO", function "HELLO" which cannot be accessed. Reason code: "4".. SQLCODE=-444, SQLSTATE=42724, DRIVER=4.7.89 Routine "PROCEDURE" (specific name "SQL090630091347500") is implemented with code in library or path ".../sqllib/function/ HELLO.so", function ".../sqllib/function/HELLO.so" which cannot be accessed. Reason code: "4".. SQLCODE=-444, SQLSTATE=42724, DRIVER=4.7.89 Routine "PROCEDURE" (specific name "SQL090630091711000") is implemented with code in library or path ".../sqllib/function/ HELLO.so", function "HELLO" which cannot be accessed. Reason code: "4".. SQLCODE=-444, SQLSTATE=42724, DRIVER=4.7.89 Where is the problem ? What should I pass as EXTERNAL NAME? Or what should I put extra to directory /home/db2inst1/sqllib/function ? Any help will be appreciated... Best regards Melmack BTW: Stored procedures written in Java work fine in this configuration. Below I attach environment info: $ db2level DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL09070" with level identifier "08010107". Informational tokens are "DB2 v9.7.0.0", "s090521", "LINUXIA3297", and Fix Pack "0". Product is installed at "/opt/ibm/db2/V9.7". $ db2licm -l Product name: "DB2 Express-C" License type: "Unwarranted" Expiry date: "Permanent" Product identifier: "db2expc" Version information: "9.7" Max number of CPUs: "2" Max amount of memory (GB): "2" $cat /proc/version Linux version 2.6.26.8-57.fc8 (mockbuild (AT) x86-3 (DOT) fedora.phx.redhat.com) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #1 SMP Thu Dec 18 19:19:45 EST 2008 Do you have a COBOL compiler? |
#3
| |||
| |||
|
|
Do you have a COBOL compiler? Larry E. |
#4
| |||
| |||
|
|
Do you have a COBOL compiler? Larry E. Yes. I'm working with TinyCOBOL v 0.64 Best regards Melmack Don't know if that is a supported COBOL for DB2, but have you followed |
#5
| |||
| |||
|
|
File has been compiled to executable, static library and shared library with TinyCOBOL compiler -> results are accordingly HELLO, HELLO.a, HELLO.so. .... DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL09070" with level identifier "08010107". Informational tokens are "DB2 v9.7.0.0", "s090521", "LINUXIA3297", and Fix Pack "0". Product is installed at "/opt/ibm/db2/V9.7". |
![]() |
| Thread Tools | |
| Display Modes | |
| |