Executive summary
Organizations with large COBOL estates face mounting modernization pressure due to rising platform costs, a shrinking mainframe talent pool and the complexity of interdependent applications. This blog outlines a pragmatic, two-step approach to modernizing COBOL systems to idiomatic Java using HCLTech’s internal AI-based discovery and analysis tool called iLIT-AI, augmented with deterministic application context from CAST’s knowledge graph integrated via the Model Context Protocol (MCP). A pilot evaluated a representative subset of a production environment. The results indicate material efficiency gains in analysis/specifications extraction and automated code translation, with additional improvements in accuracy when the CAST context is incorporated.
The challenge: Trapped in legacy infrastructure
For decades, essential business logic has been embedded in COBOL programs operating on mainframe systems. But these systems carry significant downsides: a diminishing workforce and high licensing and infrastructure run costs. Organizations recognize the need for modernization, yet the overwhelming complexity of legacy codebases — millions of lines spanning programs, copybooks and batch jobs — renders traditional modernization efforts slow, costly and prone to failure. Traditional modernization programs often span years and struggle with the scale and complexity of legacy portfolios. Recent advances in AI and LLMs offer acceleration, yet accuracy may degrade as system complexity grows. A balanced approach is required — one that combines AI with deterministic, system-wide context and practitioner oversight.
Agentic AI approaches now present a promising path forward, though they carry their own constraint: as complexity escalates, accuracy and reliability deteriorate.
HCLTech proposed to assess the impact of an improved AI context by embedding the CAST deterministic knowledge graph into HCLTech’s iLIT-AI platform for discovery and analysis to generate functional specifications, including call flows and business rules. This combined approach was validated through a pilot experiment completed in March 2026.
The two-step modernization approach
The pilot focused on a representative subset of a production mainframe environment: a collection of COBOL programs along with their related copybooks, JCL batch jobs, DB2 schema and stored procedures. The objective was to quantify the gains in speed, accuracy/efficiency and completeness that this combined approach could deliver. A large mainframe application with nine million lines of code was chosen for this exercise.
Step 1 — Analysis and specifications extraction
Before any code can be translated, the legacy system must first be deeply understood. The aim is not a line-by-line translation that produces "Jobol" — COBOL logic awkwardly dressed in Java syntax — but a genuine reconstruction of the business logic in idiomatic, modern Java.
Gaining that deep understanding of complex legacy systems is precisely where most modernization programs stall. In practice, purely manual discovery is not viable at scale. Automated tooling is essential, though each solution brings its own profile of accuracy, completeness and efficiency. Some degree of manual refinement for the "last mile" will always remain necessary.
In this pilot, three pathways were evaluated:
- HCLTech iLIT-AI platform performing its own contextual analysis
- The same platform augmented by the CAST knowledge graph, integrated via MCP
- The third pathway was creating a baseline with manual effort
Use cases considered for Step 1
- AI-driven documentation
- Deep discovery for running various use cases like feature addition with impact analysis, data call graph investigation, etc.
- Tech debt discovery and remediation
- AI-driven investigation of the objects and dependencies
Unlocking further gains at scale
Beyond the pilot scope, additional improvements would be achievable when operating against larger codebases. In fact, CAST structural analysis can identify dead code and duplicated or copy-pasted logic before conversion begins — allowing teams to eliminate unnecessary volume upfront. In large COBOL estates, dead code alone can account for up to 25% of the total codebase. Carving this out prior to modernization meaningfully reduces effort, cost and downstream complexity.
Step 2 — Automated code generation in Java
With higher-quality specifications in hand, the HCLTech platform converted the requirements into functional Java code. The output generated was verified: linting, compilation and functional testing against scenarios derived directly from the specifications.
The pattern was clear: stronger input documentation produced stronger output code and the compounding benefit across both phases was demonstrated.
Smarter testing at scale:
For large codebases beyond the pilot scope, the CAST knowledge graph offers an additional advantage during verification. By mapping dependencies and understanding the impact of each change, teams can scope testing precisely to the endpoints affected in each iteration — rather than running full regression suites or freezing the entire COBOL codebase while executing the transformation. The result would accelerate validation cycles significantly as the transformation progresses. Moreover, at the end of the transformation or each iteration, the structural integrity of the generated Java can be checked against ISO 5055 to reassure the client on AI-generated code integrity.
Results
This pilot confirmed a key insight: a deterministic knowledge graph for the complete application significantly improves context for AI-driven transformation:
For step 1
- 61+% efficiency gains brought by HCLTech iLIT-AI platform compared to traditional transformation approaches (manual without AI) and
- On average, an additional 23% efficiency was observed when the CAST knowledge graph is coupled to the HCLTech platform through MCP.
- On average, accuracy increased by 15% when the CAST knowledge graph is coupled to the HCLTech platform through MCP.
For step 2
- 51+% efficiency gains brought by HCLTech iLIT-AI-generated specifications, compared to manual code creation without AI or automation.
- On average, an additional 20% efficiency was observed when the CAST knowledge graph is coupled to the HCLTech discovery and analysis tool through MCP.
- On average, accuracy increased by 15% when the CAST knowledge graph is coupled to the HCLTech platform through MCP.
Note: Efficiency is derived through the weighted factors of quality and comprehensiveness of the output, combined with effort reduction.
Looking ahead: Transformation accelerated by a double-digit percentage factor
For large-scale transformations, we can reasonably expect a double-digit percentage efficiency gain by combining deterministic context with Agentic AI approach and jointly we achieved an overall accuracy increment of over 90% and modernization efficiency in the range of 71% to 84%.
Generating specifications precise enough to power automated application modernization remains a challenge today. But leveraging AI and deterministic context allows transformation at a cost/quality threshold previously out of reach. The last mile will always need the practitioner in the loop, at least to validate.
For enterprises overseeing mainframe portfolios spanning millions of lines of COBOL, this degree of acceleration fundamentally shifts the equation — not only reducing costs but also minimizing risks and allowing a realistic exit timeline.



