Invoking legacy cobol - db2 program from JAVA

Senthilkumar K

Invoking legacy cobol - db2 program from JAVA
Hi All ,


We are getting a SQLCODE of - 981 when trying to execute EXEC SQL inside
COBOL program which is invoked from Java.

Our requirement is to use a Database connection that is initiated by Java
program to run SQL statements written in legacy COBOL as EXEC SQL
statements.

Error message:

Calling Target COBOL program.....
BEFORE INSERT
AFTER INSERT: 00000098J
0009 00C12219
Return from Target COBOL program.....

There are existing legacy COBOL applications in which we don’t want to do
changes .So we want to call the legacy COBOL from Java by without changing
the COBOL code.

Actually we are trying implicit RRSAF connection to be established for this
connection. But it is not done and it is failing with reason code:
00C12219.

I think we are missing some thing in RRSAF connection establishment. Is it
possible use implicit RRSAF connection for Calling COBOL from Java under
BATCH environment? (I.e. without changing COBOL code)


Details of our environment:

1. Db2 v8
2. JDK 1.4.2
3. DSNRLI in link - edit step of JCL which is for compile link edit COBOL
program.
4. We are using Db2 JCC driver for JDBC/ SQLJ
5. We are using OO COBOL wrapper for calling legacy COBOL program JAVA.

Could you please pass some light on this issue?


Thanks and Regards
Senthil Kumar

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Richard Humphris

Re: Invoking legacy cobol - db2 program from JAVA
(in response to Senthilkumar K)
Perhaps you can run the cobol program as a stored procedure (you've
already linked it with DSNRLI).

Then instead of invoking the COBOL program directly, you can just "CALL"
the stored procedure (with the unchanged cobol code) and have the cobol
program run in some DB2WLM stored procedure address space.

Richard Humphris
Business: 312-822-5193
Text Pager: 877-814-2246
To send short email to pager... send email to:
[login to unmask email]

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Senthilkumar K
Sent: Wednesday, November 22, 2006 2:29 AM
To: [login to unmask email]
Subject: [DB2-L] Invoking legacy cobol - db2 program from JAVA

Hi All ,


We are getting a SQLCODE of - 981 when trying to execute EXEC SQL inside
COBOL program which is invoked from Java.

Our requirement is to use a Database connection that is initiated by
Java
program to run SQL statements written in legacy COBOL as EXEC SQL
statements.

Error message:

Calling Target COBOL program.....
BEFORE INSERT
AFTER INSERT: 00000098J
0009 00C12219
Return from Target COBOL program.....

There are existing legacy COBOL applications in which we don't want to
do
changes .So we want to call the legacy COBOL from Java by without
changing
the COBOL code.

Actually we are trying implicit RRSAF connection to be established for
this
connection. But it is not done and it is failing with reason code:
00C12219.

I think we are missing some thing in RRSAF connection establishment. Is
it
possible use implicit RRSAF connection for Calling COBOL from Java under
BATCH environment? (I.e. without changing COBOL code)


Details of our environment:

1. Db2 v8
2. JDK 1.4.2
3. DSNRLI in link - edit step of JCL which is for compile link edit
COBOL
program.
4. We are using Db2 JCC driver for JDBC/ SQLJ
5. We are using OO COBOL wrapper for calling legacy COBOL program JAVA.

Could you please pass some light on this issue?


Thanks and Regards
Senthil Kumar

------------------------------------------------------------------------
---------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that
page select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG conferences
at http://conferences.idug.org/index.cfm

E-MAIL CONFIDENTIALITY NOTICE: The contents of this e-mail message and any attachments are intended solely for the
addressee(s) and may contain confidential and/or legally privileged information. If you are not the
intended recipient of this message or if this message has been addressed to you in error, please
immediately alert the sender by reply e-mail and then delete this message and any attachments. If you
are not the intended recipient, you are notified that any use, dissemination, distribution, copying, or
storage of this message or any attachment is strictly prohibited.

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm