Whether translated mainframe code is equivalent is settled by running it, not by a model's score
When AI translates mainframe programs, equivalence is not a score. A batch program either produces the same output for every input or it does not. What proves it is comparing, bit by bit, against what the original program actually produced, not having a model read both versions of the code and return a number above a threshold.
In a technical post on November 16, AWS showed one route for moving mainframe Assembler programs to the cloud: use Amazon Bedrock and Kiro to extract the business rules and write a specification, have a model translate the Assembler into COBOL, then hand that COBOL to AWS Transform to produce Java Spring Boot. The COBOL step exists so that people who know the business have a readable intermediate version to review. I agree with that idea, and the post places human review at the critical stages.
What made me stop was how the Assembler-to-COBOL step is validated. The example the post gives is a prompt: give the model the Assembler, the COBOL, the business rules and the specification, ask it to run six checks and score them, and call the result "passed" if the weighted average reaches 0.7.
The pass mark is 0.7, but no output is 70 percent correct
In that weighting, syntax and structure count for 20 percent each, and logic and data flow for 30 percent each, with business rules coverage and specification compliance adding 10 percent each on top. A translation with clean syntax and neatly matching paragraphs has earned 40 percent from syntax and structure alone before anyone asks whether the arithmetic is right. The post says the threshold can be adjusted, but wherever it is set, it measures how alike the two programs look.
Differences in mainframe programs are often as small as one operand. When the Assembler SRP instruction shifts right, it rounds using the rounding digit in the instruction. In COBOL, when a result has more decimal places than the receiving field holds, it is truncated unless ROUNDED is specified. Whether the SRP rounding digit is 5 or 0, and whether the COBOL line says ROUNDED, is a one-character difference in the code, yet it can change the last digit of an amount by one, which in reconciliation is a cent. In a score, that is a small deduction. In the ledger, it is an entry that does not reconcile.
The documents used for checking are the ones used for translating
The validation step has a structural problem as well. The business rules and specification the model checks against are the same ones the previous step translated from. If rule extraction missed a rule, the translation misses it too, while the "business rules coverage" check can still come back perfect, because it measures whether the code follows that list, and the list was already one rule short. I wrote in an earlier article about code and tests written from the same specification. This is the same problem on the review side: the checker holds the same answer key as the one being checked.
A nightly batch that adds up amounts shows the difference only on the day a total overflows
Picture a nightly Assembler batch program that has run for many years, using the AP instruction to add each of the day's transactions into a running total per branch. The program has decimal-overflow interruptions turned off and checks the condition code after each addition instead. According to the z/Architecture Principles of Operation, when the total no longer fits, AP drops the overflow digits, stores the result and sets condition code 3. When the program sees 3, it writes an exception record and sets return code 8, so the scheduler holds the downstream payment jobs.
If the COBOL translation turns this into an ADD without ON SIZE ERROR, then under the Enterprise COBOL rules an overflow produces a value by the truncation rules and the program carries on. On ordinary days the two programs produce identical output. Only on the day some branch total grows too large does one program stop while the other, for a packed-decimal total field, hands the payment run a total that has lost its highest digits.
The translation prompt in the AWS post does ask for error handling and bounds checks, so this part may well come out right. A person or model reading the code may also spot the branch at a glance, or may miss it. The point is that the score cannot tell you which happened. Only an input that really overflows, run through both programs once, can.
The old program still runs, and it is the most reliable answer key
Translating mainframe programs comes with an advantage that is easy to overlook: the original program is still there, and still running. AWS itself says in another post about testing that rewrite projects requiring functional equivalence need bit-by-bit comparison of outputs, and the AWS Transform compare tool does exactly that. The Assembler post likewise lists test data with expected outputs among its prerequisites. What is missing is not tooling. It is applying the same practice to the Assembler-to-COBOL step and making execution results, not scores, the gate.
One detail matters a great deal here. The reference should always be what the original Assembler produced on the mainframe, not the intermediate COBOL. If the Java version is tested against the COBOL version's output, any difference the COBOL step missed becomes, at the Java step, the correct behavior, and every test passes. The intermediate version is useful for people to review. It should not be the answer key.
The hard part is the input. It needs data that covers the edges: negative numbers, zero, maximum values, totals that do not fit, and how the program ends when the data is bad. Most of it has to be selected from real production input, then deliberately topped up with the cases that turn up once a year.
The model's score is still useful. It can tell reviewers which paragraphs to read first and which rules may not line up. But what decides whether a translation moves to the next stage should be what the two versions produce when they run. The AWS post opens with a situation its authors say they have seen again and again: a batch job that has run for decades, and the only person who understands its code is about to retire. Once that person leaves, the last witness that can say exactly what the program does is the program itself, and it is still on the machine, ready to run again.
These are my personal views and do not represent IBM. Products and practices mentioned here are as described in each company's public information.