00:00:00Let's explore how developers can use Clod Code to modernize a COBOL codebase.
00:00:05For the purposes of this demo, we'll use AWS's Mainframe Modernization Demo Repository.
00:00:11This is a medium-sized credit card management system with around 100 files, including COBOL
00:00:16programs, copybooks, and JCL scripts.
00:00:19Phase 1 – Discovery and Documentation
00:00:21Our sample COBOL codebase has almost no documentation.
00:00:25This is, of course, common with legacy codebases, where critical business logic and regulatory
00:00:29requirements are embedded within undocumented code, the developers who wrote the code have
00:00:34long since left the organization, and developers familiar with COBOL are hard to hire.
00:00:40We first created a specialized subagent using Clod Code's /agent command.
00:00:44This was our COBOL documentation expert and translator.
00:00:47Subagents can be invoked by Clod Code in parallel, and they operate with their own isolated context
00:00:53windows to avoid polluting the main thread.
00:00:56We enabled thinking mode, and asked Clod Code to analyze the architecture of the codebase.
00:01:01Clod Code created a to-do list of all 94 files, and tracked its progress to ensure no files
00:01:06were processed twice and nothing was missed.
00:01:09The documentation Clod produced went beyond simple code comments.
00:01:13For example, let's look at the interest calculation program CBACT04C.
00:01:20It extracted the complete business workflow, how the program reads transaction category
00:01:24balances, looks up interest rates by account group, applies business rules for fallback
00:01:29rates, and updates account records.
00:01:33Clod did this for each file, but also created two memory files as plain text.
00:01:39Catalog.txt translates cryptic names like CBACT04C into interest calculator batch program.
00:01:48Relationships.txt maps every dependency using a simple, pipe-delimited format.
00:01:55Using these indices, Clod then generated mermaid diagrams, a complete map of the daily batch
00:01:59processing workflow, showing how the data flows from transaction input through posting, interest
00:02:05calculation, and finally to customer statements.
00:02:08In this demo, Clod Code ran continuously for an hour to draft over 100 pages of documentation,
00:02:13but Clod Code is capable of running for over 30 hours autonomously, and the techniques
00:02:19used here scale to much, much larger codebases.
00:02:23Phase 2.
00:02:24Migration and verification.
00:02:26After thoroughly documenting the Cobalt codebase, we asked Clod to migrate one of its core features
00:02:30to Java.
00:02:31We switched to planning mode to ensure Clod would think through the entire migration strategy
00:02:36without prematurely editing files.
00:02:38Clod analyzed the program formerly known as CBACT04C and identified complex Cobalt patterns
00:02:46like line break processing and multi-file coordination.
00:02:50Clod developed a migration plan for this feature with five phases.
00:02:531.
00:02:54Create the project structure.
00:02:562.
00:02:57Translate data models from copybooks to Java classes.
00:02:593.
00:03:00Build the I/O layer compatible with the original file formats.
00:03:034.
00:03:04Convert business logic while preserving Cobalt-specific behaviors.
00:03:08And finally, create a dual test harness, one using GNU Cobalt 3.2.0 for the original codebase
00:03:14and one in Java 17.
00:03:17The resulting Java code went beyond a simple syntax translation.
00:03:20Clod created proper Java classes with appropriate design patterns, error handling, and logging.
00:03:25Idiomatic Java that a modern development team would actually maintain.
00:03:30Next was verification to ensure that the new Java code worked the same as the Cobalt code
00:03:35it was replacing.
00:03:37Clod created multiple test data files and ran them against both the original Cobalt and the
00:03:42new programs.
00:03:43The verification compared not just final outputs, but intermediate calculations, file writes,
00:03:48and data transformations.
00:03:50The result was perfect bit-for-bit fidelity.
00:03:53Every calculation, business rule, and edge case was preserved.
00:03:57Of course, this demo application is far smaller than your legacy Cobalt codebases.
00:04:02But all the techniques here are scalable.
00:04:04Clod code will empower your developers to modernize codebases with confidence and efficiency
00:04:10that simply would have been impossible just 12 months ago.