
An AI translated a COBOL wire-transfer program into Java. It compiled. Tests passed. The first transaction corrupted the database.
The autopsy: the program used a variable called TRN-LIMIT, which the AI read as a simple number. But TRN-LIMIT was defined in a copybook pulled in thousands of lines earlier, under a REDEFINES clause — where the same chunk of memory means two different things depending on a flag set in another module entirely.
On the mainframe it held a packed decimal. The Java code wrote corrupted binary into the database column. Syntactically perfect. Contextually blind.
This is why 70-80% of mainframe modernization projects fail. The tools treat code as text when the real problem is topology. One COBOL program can reference 40+ copybooks; its batch schedule chains thousands of JCL jobs where Job A writes a file Job B reads at 2 AM. "Paste COBOL, get Java" sees none of it.
And you can't freeze it: COBOL still runs 95% of ATM transactions, and its authors retire at 10% a year.
So we invert the order: map the whole estate first — copybooks, JCL chains, packed-decimal fields, hidden flags — before touching a single line. You can't safely migrate what you can't see. The map also tells you where to start: the lowest-coupling module is the one you can carve off without the whole estate flinching, and most tools never even look for it.
If you've been through a mainframe migration: what broke that nobody saw coming?
#LegacyModernization #MainframeMigration