Page 1 of 1

error in calling a program from DB2 cobol SP

PostPosted: Wed Oct 23, 2013 8:23 pm
by pulsar22
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.

Re: error in calling a program from DB2 cobol SP

PostPosted: Wed Oct 23, 2013 8:33 pm
by pulsar22
Should i run a bind job in stage region to bind the SP and code together? Could this be the issue?

Re: error in calling a program from DB2 cobol SP

PostPosted: Wed Oct 23, 2013 8:38 pm
by Akatsukami
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?

Re: error in calling a program from DB2 cobol SP

PostPosted: Thu Oct 24, 2013 7:43 pm
by pulsar22
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.