7 Min reading time

Mainframe modernization with Generative AI

30. 11. 2023

Your monthly dose of mainframe. Taking a glimpse into how Mainframe can be modernized through the use of generative AI, as well as exploring IBM's latest tool for application development.


In the ever-evolving landscape of technology, mainframe modernization stands out as a formidable task, with one of its most significant hurdles being the transformation of applications. For years, mainframe shops relied on robust in-house development teams adept at crafting core-business applications using languages like Cobol, PL/I, EGL, or even assembler. Guess what, young developers don’t fancy those languages! While various solutions have been attempted to modernize these applications, they often proved to be limited in their effectiveness. However, with the recent strides in generative AI technology, there is a promising breakthrough for addressing this challenge!

Earlier this year, IBM unveiled the IBM WatsonX Code Assistant for Z, a promising tool designed to revolutionize mainframe application development. As of now, WCAZ has reached General Availability (GA). What sets this tool apart is its foundation in generative AI, specifically leveraging IBM’s specialized Large Language Models (LLM) tailored for Cobol and Java. The marriage of cutting-edge AI technology and a focus on the intricacies of these languages is a testament to the forward-thinking approach, making the concept behind IBM Watson® Code Assistant for Z particularly captivating.

Basically, the process goes:

  1. Understand (existing code)
    – it helps to understand your application’s code, data, and their dependencies.
  2. Refactor (Cobol)
    – it decomposes your application into modular COBOL business services.
  3. Transform (to Java)
    – selectively translates COBOL business services into Java.
  4. Validate
    – verify the correctness and functionality of the refactored or converted code.
  5. Recommend
    – recommendation and deployment of best-fit architecture.
  6. Observe
    – monitoring and observation across the hybrid application landscape.

In more details

IBM WatsonX Code Assistant for Z (WCAZ) is a generative AI-assisted product built to accelerate in-place modernization of mainframe applications. WCAZ provides an end-to-end application developer lifecycle that includes application discovery and analysis, automated code refactoring and COBOL to Java conversion. Developers can automatically refactor selected elements of an application and continue modernizing in COBOL, or selectively transform code to Java leveraging generative AI using a highly tuned state-of-the-art large language model.

However, it is not a “magic machine” that transforms your legacy Cobol landscape into Java with one click. It is really “an assistant” that helps developers build new Java applications based on existing Cobol source code. Don’t expect miracles or you could be disappointed otherwise.

Let’s delve into modernization process in more details:

Application discovery and analysis: This stage helps developers understand the structure, dependencies, and complexity of the existing mainframe applications. It also provides insights into the potential benefits and challenges of modernization. It is based on IBM Application Discovery and Delivery Intelligence for IBM Z (IBM ADDI) so this would be a familiar environment for those who know ADDI. Its main functions include the following:

 Analysis of all components of a system to determine its structure and the relationships between, among and within program entities and the system and its components. The results of this analysis are stored in a data repository and can be examined by means of graphical displays and textual reports. Data in this repository serves as a basis for further analysis and synthesis.

Mining of the code to discover business rules of the application.

Automated code refactoring: This stage helps developers improve the quality, maintainability, and performance of the existing COBOL code by applying automated code transformations and best practices. It brings visualization tools, which help identify and extract specific code segments for refactoring. These tools provide a visual representation of complex application interdependencies, making the process more manageable.

 Uses code analysis algorithms and AI-driven technologies to modernize COBOL applications.

 Supports the process of extracting business services from existing monolithic applications, by helping developers to identify and isolate business logic in an assisted way.

COBOL to Java conversion: This stage helps developers convert COBOL code to Java code using a state-of-the-art large language model that is trained on millions of lines of code. The generated Java code is syntactically and semantically equivalent to the original COBOL code and preserves the mainframe qualities of service.

 Object-oriented: The Java code is designed to follow the object-oriented paradigm, which is different from the procedural paradigm of COBOL. This means that the Java code uses classes, objects, methods, inheritance, polymorphism, and other features of object-oriented programming to organize and structure the code.

