I have no knowledge about COBOL or DB2, but I need to be able to find out a way to call a function written in COBOL from DB2 on OS/390. Would anyone be able to supply sample code or a web page for further information?
Hi Vika,
I think that we need a little bit more information here on what you are trying to do:
What operating system and language or application are you calling from? (you mention that the COBOL and DB2 are on an OS/390, is this where the application sits also?)
What 'function' are you trying to process in Cobol? And how does it interact with DB2? Also, is the Cobol program already written, or do you have to write it from scratch?
In short, let us know in a bit more detail what you already have got, and what you are trying to get to, and we will try to help.
Thank you for offering some advise.
I actually haven't written any of the functions myself, I just have to figure our how to call them from DB2. Right now it looks like I have to call a function written in C rather than Cobol. The DB2 database is on OS/390. So far I have been able to write a C wrapper around the C function, create a DLL and register a stored procedure with DB2 on a Windows platform. That worked out fine for me. However, our clients are on a mainframe and they want the same thing for DB2, but for the mainframe.
So basically, I have a C function. I need to call this function from DB2 on OS/390. What needs to be done?
I really appreciate your help and I'm looking forward to your reply,
Hi Vika,
If you wish to call a function from DB2 by using EXEC SQL etc. and that function is a COBOL program , then you will need to write a stored procedure. The SP can be Cobol and I guess that it could also be C as it seems that you have done this outside of the mainframe. I'm afraid I have no experience of this, but it seems possible.
Hope this helps a little.
Marc
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.