5 pts.
 Cobol access to DB2 data over multiple LPARs
I have an iSereis with 2 LPARs - one running V6R1 with a Cobol compiler (not ILE) and the other LPAR is running V5R3 with DB2 files.  What code and/or compiler options do I use to connect the v6r1 Cobol with the v5r3 database and how do I create the Cobol program to run on v5r3? Thanks

Software/Hardware used:
Cobol on iSeries
ASKED: July 28, 2011  10:39 PM
UPDATED: March 31, 2012  7:41 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

First, the only unidentified non-ILE COBOL compiler that can get an answer would probably be the OPM compiler; so, you’d use the TGTRLS( V5R3M0 ) parameter value on the CRTCBLPGM command to compile back to V5R3.

Second, you don’t necessarily do anything to the program, unless it’s a SQL COBOL program that will execute a CONNECT to the remote database. If it’s just doing normal COBOL OPENs, CLOSEs, READs, WRITEs, etc., it’s probably easiest just to define DDM files to the the remote files. COBOL could then access those just as if they were local files.

For SQL, you’d want to add an entry into the remote database directory through the WRKRDBDIRE command. For DDM, you’d create the DDM file(s) with the CRTDDMF command.

…to connect the v6r1 Cobol with the v5r3 database…

Going in that direction, the commands would be run on your i 6.1 system. They would create definitions that pointed to your V5R3 system. One reasonable assumption would be that all of it would run over TCP/IP.

There can be a variety of details, of course, that will depend on what server jobs you run, what security options you need and others. Those should be answered as they arise because alternatives can branch out quickly.

BTW, is there a reason you can’t use the ILE compiler? It would definitely be a better option. It can cover (almost) everything OPM can do plus add a lot more.

Tom

 108,280 pts.