⇒ Well-architected: The Java code is designed to adhere to the best practices and standards of Java programming, such as naming conventions, code formatting, modularity, readability, and documentation. The Java code is also designed to be compatible with the existing mainframe architecture and runtimes, such as CICS, IMS, DB2, and z/OS.

⇒ Performance-optimized: The Java code is designed to run efficiently and effectively on the IBM Z platform, which offers high performance, scalability, reliability, and security. The Java code is also designed to leverage the advantages of Java on Z, such as faster startup time, lower memory footprint, and better integration with the mainframe ecosystem.

The recommended version is IBM Enterprise COBOL for z/OS, Version 6.1 or newer. This is because the quality of the generated Java code depends on the quality of the input COBOL code, and COBOL 6.1 or newer has significant improvements to interoperate with Java. However, COBOL code that is not imported in the Transform step or does not interoperate with Java code does not need to be brought up to Version 6.1 or newer.

Code validation and testing: This stage helps developers verify the correctness and functionality of the refactored or converted code by using automated testing tools and frameworks. It also helps developers identify and resolve any issues or defects that may arise during the modernization process.

Code deployment and integration: This stage helps developers deploy and integrate the modernized code into the target environment, such as cloud, hybrid cloud, or on-premises. It also helps developers leverage existing DevOps tools and practices to ensure a smooth and continuous delivery of the modernized applications.

Code maintenance and enhancement: This stage helps developers maintain and enhance the modernized code by using the same generative AI capabilities that were used for the initial modernization. It also helps developers keep the code up to date with the latest standards and technologies.

Challenges and observations

WCAZ is a revolutionary tool that has a lot of potential, but it also may have some limitations and challenges as it is the first version of the product. I will outline some of the technical, architectural, and practical issues that I noticed from the webinar and the documentation. These are based on my initial impressions and may change after we get some hands-on experience with the tool.

COBOL versions
The current version of the tool recommends for the use of Cobol version 6.1, but the implications for those operating on earlier versions, such as V4 or V5, remain unclear. This poses a significant consideration for numerous customers who have yet to transition to the recommended version. The necessity of upgrading to V6 introduces an additional layer of complexity to the overall journey.

The generated code is for now intended to run side by side with compiled COBOL, PL/1, Assembler code in batch or online applications/systems natively on z/OS – using z/OS as the mixed language runtime platform it has been for decades.

At this stage it supports only work with source code written in COBOL language.

⇒ The best part for me is the incremental approach – you can modernize your applications step-by-step, module-by-module. And keep on running Cobol and Java parts in parallel. Most other tools end up in big bang which is high risk, and usually fails (we’ve seen so many failed modernizations/migrations).

⇒ I am a big fan of in-place modernization and I believe WCAZ is a perfect tool for it because it allows step by step modernization (see above).

⇒ The obvious comparison for WCAZ is AWS Blue Age, because both tools provides modernization path for legacy mainframe applications. However, AWS Blue Age requires transformation of whole application systems (including databases) or reasonably large modules. Therefore, a typical modernization journey takes months, plus extensive testing and the target in infrastructure is obviously AWS cloud. In the same time, WCAZ allows small iterative transformation steps, while keeping your trusty mainframe as infrastructure which can support Java and Cobol workload in the same time.

⇒ WCAZ transforms Cobol applications to Java, so you could easily consider transformation of Cobol applications generated by Teleon, EGL, or other 3GL/4GL tools. I don’t think it makes any sense.

⇒ The accuracy of the translated Java code by watsonx Code Assistant for Z needs to be tested and verified in a real-life environment. Especially, because mainframe applications typically supports critical business processes and the translated Java code must be 100% functional equivalent to original Cobol code.

⇒ DEVOPS tools and processes are not prerequisite for using WCAZ, however I would strongly recommend launching DevOps practice and setting up tools and pipelines , before you start using in production new Java applications generated by WCAZ

Don’t get too excited yet. The first version of any software tool might have some glitches or limitations. It’s a good idea to try it out on a small scale before you commit to a big project. That way, you can see if it works for you and your needs.

Here at CROZ, we’ve immediately set up a team of experts to start playing with new tool, before we start the real projects.
Stay tunned for the first impressions!

Get in touch

If you have any questions, we are one click away.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Contact us

Schedule a call with an expert