The problem
COBOL batch jobs rarely fail loudly. They run at night, produce files and reports, and everyone assumes they work. The trouble shows up when you try to change one: nobody knows which programs touch a given file, which JCL steps are dead, and which copybooks are shared across five applications. The original author retired years ago. The documentation, if it exists, describes a version of the system that no longer matches the code.
Big bang rewrites fail for a predictable reason. Batch jobs carry decades of business rules that were never written down: special cases for one customer, rounding rules for a tax calculation, a sort order that downstream reports depend on. A rewrite team discovers these rules only when the new system produces different output. By then the budget is spent and the old system has already been switched off in test.
The safer path is incremental. You move one job, or one step in a job chain, at a time. You keep the old code running until the new code proves itself against it. The goal is not to eliminate COBOL on a deadline. It is to shrink the parts you cannot safely change, one piece at a time, while the business keeps running.
Start by accepting that some COBOL will stay. A well tested batch program that runs once a night and has not changed in ten years is not your problem. Your problem is the jobs that block change: the ones tied to an end of support database, the ones nobody can modify without fear, the ones whose failures cost the most.
What a good solution looks like
A good modernization plan has three properties. First, every step is reversible. You can run the old job and the new job side by side and compare outputs before you retire anything. Second, the scope of each step is small enough to test in a week or two, not a quarter. Third, the business rules are captured in a form people can read, not just in code.
That means you separate the work into layers. The scheduling layer (JCL, job dependencies, restart logic) can often move first, because it changes less and is easier to test. The data layer (VSAM files, sequential files, database tables) comes next, because moving data forces you to understand every program that reads it. The program logic moves last, and only for jobs where the logic actually needs to change.
A good solution also keeps the interfaces stable. Downstream systems consume files, reports and database tables. If you keep the output format identical during migration, you can swap the engine underneath without touching the consumers. That is the cheapest kind of modernization: same contract, new implementation.
Finally, a good plan names what you will not do. Maybe you keep the COBOL sort but replace the reporting step. Maybe you rehost to a cheaper platform without touching a line of code. Maybe you retire two jobs entirely because their output is no longer used. All three are valid. The plan should say which one applies to each job and why.
How to build it
Step one is an inventory. List every batch job, its schedule, its inputs, its outputs, and the programs it calls. Pull the JCL and parse it, or do it by hand if the estate is small. For each program, note the copybooks it uses and the files it opens. You will find dead steps, duplicate jobs and files that only one program touches. Mark each job with a risk score: how often it fails, how hard it is to change, and what happens downstream if it breaks.
Step two is rule capture. Read the PROCEDURE DIVISION of the highest risk programs and write down the rules in plain language: what the program does with a record, what it does with an error, what it writes out. Talk to the people who use the output. They know the exceptions the code handles. Put these rules in a shared document or a spreadsheet, one row per rule, with the program and line reference. This document becomes your test oracle.
Step three is a parallel run harness. Build a way to feed the same input to the old job and the new job and diff the outputs. For file based jobs, that is a file comparison. For database jobs, it is a row by row check. Run it in test first, then in production on a shadow basis, where the new job writes to a separate output location and nobody consumes it yet. Fix differences until the outputs match or the differences are explained and accepted.
Step four is cutover, one job at a time. Change the scheduler to point at the new job, keep the old job available for one cycle, and watch the first production run closely. If something breaks, point the scheduler back. Repeat for the next job. The order matters: start with jobs that have few downstream consumers and simple outputs. Save the jobs that feed financial postings or regulatory reports for last, when your harness and your team have practice.
Keep the old code in version control even after cutover. You will need it for reference when a rule turns out to be wrong. Archive the JCL and copybooks alongside the new code so the history stays in one place.
Risks and how to manage them
The biggest risk is hidden rules. A program looks simple until you find a hard coded date, a special customer number, or a sort that depends on EBCDIC collating order. Parallel runs catch most of these, but only if your test data includes the odd cases. Pull a sample of production input files that covers month end, year end and known exceptions. If you cannot get them, ask the operations team which runs historically caused trouble.
The second risk is timing. Batch windows are tight. A new job that runs slower than the old one can push the morning reports late. Measure elapsed time for the old job on a normal night and on a heavy night, then measure the new one the same way. If the new job is slower, either tune it or run it in parallel on separate capacity until you are confident.
The third risk is the scheduler. Job dependencies are often undocumented. A job that looks standalone may feed a step three chains away. Before you cut over, trace every downstream consumer of the job's output. If you miss one, it will fail silently or produce stale data. A simple dependency map drawn on a whiteboard and photographed is better than nothing.
The fourth risk is skills. The people who understand the COBOL are retiring. Pair them with the people who will maintain the new system. Record walkthroughs. Have the new team run the parallel comparison themselves, not just read the results. Knowledge transfer is a deliverable, not a side effect.
Finally, watch for scope creep. Someone will ask why you are not rewriting the whole system while you are in there. The answer is that the parallel run harness is what makes the work safe, and it only covers the jobs you have scoped. Adding jobs mid stream dilutes testing and delays the ones that matter.
How to measure success
Measure by jobs migrated, not lines of code removed. A job is migrated when it runs in production, its output matches the old output, and the old job is retired or archived. Track that count weekly. It gives an honest picture of progress that a rewrite percentage never does.
Track defects found in parallel runs and defects found after cutover. The first number should be high early and fall as your harness improves. The second should stay near zero. If post cutover defects rise, your test data is not representative or your cutover checklist is skipping steps.
Track batch window time and failure rate for migrated jobs against their historical baseline. A migration that makes the window longer or the failure rate higher is not done, even if the code is new.
Track how many jobs remain in the high risk bucket. The point of the work is to shrink that list. When the remaining jobs are stable, well understood and cheap to run, you can stop. Not every COBOL program needs to be replaced. Some just need to be left alone, documented, and monitored.
If you want outside help getting the inventory and the risk ranking done quickly, the Legacy modernization sprint from Cloudverg is $8,500/month, fixed scope over three weeks, and produces exactly that: an inventory, recovered rules, a ranked risk list, migration options with costs and a step by step sequence with rollback points. It is one option among others, and it fits teams that need a plan before they commit to a multi month program.
Frequently asked questions
Do we have to rewrite all our COBOL to modernize batch jobs?
No. Most estates can migrate the scheduler and data layer first, then move only the programs that block change. Stable jobs that nobody needs to modify can stay in COBOL, documented and monitored, while you focus effort on the high risk ones.
How do we test a migrated batch job without disrupting production?
Use a parallel run. Feed the same input to the old and new jobs, write the new output to a separate location, and compare results before any consumer reads them. Run in test first, then shadow in production for a few cycles, and only then point the scheduler at the new job.
What is the first step in a COBOL batch modernization?
Build an inventory of every job, its schedule, inputs, outputs and programs, and score each job by failure history and change difficulty. That ranked list tells you which job to migrate first and which rules you need to capture before you touch code.