call java from mainframe cobol



Support for Java SE, EE & ME, JVM, JNI, JDBC, EJB, JFC, JPDA, JAAS,JCE, JAXP, XML and Java API.

call java from mainframe cobol

Postby joenazi » Fri Nov 12, 2010 6:38 am

Require a cobol program to call a java program in the mainfrane.

The java program(pgm j) is already developed and working fine, but on unix.

Now the cobol program (pgm c) that is currently working well in the mainframe needs to call the java program (pgm j)

the cobol program must pass few parameters(dollar amounts) to the java program, the java program will process those
dollar amounts and calculate taxes and return back the results to the cobol program.

so I need to know how this can be done.

1) compile the java pgm on the mainframe ?

2) any thing special/different when compiling the cobol program that now will the java call ?

2) how to call the java program from the cobol pgm and what things are required in the cobol pgm to support this

3) how to execute the cobol/java pgm in batch(jcl) on the mainframe.

Thanks
joenazi
 
Posts: 5
Joined: Sun Sep 20, 2009 10:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: call java from mainframe cobol

Postby Robert Sample » Fri Nov 12, 2010 7:19 am

If your site has java installed, use Unix System Services (OMVS) to enter the command javac <java file name> to compile the java program. Enter javac -v to verify that the site has Java installed, and check the version. This can also be done through batch.

The other questions I won't be able to check on until tomorrow.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: call java from mainframe cobol

Postby Robert Sample » Fri Nov 12, 2010 7:43 pm

Googling z/os cobol and java returns 138,000 hits. One of the first few is a Share presentation on using COBOL and Java together -- including calling Java programs from COBOL, passing data to the Java program, getting data back from the Java program, compiling and linking, and pretty much everything you need to know. Looking on the IBM web site for OO COBOL material will also provide helpful information.

I've run some of the manual examples of COBOL and JAVA, and the process requires tweaking of Unix path, libpath, and classpath statements to get things to work -- but eventually I did manage to get the manual examples working.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: call java from mainframe cobol

Postby joenazi » Sat Nov 13, 2010 2:53 am

Thanks a lot Robert !!!
joenazi
 
Posts: 5
Joined: Sun Sep 20, 2009 10:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: call java from mainframe cobol

Postby YDM » Sun Jan 09, 2011 7:06 pm

Please see my post Call COBOL with DB2 in Java-Batch.

We have a problem in the other direction (Java calling COBOL - with DB2).
I don't know it's also a problem to have the same transaction if you are calling Java from COBOL.
YDM
 
Posts: 1
Joined: Sun Jan 09, 2011 6:32 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Mainframe Java

 


  • Related topics
    Replies
    Views
    Last post