Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    3

    Question Unanswered: 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

  2. #2
    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.

  3. #3
    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

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •