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 > DB2 Stored Procedure returning SQLCODE 0 instead of +466

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-15-06, 16:40
jbarry06248 jbarry06248 is offline
Registered User
 
Join Date: Sep 2006
Posts: 3
Question DB2 Stored Procedure returning SQLCODE 0 instead of +466

Hi,

I am trying to write a DB2 Stored Procedure, for the first time, using Cobol. When I call the stored procedure using a Cobol program, when the Stored Procedure returns control to the calling program, I have a SQLCODE of 0. From what I'm seeing I'm supposed to get a +466. Just to see that i am actually going to the stored procedure i change a couple variables and they do come back to the calling program changed successfully.

ATTACHED IS THE CODE:

SPWAGES.txt is the called Stored Procedure program
JABTEST.txt is the Calling program
STORPROC.txt is the SQL to Create the Stored Procedure in DB2.

Thanks,

John Barry
"I'm a man ...But I can change ...If I have to ...I guess." Red Green

This Email has been sent after having received, but not fully understanding the Acceptable Use Policy. Any personel information contained in this email is completely coincidental or was absolutely neccessary in order to conduct normal business. Opinions expressed in this email are neither of the sender nor the sendee. Anything found to be funny, was not intended as a joke in any way shape or form.
spwages.txt

jabtest.txt

STORPROC.txt
Reply With Quote
  #2 (permalink)  
Old 09-17-06, 04:58
GertK GertK is offline
Registered User
 
Join Date: Nov 2003
Location: Netherlands
Posts: 96
Quote:
Originally Posted by jbarry06248
Hi,

I am trying to write a DB2 Stored Procedure, for the first time, using Cobol. When I call the stored procedure using a Cobol program, when the Stored Procedure returns control to the calling program, I have a SQLCODE of 0. From what I'm seeing I'm supposed to get a +466.
.....
It looks like the problem is that you COMMIT before checking the SQLCODE. If the SQLCODE = 0 you didn't have a problem with the COMMIT so I guess you need to switch the EVALUATE and COMMIT statements.
Reply With Quote
  #3 (permalink)  
Old 09-18-06, 09:10
jbarry06248 jbarry06248 is offline
Registered User
 
Join Date: Sep 2006
Posts: 3
Red face Commit commented out

Sorry, the commit is commented out. it was something i read so i tried it. either way I get SQLCODE of zero.

I will try to clean out all commented lines and resend. anything with a * towards the beginning of the line, is commented out.

John
Reply With Quote
  #4 (permalink)  
Old 09-18-06, 09:28
jbarry06248 jbarry06248 is offline
Registered User
 
Join Date: Sep 2006
Posts: 3
Red face New JABTEST and SPWAGES

Here is the revised JABTEST program. I also noticed the SPWAGES program txt file contained the JABTEST program. Attached is both, fixed.

Sorry,

John

jabtest.txt

spwages.txt
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