This is a cache of https://developer.ibm.com/articles/mainframe-app-modernization-interoperability/. It is a snapshot of the page as it appeared on 2025-11-14T13:02:03.782+0000.
Accelerate Mainframe application modernization with Generative AI and COBOL Java interoperability - IBM Developer

Article

Accelerate Mainframe application modernization with Generative AI and COBOL Java interoperability

Learn how to achieve incremental modernization of mainframe applications using IBM watsonx Code Assistant for Z and COBOL Java interoperability

By

Aravind Thalachil

Mainframe applications have supported enterprise operations for decades. Many of them are monolithic, poorly documented, and depend on knowledge held by a shrinking group of experts. Modernizing these applications on the mainframe by modularizing code, improving documentation, and enabling integration helps preserve reliability, performance, and security while also reducing risk and increasing agility.

This article explains why an incremental modernization approach is important and shows how IBM watsonx Code Assistant for Z and the COBOL/Java interoperability features in IBM Enterprise COBOL for z/OS can be used to achieve it.

Why choose an incremental approach

Incremental modernization means refactoring monolithic applications in small, manageable phases instead of attempting a complete transformation at once. This approach preserves core business logic and data integrity while gradually breaking the application into business services, using the best technology for each service.

Key benefits:

  • Reduced Risk – Smaller, step-by-step changes lower the chance of major failures.
  • Business Continuity – Critical operations stay functional during the process.
  • Cost Management – Investments are spread over time instead of requiring large upfront expenses.
  • Skill Leverage – Existing mainframe expertise is combined with modern development practices.

Incremental modernization with IBM watsonx Code Assistant for Z

IBM watsonx Code Assistant for Z is a developer assistant that supports the entire application modernization lifecycle using generative AI and automation.

The phases of watsonx Code Assistant for Z include:

phases of watsonx Code Assistant for Z

For details on the phases of watsonx Code Assistant for Z, see Key phases of watsonx Code Assistant for Z.

watsonx Code Assistant for Z is built to support incremental modernization by selectively updating parts of a monolithic COBOL application based on technical needs and business priorities. watsonx Code Assistant for Z enables:

  • Automated refactoring of a business function into a modular COBOL service.
  • Optional transformation of the COBOL service to Java if it is the best fit.
  • Use of COBOL/Java interoperability on z/OS so that services can interact with each other.

The following figure shows how incremental modernization can use a best-fit technology approach with watsonx Code Assistant for Z.

phases of watsonx Code Assistant for Z

With this approach, it is important to have a simple method for COBOL and Java services to interact with each other.

Using COBOL/Java interoperability in Enterprise COBOL for z/OS

Enterprise COBOL for z/OS version 6.4, and later provides simplified COBOL/Java interoperability. It works without major changes to COBOL programs and does not require object-oriented COBOL.

Key features:

  • Call COBOL from Java

    • The JAVA-CALLABLE directive makes an existing COBOL program callable from Java.

      COBOL program with the JAVA-CALLABLE directive

      Figure: COBOL program with the JAVA-CALLABLE directive

    • Parameters, such as Employee Role ID and Employee Role, are automatically converted between COBOL and Java formats.

      Java code calling the COBOL program with optional parameters

      Figure: Java code calling the COBOL program with optional parameters

  • Share COBOL data with Java

    Enterprise COBOL version 6.4, and later provides the JAVA-SHAREABLE directive to make selected WORKING-STORAGE data items accessible to Java applications. These items can be read and updated directly from Java.

    COBOL program with WORKING-STORAGE items marked as JAVA-SHAREABLE

    Figure: COBOL program with WORKING-STORAGE items marked as JAVA-SHAREABLE

    Java code that reads those data items Java code that writes those data items

    Figure: Java code that reads and writes those data items

  • Call Java Methods from COBOL

    Enterprise COBOL version 6.4, and later provides an enhanced CALL statement that allows a COBOL program to call a static Java method. Parameters can be passed, and they are automatically converted between COBOL and Java formats.

    COBOL program calling a static Java method

    Figure: COBOL program calling a static Java method

    For more details, see COBOL/Java interoperability outside of the object-oriented COBOL framework.

Conclusion

Enterprises can speed up mainframe application modernization by taking an incremental approach. Using the generative AI features of IBM watsonx Code Assistant for Z together with the COBOL/Java interoperability in Enterprise COBOL for z/OS helps achieve this while keeping systems reliable and secure.

References