dbTalk Databases Forums  

Cannot run COBOL stored procedure on DB2 - SQL error 444

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Cannot run COBOL stored procedure on DB2 - SQL error 444 in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
melmack
 
Posts: n/a

Default Cannot run COBOL stored procedure on DB2 - SQL error 444 - 06-30-2009 , 09:04 AM






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

Reply With Quote
  #2  
Old   
Larry
 
Posts: n/a

Default Re: Cannot run COBOL stored procedure on DB2 - SQL error 444 - 06-30-2009 , 02:02 PM






melmack wrote:
Quote:
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?

Larry E.

Reply With Quote
  #3  
Old   
melmack
 
Posts: n/a

Default Re: Cannot run COBOL stored procedure on DB2 - SQL error 444 - 07-02-2009 , 03:46 PM



Quote:
Do you have a COBOL compiler?

Larry E.
Yes. I'm working with TinyCOBOL v 0.64

Best regards
Melmack

Reply With Quote
  #4  
Old   
Larry
 
Posts: n/a

Default Re: Cannot run COBOL stored procedure on DB2 - SQL error 444 - 07-02-2009 , 09:54 PM



melmack wrote:
Quote:
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
the guidance on how to build COBOL routines in the doc?

Chapter 7 in:

ftp://ftp.software.ibm.com/ps/produc.../db2a2e952.pdf

Larry Edelstein

Reply With Quote
  #5  
Old   
Jan M. Nelken
 
Posts: n/a

Default Re: Cannot run COBOL stored procedure on DB2 - SQL error 444 - 07-02-2009 , 10:49 PM



melmack wrote:

....
Quote:
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".
As per DB@ UDB V9.7 online documentation available at:

http://publib.boulder.ibm.com/infoce...v9r7/index.jsp

supported environment for COBOL routines is:

For this OS:
- Linux® on x86 (32-bit DB2 instances and compilers only)

supported compilers are:

* Micro Focus COBOL Server Express Version 4.0 with Service Pack 2 on SLES9
* Micro Focus COBOL Server Express Version 4.0 with Service Pack 2 on RHEL4
* Micro Focus Server Express, Version 5.0
* Micro Focus does not offer support on SLES11

See:

http://publib.boulder.ibm.com/infoce.../r0023470.html


Jan M. Nelken

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.