We have a integration requirement where we need to invoke COBOL on z/OS from java running on unix.
we are exploring option of using DB2 stored procedure written in COBOL.
Redbook documentation/example has step to compile/link the COBOL program and load into db2 load lib.
Is it possible to re-use already compiled existing COBOL program?
i.e is it possible to point DB2 to use COBOL from existing library? if yes, then please let me know how to do it
Pinned topic DB2 COBOL Stored procedure - COBOL compilation requirement : need help
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-01-10T06:22:39Z at 2013-01-10T06:22:39Z by kumar.ss
ToddBurchDB2 270001F7F874 Posts
Re: DB2 COBOL Stored procedure - COBOL compilation requirement : need help2012-12-12T11:50:27ZThis is the accepted answer. This is the accepted answer.It depends.
There are two aspects. Issuing the CREATE PROCEDURE statement, and writing the procedure itself.
The CREATE PROCEDURE statement tells DB2 about the input and output parameters, and also a bit about how the procedure operates (does it READ DB2 data, MODIFY DB2 data, etc.)
The COBOL code must be able to receive the input parameters as DB2 builds the parameter list, and populate the output variables as DB2 requires as well. I would suspect your COBOL program does not conform to this requirement today.
On the whole, you can probably reuse most of your existing program logic, but it must be able to conform to the operating environment in which it will run (under WLM).
SystemAdmin 110000D4XK3105 Posts
Re: DB2 COBOL Stored procedure - COBOL compilation requirement : need help2013-01-05T08:25:00ZThis is the accepted answer. This is the accepted answer.i assume you don't want to change your existing code since other programs are calling it / using it
what i would do is to write a wrapper program in cobol. That program will be invoked by the stored procedure, it will set up all the parameters the way db2 expects and then call the existing code. This way you don't touch your existing code, you just add a rather simple adapter which does the necessary integration with db2
kumar.ss 270004UU7Y4 Posts
Re: DB2 COBOL Stored procedure - COBOL compilation requirement : need help2013-01-10T06:22:39ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
we found out answers for my question (can we use existing compiled cobol program).
the answer is yes and no. :-)
yes - if the cobol program do not have any DB call.
NO - if the COBOL program has DB call/statement.
reason: our existing programs were compiled with DSNCLI.
finally we recompiled (cobol program with db2 calls) with DSNRLI and it is working for select. we are testing it for update now.