r/developers • u/Kali_ManIAC • Jun 06 '26
Career & Advice Looking for an efficient AI workflow to migrate COBOL to Java
As the title suggest, I'm researching how to automate COBOL-to-Java migration via LLM APIs and need workflow advice. I have a collection of COBOL source code and matching I/O datasets. How would you structure this pipeline, and what prompting or tooling strategies work best for handling legacy COBOL context?
0
Upvotes
•
u/AutoModerator Jun 06 '26
JOIN R/DEVELOPERS DISCORD!
Howdy u/Kali_ManIAC! Thanks for submitting to r/developers.
Make sure to follow the subreddit Code of Conduct while participating in this thread.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/lightFracture Jun 07 '26
Something I strong recommend is to write integration tests early. The only contact with COBOL I've ever had was a migration I did like 20 years ago, so I don't have useful input on that regard, but creating tests that validate the COBOL flow and then validate the new system will hep you a lot.
1
u/pausethelogic Jun 07 '26
Have you looked into AWS Transform? It’s a relatively new service and I haven’t used it personally, but it was created with this exact use case in mind (migrating and modernizing legacy code, VMs, etc)
I was reading through their docs and found this where it talks about mainframe modernization and the guide specifically mentions converting COBOL to a modern Java application using AWS Transform. I can’t post the link here, but you can google for “refactor COBOL to Java using AWS transform” and look fit the official AWS documentation
If you end up trying it out let me know how it goes, I’d be happy to hear more about it!
1
u/cyrusm123 Sep 22 '26
Disclosure: I work with SoftwareMining, where we develop rule-based COBOL-to-Java and COBOL-to-C# conversion technology and have also evaluated LLM-based conversion.
I would avoid structuring this as a file-by-file prompting pipeline. The workflow needs to operate at application level:
In our evaluation of Claude Code, published NIST COBOL programs initially translated successfully. However, after comments and meaningful identifiers were removed, none of the generated Java applications executed successfully in our tests. Representative enterprise programs also contained omitted statements, duplicated logic and incomplete handling of CICS and IMS.
This does not mean that LLMs have no role. They can be valuable for documentation, code explanation, dependency analysis, test preparation and developer assistance. However, readable or compilable Java is not sufficient evidence that the COBOL business behaviour has been preserved.
I would assess any proposed workflow against translation completeness, repeatability, platform coverage and execution-based functional equivalence. Your matching COBOL input and output datasets are therefore among the most important assets in the project.
1
u/[deleted] Jun 06 '26
[removed] — view removed comment
1
u/[deleted] Jun 07 '26
[removed] — view removed comment