Watsonx Code Assistant for Z is the Rosetta Stone for mainframes
The COBOL language underlies critical business systems, but WCA for Z is using the power of AI to help developers understand and modernize it.
With every passing year there are fewer COBOL programmers. Yet more than 65 years after COBOL was developed, the first programming language for business remains key to the daily operations of countless enterprises around the world. And these codebases can be huge — a core banking application may contain thousands of programs. Working with that as a monolith is difficult. That’s where watsonx Code Assistant for Z comes in.
With watsonx Code Assistant for Z, IBM is bringing the power of AI to legacy code. Much like the Rosetta Stone once helped linguists crack languages that had been lost to history, WCA for Z has already been assisting in application modernization by helping clients migrate from COBOL to Java. But now a team at IBM Research has been working to infuse AI agents into the service to solve several additional problems, from understanding mainframe applications to refactoring code, and generating functional tests.
WCA for Z scans through all that code and captures a structural and functional model of the entire application so that users can break out specific parts to work on them. In an insurance application, this could mean isolating the code involved in creating home insurance policies so it can be converted to Java.
Yogish Sabharwal, a distinguished engineer at IBM who works on WCA for Z, is motivated by the reality that many of the people who still know how to work with COBOL are reaching retirement age. Old code isn’t a problem per se, and COBOL can often still be the best choice. COBOL remains a secure and time-tested language for many critical enterprise systems. The issue, Sabharwal said, is that few programmers are learning COBOL today. “This means there are fewer people who understand customer applications,” Sabharwal said. With lines of code written in the 1980s still handling many financial transactions today, it’s crucial for developers to be able to interact with and update programs written in COBOL.
Using an AI assistant within the integrated development environment, WCA for Z users can inquire about a particular business logic or function to discern which sections of code do what. The AI assistant routes the question to the appropriate AI agent and comes back with an answer. And if a user needs more information about the exact logic being employed, they can dig deeper with additional questions.
The National Organization for Social Insurance (NOSI), Egypt successfully modernized their application portfolio by leveraging WCA for Z. This tool facilitated the exploration, documentation, and comprehension of their intricate COBOL applications and their integration points with remarkable ease. As a result, NOSI observed a substantial 79% reduction in the time their developers needed to understand these complex applications. In specific instances, this time was reduced from 24 hours to approximately 5 hours.
Similarly, a prominent global logistics company, during their mainframe application modernization journey, experienced a significant 60% increase in productivity through COBOL to Java transformation, utilizing WCA for Z.
At the heart of WCA for Z is IBM’s Granite family of large language models, with agents and retrieval-augmented generation (RAG) architecture built around the model to enable it. The LLM is trained, in part, on explanation and grammar datasets. Application insight data comprising static analysis information is used to enhance the LLM’s translation capabilities. IBM researchers are also building additional sets of training data, because the existing pool of COBOL data is finite. Research to improve model training is continuing apace, as researchers feed new documents to the model, select the best embeddings to use in different layers, and identify the ideal retrieval and generation techniques for different use cases.
COBOL powers mission-critical functions for the businesses that keep global business moving, running in the background for the vast majority of credit and debit card transactions. It is used not just in the IBM mainframe operating system z/OS but also in Unix, Windows, and a handful of other operating systems used by enterprises. COBOL is everywhere, quietly powering our connected world.
“For IBM Z clients, the entire business may depend on these applications,” said Amith Singhee, director of IBM Research India. “It is a huge business risk to not have sufficient skills to maintain, debug, modernize, and enhance these applications going forward.”
Aiding this mission, WCA for Z’s automatic refactoring capability can help a user create a new application from the existing code base, as well as build and test it in the integrated development environment (IDE). In this case, the AI assistant calls on the proper automation tool to create tests that ensure the new program works as intended.
“It’s not as if we move the entire workload to Java,” Sabharwal said. “Some of COBOL’s transaction-processing capabilities are still very powerful on IBM Z.” Converting COBOL to Java may be where Sabharwal and his colleagues started with WCA for Z, but now they’ve developed deeper understanding capabilities, where a user can generate explanations of any part of the code in natural language. They can chat with the code assistant and ask questions about their application. That can help them understand what is located where, and what certain pieces of code do. “It fills in the missing expertise of the COBOL expert,” Sabharwal said.
Application understanding is a major client need, given the scarcity of COBOL skills and application expertise, Singhee added. And the IBM Research team is pushing the boundaries of AI-based agentic technology to bring more breakthroughs in the near future.
The refactor assistant also lets clients pull out services for modernization. In the insurance policy example, home and auto insurance policy creation may be intertwined, so the refactor assistant disentangles them to be dealt with individually. “It’ll help you easily slice out those specific lines of code that implement the business service you’re interested in,” said Singhee. That can all then be collected into a workbook and exported as a separate COBOL program.
If you want to transform it to Java, the transform workflow can help. COBOL has a very different data model than Java, based around global variables rather than the hierarchical classes of Java. To cleanly convert from COBOL to Java, WCA for Z must create Java classes, inferring their interdependencies from the COBOL data structure that the LLM has mapped out. After capturing them, WCA for Z actually translates the logic, converting COBOL code, paragraph-by-paragraph, into Java code and fitting it into the appropriate Java method signature within the appropriate Java class.
“That’s where the magic of program analysis happens,” Singhee said. All the analyzed COBOL data is used to create a prompt for the LLM which has all the instructions and context needed to translate the code into Java, all of which complies with the appropriate data mapping.
Users can then compare the function of the new Java code to the original COBOL code. The LLM will pass the same data inputs through both to see what comes out the other side. And if they don’t produce the same result, WCA for Z will call that out and help the developer work to fix the new Java code.
The June release of watsonx Code Assistant for Z will add the capability of AI Assisted COBOL code generation to assist COBOL developers in maintaining and extending functionality of existing COBOL applications. “That’s going to help customers generate COBOL code within IDE or via chat,” said Sabharwal. If someone wants to add new functionality, for instance, WCA for Z will help them find the right location and modify the code accordingly — while considering the entire context of the existing code.
Related posts
- ResearchKim Martineau
An AI model with a finger on the time series pulse
ReleaseKim MartineauIBM Granite model tops Hugging Face speech recognition leaderboard
NewsMike MurphyA faster way to screen supply chains for harmful chemicals
ResearchKim Martineau