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.
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.