Don’t Blame Your Mainframe—It’s a Software Problem

Mainframes have long proven themselves to be sturdy and reliable. Now those same systems that companies have trusted to keep the lights on for decades seem to be making it difficult to move forward. One global bank, for instance, faced months of delay in launching a new digital service in a competitive market because key customer data was trapped inside a mainframe, stalling integration with modern platforms. It is not a surprise therefore that mainframe modernization is emerging as a top business priority, though the specific goal varies from company to company based on strategic intent, industry priorities and the IT maturity of each company.

In our conversations about mainframes with companies across industries, we see three primary categories of users. The first group is comprised of companies with deep investment in mainframes, and they remain loyal to it. Their aim is to modernize the mainframes in place. The second group seeks to exit mainframes in specific domains based on their business needs but are not on a zero-mainframe journey. And finally, there is the third category that is fully committed to exiting mainframes by 2030 or 2035.

Unfortunately, mainframe modernization often sparks fear and confusion in the minds of CIOs. This stems from a misdiagnosis of the problem. Mainframe hardware isn’t what needs urgent modernization. Despite being dubbed obsolete for over three decades, IBM z-series mainframes continue to thrive. They’re upgraded regularly, they run mission-critical applications globally and they remain incredibly stable.

So what’s holding innovation hostage? It’s the mainframe software ecosystem. Having evolved over decades of incremental enhancements and patchwork, often without proper documentation, mainframe software is a tangled mess.

Most of today’s mainframe workloads rely on legacy code—COBOL, Assembler and other third-generation languages—authored by now-retired developers. Over the years, these programs have been subject to thousands of incremental changes. Business logic is replicated in multiple places. Documentation is sparse. In many cases, nobody alive fully understands how the code works. Yet the business still runs on it.

What’s been stopping businesses from addressing this problem? A critical concern is the related economics, which isn’t in favor of modernization. As one software leader put it: “It cost me $6 million to add a digit to my SKU. But it was still faster and cheaper than modernizing the entire application.”

This reveals a longstanding structural issue: modernizing legacy code is a costly initiative with no immediate payoff. The business logic still needs to do what it already does, just on a newer platform. Unless a regulatory or operational crisis forces the issue, there’s little appetite to take it on.

Moreover, even with advances in code translation tools that convert COBOL to Java or other modern languages, the result is often a one-to-one functional port—efficient, yes, but not innovative. These tools preserve the “truth” of how the business works today but fall short of reimagining how it could work tomorrow.

[pullquote align=”left”] “What’s holding innovation hostage? It’s the mainframe software ecosystem. Having evolved over decades of incremental enhancements and patchwork, often without proper documentation, mainframe software is a tangled mess.” [/pullquote]

Enter generative AI. It doesn’t magically generate perfect microservices from spaghetti code. It does something more valuable by making legacy code intelligible at scale. This does not solve all problems, but it significantly shifts the feasibility and speed of mainframe software modernization. To realize its full benefits, however, businesses must clearly understand the economics, capabilities and mindset required for mainframe software modernization.

Rethinking what’s worth modernizing

Traditional modernization treated all legacy code as sacred. Translation tools would port everything, line by line, from COBOL into Java or C#, ensuring nothing was lost in the migration. Yes, some parts of legacy code are still “useful” in a modern context—especially when they contain stable and well-tested logic essential to critical business functions. The rest are boilerplate frameworks, outdated business rules and platform-specific hacks developed before modern tools like Spring, Kubernetes or DB2 even existed.

Generative AI enables a shift from “no code left behind” to “only the code that matters.” It allows architects to:

  • Distill millions of lines into meaningful summaries
  • Identify duplicative or orphaned logic
  • Understand undocumented modules without a COBOL expert
  • Prioritize modernization based on actual business usage

