If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > cobol stored proc on windows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-04, 14:35
ksprunk ksprunk is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Red face cobol stored proc on windows

We currently have many stored procs written in cobol and residing on a vm system. They are successfully called from windows based clients. I am now attempting to migrate the db from vm to windows. I am compiling the stored procs on windows using IBM's VA Cobol and following all of the (sometimes conflicting) documentation I can find.
When I call one of the stored procedures all appears to have gone well (sqlcode returned = 0) except that I get absolutely nothing back in the passed fields. The db at least appears to be at least attempting to load the dll as I can see the disk light go on.

This is the stored proc declaration I have used.
CREATE PROCEDURE TESTPROC
(INOUT PROCERR INTEGER,
INOUT PROCERRMSG CHAR(254),
INOUT PARM1 CHAR(111))
RESULT SETS 0
MODIFIES SQL DATA
LANGUAGE COBOL
EXTERNAL NAME 'TESTPROC!TESTPROC'
FENCED
NOT THREADSAFE
NO DBINFO
PROGRAM TYPE SUB
PARAMETER STYLE GENERAL;

The calling program uses
01 PROCERR PIC S9(9) COMP-5.
01 PROCERRMSG PIC X(254).
01 PARM1 PIC X(111).
and
EXEC SQL
CALL TESTPROC (:PROCERR, :PROCERRMSG, :PARM1)
END-EXEC

The called program (stored proc) has its linkage section defined as
PROCEDURE DIVISION USING PROCERR
PROCERRMSG
PARM1.

01 PROCERR PIC S9(9) COMP-5.
01 PROCERRMSG PIC X(254).
01 PARM1 PIC X(111).

It is a dll and is placed in the SQLLIB\FUNCTION directory.

All the stored proc currently does is
MOVE 'ZZZ' TO PROCERRMSG
GOBACK.
the problem: I never see the 'ZZZ' in the PROCERRMSG field in the calling program.

Any thoughts?

DB2 UDB 8.1 running on W2000 sp4.

Calling machine is XP pro.

I have tried both Realia Cobol and IBM VA Cobol 2.2.2.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On