ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial3 min readDisconfirmAI Editorial

AWS Proposes a Five-Stage Method for Translating Mainframe Assembler to Java: Using COBOL as an Intermediate Layer for Human Verification Gates

The AWS Machine Learning team describes a multi-stage approach for migrating mainframe assembler code to Java. The core design inserts COBOL as an intermediate representation between low-level assembler and high-level Java, allowing domain experts to verify that business rules are fully preserved after each conversion step before handing off the final stage to AWS Transform. The method uses Amazon Bedrock as the inference platform for the first four stages and provides specific prompt templates and a six-dimensional verification framework.

2026-11-17 01:29 GMT+8

Assembler programs on mainframes still run critical batch jobs for banks, insurance companies, and airlines, but fewer people can read this code. Directly asking large models to translate assembler into Java sounds like the easiest path, but the AWS Machine Learning team considers this approach too risky. They propose a five-stage process: first extracting business rules from the assembler, then generating intermediate COBOL code, undergoing human verification, and finally using AWS Transform to convert the COBOL into a Java Spring Boot application.

The core judgment behind this design is that the semantic distance between assembler and Java is too great, lacking a checkpoint where human experts can understand and validate it. Assembler expresses logic through registers and memory addresses, while Java uses object-oriented programming and dependency injection; there is no natural intermediate language between them. COBOL fills this gap—it is closer to business semantics than assembler and closer to procedural style than Java, and domain experts in mainframe environments can still read and verify it. The intermediate COBOL stage provides a structured, human-readable format, allowing domain experts to confirm that business rules are fully preserved before the final conversion.

Amazon Bedrock serves as the inference platform for the first four stages: business rule extraction, specification generation, assembler-to-COBOL conversion, and validation. The first step involves inputting the assembler code along with data dictionaries and business context into the model, requiring it to output a structured JSON list of business rules, where each rule has a unique ID, input/output fields, trigger conditions, and a natural language description. The second step feeds the validated rule list back into the model to generate COBOL data structures and process flow designs, including PIC clauses, hierarchical levels, and paragraph divisions. The model temperature is set to zero to ensure output consistency.

Sign in / Sign up
ReadingResearchRadarInvestment framework

The third step uses these specifications to guide actual assembler-to-COBOL code generation. The prompt template dictates COBOL column formatting (sequence numbers occupy columns 1-6, indicator occupies column 7, boundaries for Area A and Area B), data type mapping (PIC 9(n) corresponds to integers, COMP-3 to financial fields), and annotation standards—each paragraph must be annotated with the business rule ID it implements. Output requirements are strict: return only COBOL code, without explanatory text. This traceability design ensures that subsequent verification has a basis for reference.

The fourth step is validation. The six-dimensional inspection framework covers syntax correctness, structural alignment, logical equivalence, data flow integrity, business rule coverage, and specification compliance, assigning a score from 0 to 1 for each dimension. A weighted average reaching 0.7 is required to pass. It similarly requires returning only a JSON-formatted validation report, without explanatory text. This essentially uses another model call for code review, but the review criteria are predefined rather than open-ended.

The final step is handed over to AWS Transform, an existing AWS tool for automatic COBOL-to-Java conversion, responsible for introducing service-layer designs such as dependency injection and repository patterns. This step is completed automatically by the tool because previous validations have already ensured the correctness of the COBOL code's business logic.

The transferable aspect of this method lies not in COBOL itself, but in a general engineering principle: when the semantic distance between source and target languages is too large for direct verification, insert an intermediate representation readable by human experts as a verification gate. Several experiences summarized by the AWS team point to this conclusion—the multi-stage approach is more reliable than direct conversion, writing specifications before generating code helps identify understanding deviations early, and performing incremental testing at the end of each stage exposes problems earlier than waiting until the end to verify.

Sources

  • aws.amazon.comAmazon Web Services↗
Continue researching →