IBM Z and LinuxONE IBM Z

  • 1.  Spinoff: Calling Java from IBM Z Cobol Application

    IBM Champion
    Posted Thu October 07, 2021 07:58 AM
    Similar to Aiden's message below...my team is trying to figure out how to call an external Java Class from our IBM Z Cobol application.  Does anyone know what utilities we need to use? 

     Thanks!
    Kari



    ------------------------------
    Kari Nagle
    ------------------------------


  • 2.  RE: Spinoff: Calling Java from IBM Z Cobol Application

    Posted Fri October 08, 2021 03:52 AM
    Edited by Diego Cardalliaguet Fri October 08, 2021 03:52 AM
    Hi there,
    What you want to do depends much on where your Java program resides.
    If your Java program is running on z/OS and in the same LPAR as the COBOL program I'd use WOLA connection pooling that will allow you connect COBOL and Java (bidirectionally) with the same techniques as if you were using JDBC. You need to run your Java program inside a WebSphere Liberty (not Open Liberty it must be WebSphere Liberty). Also, if the COBOL program is running on CICS it's direct and simple to invoke Java programs on CICS Liberty (that is, Liberty running on CICS).
    More information is needed for a more precise advice.
    Regards,
    D.

    ------------------------------
    Diego Cardalliaguet
    Europe GEO Technical Sales
    IBM
    ------------------------------



  • 3.  RE: Spinoff: Calling Java from IBM Z Cobol Application

    Posted Fri October 08, 2021 10:51 AM
    Edited by Leigh Compton Fri October 08, 2021 10:51 AM

    Similar to Diego's response, it all depends on where your COBOL and Java applications are executing.  Diego addresses the scenario where the Java program is executing in WebSphere Application Server (WAS) or Liberty on the same z/OS LPAR as your COBOL program.  Here are some other scenarios:

    * Batch COBOL program wants to call a Java program somewhat like a subroutine call -- use INVOKE verb as supported by Enterprise COBOL
    * CICS COBOL program wants to invoke a Java program running in a JVM inside CICS -- use EXEC CICS LINK
    * Any COBOL program wants to invoke a Java program running in an application server anywhere (on z/OS or even another operating system) -- use a REST invocation

    There are other options, but these four are the most common scenarios.

    Leigh Compton
    CICS and Integration Technical Specialist
    IBM Washington Systems Center



    ------------------------------
    Leigh Compton
    ------------------------------