This shift in thinking forms the basis for three pragmatic modes of modernization now emerging in the field.

  1. EXPLAIN AND DOCUMENT: The first pragmatic mode of modernization uses generative AI to translate legacy code into readable, natural-language documentation to make it accessible to engineers not familiar with COBOL as well as business analysts. With generative AI, software teams can extract, explain and recontextualize millions of lines of legacy code, not just in technical terms, but in business language. Using retrieval-augmented generation (RAG) techniques and well-trained large language models (LLMs), engineering teams can now understand what a block of 40-year-old COBOL is doing, why it’s doing it and what business process it supports.
  2. TARGETED REFACTORING: The second pragmatic mode of modernization extracts high-value modules and core logic, then uses generative AI-assisted tools to refactor and optimize them into new services guided by composable design principles. Instead of blindly migrating code or rewriting everything from scratch, teams can selectively reimagine, refactor or retain code based on its business value. With generative AI, modernization timelines are cut by 50–60 per cent, reducing a typical five-year effort to just two or three years.
  3. SELECTIVE TRANSLATION: When a module is well-behaved and mission-critical but not strategic, the final pragmatic mode of modernization uses generative AI-augmented translators to shift code to modern languages.

The value of using generative AI as an enabler becomes clear in practice. Take the case of a leading global retailer undertaking the daunting task of refactoring over 30 million lines of COBOL code into Java as part of its strategy to exit mainframes entirely. To manage the scale and complexity of this ambitious project, the company adopted generative AI tools to automate the generation of test cases—one of the most time-intensive tasks in modernization. Using gen AI, it could automate test scripts and speed up validation and deployment across modern platforms, cutting test execution time by up to 30 per cent. This illustrates how generative AI can shorten timelines and reduce costs by making manual tasks faster and more intelligent.

The three models mentioned here are not mutually exclusive. They can coexist in a single program, chosen based on business priority and technical complexity. Historically, modernization followed a two-step approach: migrate legacy workloads to a modern stack, then rearchitect them for future needs. Generative AI offers the potential to collapse this into a single, integrated step—where code is simultaneously interpreted, optimized and aligned with the target architecture. This reimagining of the path can reduce disruption, save time and create tighter alignment with business goals.

Limitations and reality checks

Despite its promise, generative AI is not a silver bullet. It shifts the economics of software modernization and expands the frontier of what can be attempted, but it doesn’t eliminate the inherent complexity of legacy code.

For one, pattern recognition in legacy code is messy. Over the decades, developers have embedded domain-specific languages, handcrafted rule engines and idiosyncratic frameworks into their applications. While LLMs have learned the syntax of COBOL and other 3GLs, they can struggle to interpret these hyper-local constructs without adequate context or abstraction.

Second, while generative AI can produce natural-language explanations of legacy code, those outputs still require careful human review. Engineers must validate translations, resolve ambiguities, and architect new designs based on business objectives—not just technical equivalence. In many cases, AI-generated documentation may be so voluminous that it overwhelms the very teams it was meant to empower, unless paired with thoughtful summarization and domain modeling strategies.

Third, business logic is rarely cleanly separated from infrastructure code. Legacy logic is rarely modular. Encryption routines, transaction managers, and file handlers are often deeply interwoven with application logic. AI can surface these connections, but untangling and redesigning them requires architectural skill. Here too, human expertise is critical—not just to modernize the code, but to reimagine its role in a new architecture.

Generative AI’s effectiveness also hinges on three critical factors: the correctness of what it outputs, the completeness of the logic it captures, and the readability of its explanations. Hallucinations—outputs that look plausible but are factually incorrect—remain a risk. Trust must be built through controlled prompting, domain grounding and human-in-the-loop validation.

Emerging architectures using “agentic AI”—where the AI critiques and iterates on its own outputs—may help address these issues. By simulating peer review or incorporating business rules, agentic models offer a path to better quality control. In short, generative AI provides speed and visibility. But the act of modernization still requires human leadership.

Human leadership

When it comes to inventing the future, human interpretation and creative design remain a necessary component. And nowhere is that clearer than in forward engineering.

Once the core logic is identified and understood—what it does, how it works and what matters—rebuilding can begin. Not with blind translation but guided by composable architecture principles and future business intent. Architects and engineers still need to define business domains, design systems, build APIs, frame services, organize data and stitch together microservices that support the business.

