Reputation: 3492
Quick disclaimer: I'm a .Net developer and may not have provided all the information you need about the environment, but can get the information on request. We have COBOL programmers, but they have never done this.
We are converting a mainframe application with a DB2 database to a .Net MVC application with SQL database. There is one mainframe COBOL batch program that we would like to call from a COBOL stored procedure on the DB2. I've read this can be done, but I haven't found a good example of how to create a COBOL stored procedure that calls a COBOL program. The COBOL batch program takes about 5 input parameters, but does not return anything.
We already have a linked server that we are using to call native sql stored procedures on DB2 from a SQL server.
Edited for future reference below
We looked into two ways of solving our problem - creating a COBOL stored procedure that could be used by DB2-mainframe running on z/os where we'd copy/paste our COBOL from the CICS program and tweak it to run as a stored procedure (thus cutting out CICS completely) or using CICS to host a web service end point that can call to the CICS program we wanted to invoke, much like described on slide 21 of this PowerPoint.
We have decided to move forward with the second option because there is precedent for doing it that way already, so it's going to be the easier path for us.
Upvotes: 3
Views: 4829
Reputation: 8627
Interesting question!
I was thinking of why not let your LUW DB2 stored procedure call a transaction manager which will execute your cobol program? This if you use a transaction manager in mainframe (which I assume you do!). If you are not familiar with this, just check your mainframe guys if you use transaction manager as CICS or IMS.
I have not done this, but it should work.
(alternative, call a http/webservice from db2 sp which will execute an ims transaction that executes your cobol program...)
I must add that I ve not tried any of above, I have´nt used db2 luw. But maybe the ideas are worth to mention here?
Upvotes: 2