error in calling a program from DB2 cobol SP



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

error in calling a program from DB2 cobol SP

Postby pulsar22 » Wed Oct 23, 2013 8:23 pm

Hi,

A cobol stored procedure is calling a cobol program. This program is coded by some other team. I have coded the SP such that if the call to program is not successful, an error message("FAILED TO CONNECT") is returned. This SP is called from various applications, not residing on mainframe.

This setup was working fine in test environment and call to the program from SP was successful.But when both the code and SP were moved to stage the calling application(.NET) is getting the failed to connect error message.

They can't see the return code, only error message. can anybody tell me what could be the issue.
I know there is not much information about the type of error but your experience in what could be the issue can help.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: error in calling a program from DB2 cobol SP

Postby pulsar22 » Wed Oct 23, 2013 8:33 pm

Should i run a bind job in stage region to bind the SP and code together? Could this be the issue?
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: error in calling a program from DB2 cobol SP

Postby Akatsukami » Wed Oct 23, 2013 8:38 pm

Why have you not coded it so as to return the actual error information from DB2 (SQLCODE, SQLSTATE, etc.) instead of some vague message that only confuses the issue?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: error in calling a program from DB2 cobol SP

Postby pulsar22 » Thu Oct 24, 2013 7:43 pm

I had done this, but by mistake returned the SQLCODE of the calling program, when in this case it should be of the called program. This issue never happened while testing and due to timelines could not simulte this condition in test region to verify.
Also the same thing is working exctly fine in test. Have to raise a request and cast package to move to stage again. but confirming before that if any idea on what the issue could be.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post