What’s different is the starting point. With accurate, AI-generated documentation and deep contextual understanding from the legacy estate, engineers can work with greater clarity and speed. Generative AI produces documentation that is more complete, accurate and readable. For one business, this meant a 50 per cent reduction in requirement reduction effort. The integration of generative AI doesn’t just accelerate the work of engineers—it also helps them shift from reverse engineering to domain mapping, from module analysis to business capability modeling and from manual code audit to AI-assisted pattern recognition.

As noted above, no one’s handing over the keys to AI and walking away. Generative AI is not the architect but a force multiplier—the assistant that enables teams to move forward with precision. With the right prompts, context and architecture in place, it enables software teams to engage with legacy systems more deeply, move forward with more clarity and reimagine business processes with greater precision.

A modernization case study

A leading global bank sought to modernize its outdated and costly mainframe-based core banking system by migrating to the cloud. The goal was to improve efficiency, enhance scalability and achieve over a 40 per cent reduction in total cost of ownership (TCO)—at the same time freeing the business to innovate.

But the scale of the system was immense: 14 mainframes across seven data centers serving 10 countries across Europe, North America and LATAM, supporting more than 200 applications per country and impacting around 160 million customers worldwide. Legacy code spanned ~80,000 COBOL programs (nearly 1.2 billion lines of code), 500K JCL scripts and 200K DB2 tables. This required working across key workstreams, including governance, technical architecture, app and data migration, testing, and change management.

To manage this complexity, the company embedded AI and generative AI from the start to map dependencies, decode legacy logic and accelerate delivery. A dual-run certification model helped ensure that new systems mirrored legacy behaviour. Forty success factors governed the entire migration lifecycle, ensuring consistent, high-quality execution across all phases. Migration was completed with minimal disruption to operations while maintaining data integrity and security across all regions.

The initiative brought customer data to the forefront, enabling faster experimentation and launch of new business models. By moving to the cloud, the bank gained scalability to handle future growth, improved data accessibility and created a foundation for DevOps to build and run modern applications, thereby extending the value of core banking investments.

From coding to curating

Perhaps the most profound change generative AI introduces is a new division of labor. Software engineers are no longer mere translators of legacy code. They become curators, orchestrators and reimaginers of business logic.

Instead of being buried under syntax, they are elevated to decision-makers who determine what to preserve, what to rewrite, what to retire. Generative AI is the assistant – but it is an assistant with encyclopedic knowledge, 24/7 availability and an ever-expanding capacity to learn.

Strategic implications

The convergence of generative AI and mainframe modernization has real implications for enterprise leaders.

  • It enables a shift from monolithic to modular modernization. Modernization is becoming incremental. Enterprises can take a domain-by-domain approach, guided by business impact, rather than facing a monolithic transformation.
  • It unlocks a broader engineering workforce. Talent bottlenecks are eased as generative AI takes over rote analysis. Engineers, regardless of age or legacy skillset, can contribute effectively to modernization.
  • It improves business-IT collaboration. AI-generated mappings between code and business processes can enable stakeholders to jointly define modernization priorities.
  • It unblocks innovation. Freed from legacy code paralysis, teams can build cloud-native services, leverage analytics and integrate modern AI capabilities into core systems.

Generative AI’s momentum is also reinforced by ecosystem shifts. Leading service providers are partnering with hyperscalers to embed AI-powered tooling into cloud-native platforms. These integrations allow companies to combine cloud-scale infrastructure with AI-led legacy modernization at speed and scale.

Modernizing mainframe software has always been possible. It just hasn’t been practical. But legacy code no longer has to hold innovation in chains. By changing the cost-benefit equation, generative AI provides the tools to break free.

Challenges remain. Architecture still matters. Engineers are still essential. But thanks to AI, organizations can finally embark on a journey of code modernization, moving beyond defensive patching and toward greater agility, growth and reinvention. In fact, to maximize ROI, this is a must for organizations that remain reliant on mainframes.