COBOL and AI: Building a Self-Serve Knowledge Layer for 2,000 Batch Jobs

On-Call Nightmares and the COBOL Modernization Challenge

The speaker opens by asking who has been on call for a COBOL mainframe production system, illustrating the tribal knowledge problem faced when jobs fail at 2AM. He introduces the context: a 5,000,000-line COBOL system, 40-50 years old, and an engagement to help an organization modernize by extracting business logic using LLMs, using AWS Bedrock and Anthropic Claude in Sydney due to regulatory constraints.

Understanding Mainframe Batch Jobs

The speaker explains how mainframe batch processing works, noting mainframes are optimized for consistent, fast, low-error batch jobs that take inputs and produce outputs like bank statements. This sets the stage for understanding why COBOL systems are structured the way they are before diving into the documentation approach.

Building Context with Claude.md and Personas

The speaker describes creating a claude.md file from scratch to build context for Claude, including giving it a persona as an 'elite mainframe batch operations expert' to tune its outputs toward COBOL-relevant terminology. This context file grew over time into a valuable documentation resource for the team's ongoing work.

Batch Scheduling, JCL, and Database Context

The speaker details how CA7 batch scheduler outputs help map job dependencies, and explains JCL (Job Control Language) structure including PGM references, database access permissions, and copybooks that define table structures. This information gives Claude the necessary context to understand what each COBOL job does and its business logic.

Sourcing External Context: Repos, APIs, and Documentation Tools

The speaker explains how they cloned 10-15 COBOL repositories locally and configured Claude to call the Azure DevOps API when source code wasn't available locally, later turning this into a reusable skill. He also covers using the Atlassian MCP for Confluence searches and the Docling tool for converting proprietary PDFs to markdown, rounding out the multi-source context-gathering strategy.

Scaling Up: From Sub-Agents to the Claude Agent SDK

Faced with a request to document 2,000 jobs, the speaker describes early unreliable attempts using sub-agents that inconsistently processed job batches, leading to a switch to the Claude Agent SDK for full control over batch processing with separate context windows. He also addresses hallucination issues that decreased over time as context improved, along with automated validation using a rubric and deterministic checks.

Validation, Confluence Upload, and Documentation Outputs

The speaker details the human spot-check process and automation pipeline that validated Mermaid diagrams via MMDC and uploaded documentation to Confluence using the API (since MCP couldn't handle plugins). He shows an example job output featuring data flow diagrams that let viewers quickly understand a job's logic and data movement.

Experimenting with Agent Core and a Front-End Interface

The speaker shares an experiment hosting the Claude Code SDK as an agent via AWS Agent Core with a website front end, using a public AWS mainframe GitHub repository as a demo. This setup allows business analysts to query jobs and customize prompts without needing deep technical access.

What Worked Well and Lessons for Improvement

The speaker highlights that well-commented COBOL code and consistent acronym usage greatly helped LLM comprehension, along with Claude Code's efficiency in scanning repositories. He also reflects on what he'd do differently, including better cost attribution via AWS application inference profiles or AI gateways, and incorporating static analysis tools, noting the total cost was surprisingly low at about $2K in tokens.

The Bigger Picture: Should You Automatically Convert COBOL?

The speaker challenges the idea of fully automated COBOL-to-modern-language conversion (as demonstrated by Anthropic), arguing that old batch-based business processes were shaped by outdated technology constraints and shouldn't simply be ported one-to-one into event-driven modern systems. He advocates instead for documenting the estate, identifying pain points, and following Thoughtworks' proven strangler-fig migration patterns.

Spotting Mainframe Pain Points and Strategic Modernization

Using a real-world example of a US public service with limited online hours due to overnight batch processing, the speaker illustrates how to identify mainframe-driven pain points worth targeting for modernization. He emphasizes focusing AI-assisted documentation efforts on high-value business areas rather than attempting a full system overhaul.

Key Takeaways: Iteration, Institutional Knowledge, and Focused Agents

The speaker summarizes core lessons: experiment iteratively when entering new environments, find the person who 'knows where the bodies are buried' to validate context, and keep agents focused on single activities to avoid incoherent results. He notes that Anthropic's newly released dynamic workflows could make this entire process more efficient going forward.

Closing Thoughts: Documentation as the First Step to Modernization

The speaker concludes by framing estate documentation as step one and system modernization as step two, emphasizing that AI-assisted documentation offers an unprecedented opportunity to reduce reliance on institutional knowledge. He closes by urging organizations to act now to gain a competitive advantage through AI-driven legacy system understanding.

Thank you. Good afternoon, everyone. So who's ever been on call for a production system? Who's been on call for a production system that's COBOL based on a mainframe? Anyone? I think there's zero hands. So this is ZOS, and it's a system this command is the system display and search facility to get the status of a batch job. So traditionally, as a mid range or Linux person, you probably use Tail to look at what's happening, you know, for a job.

That'd be like a similar type command that you might sort of understand. Imagine that you wake up, you know, 2AM, the people who have been on call will realise this. They've been on call, they wake up, they have to get context of whatever job has failed or whatever production system has failed.

A lot of that is tribal knowledge. So people who are on call regularly will know the things that break and how to fix them. But those who are not, you know, it becomes a bit of a sometimes a bit of a challenge especially if it's a new system. So COBOL's been around since 1959, pretty sure that's the date.

So a lot of COBOL systems out there today are you know, forty, fifty years old. This particular system has 5,000,000 lines of code approximately but there's plenty out there that are probably a lot larger than that. So we had an engagement to work with an organization who wanted to they're sort of doing a modernization I guess in a way and the systems are being moved to a bunch of people who don't have a lot of history with this particular COBOL code or the business logic that it provides.

So they wanted to see if you could get business logic out of these systems and figure out how they work. I wasn't entirely sure that the LLMs could do that. So it was a bit of an experiment which turned into a bit of a bigger job than we anticipated. It's a regulated a lot of COBOL is in regulated industries so we had to use Bedrock on in in Sydney and Anthropic Claude in Sydney and that that appeared in Sydney at the time that we started this engagement which was very very good.

So it's locally based LLMs and we use clause code as well quite a bit for this as well too. So this talk is about the guess it's bit of a journey from how we started the experimentation, what worked, what we do differently and it's, you know, figuring out we didn't really know the environment so we had to find out, you know, how to build up the context that we could use for this system.

So a batch a lot of COBOL is based on batch jobs, mainframes do batch very well. They're designed for running, you know, consistently fast with minimal errors, jobs that take inputs, produce outputs, connect to integrating systems. An example might be back in the day you used to get bank transactions mailed out to you.

That would have been the output of a COBOL job that went to a printer that went that you know, did a database query, went to a printer and then eventually you get your bank statements mailed out to you. It's that's that's basically what this is. There's a couple of other examples on the screen there but that's just a view of what these sorts of jobs do.

So we started off by building a repo, it was blank, nothing in it. So we created a claude.md which we started to build up on to give it, you know, the context. Not you we always joke about giving Claude a persona. You know, you are an elite mainframe batch operations expert in this example. That well, it sounds funny.

It's actually it actually does help because obviously the LMs are trained on a bunch of data and it tunes the outputs to mainframe esque type systems output in the in the output tokens that it gives you. So it doesn't talk about Docker containers, it talks about COBOL language related things. And then as we found new things, we added it to this MD file and this repository built up with different outputs of documentation for different aspects of of the COBOL job, so it's actually quite a good resource for for them to continue on with when they're, you know, querying their their code.

So another thing that is important when you're working with LLMs is that you need to sometimes you have to create little utilities. Clauda is excellent at building little utilities to do things. So in this example, we needed to start off with the batch scheduler. So they use CA7 which is Computer Associates. Everyone heard of Computer Associates?

I think BMC owned them now, I'm pretty sure. So they were around back in the day. They did a lot of batch scheduling and if you output the batch schedule, it's a text file effectively at a point in time with all the jobs, all the dependencies and the times that these jobs run, all those sorts of things.

So in this example, you've got some upstream job dependencies, this is all fictional data based on sort of real data and then there's downstream jobs. So this is important because if you're documenting a COBOL job, you kind of need to tune Claude where to look for to get the information for that job and to be able to focus it on the programs and the inputs and the outputs that that job needs to run.

This is what a batch job kind of looks like, JCL, job control language. There's a PGM which tells it the program to use. A program could be as simple as an IBM provided thing to read a database. You give it some parameters or it could be some custom program or procedure. And the the other thing about these COBOL jobs is that you have to give it the database that it needs to use in this job. Every job uses some sort of database.

They use hierarchical databases in in mainframe world. And it basically gives this job permission to be able to access that database and then there's a thing called copybook which gives it the structure of the table within that database. So that job provides a lot of information for Claude to figure out what it does because it gives it the database context, the the program context and all the business logic context.

Sometimes so we we cloned there was at least 10 to 15 COBOL repositories that we cloned to give locally to give Claude the context to be able to search all the all the source code. Sometimes there's interfacing programs like there's dot net stuff, there's a lot of SOAP APIs connected via Kix transaction gateway.

So sometimes there's external interfaces coming in that talk to they met the mainframe by calling these these that's how mainframes contact talk via the outside world via these external interfaces. So sometimes that code I might not have locally and Claude figured out to call the DevOps, Azure DevOps API to be able to find the repository for a particular thing using the API.

So when we provided that into the claude.nd, it knew to do that process if it couldn't find the source code locally. Any tokens are all in the environment. We and then that later on that became a skill, so you have a little, you know, Azure DevOps skill to be able do that thing. So there's other area so it's not just code.

So there's Azure DevOps Wikis, there's Confluence pages, so we used the Atlassian MCP, hosted MCP that they released last year. So that was super handy to be able to search Confluence very efficiently. There's proprietary PDFs that we converted. There's a tool called Docling which is excellent at converting PDF to markdown and it can search those things as well to be able to get, you know, context about proprietary libraries and things like that.

So there was a lot of experiments. Stage one was a lot of experimentation. So that was kind of what we've gone through at a high level. We need it and then the customer said, okay, we've got 2,000 jobs, can we document them all? I'm like, that could be challenging because there's obviously context issues, I didn't know how long it would take.

So we had to look at some automation. So we tried to use sub agents. The problem with sub agents is when you tell Claude to use a subject agent to do something and you give it a whole bunch of you know, ten, fifteen jobs. Sometimes ignores that or sometimes it'll do the sub agent for half of them and not the other half.

So it wasn't really reliable. So we ended up going to the Claude agent SDK where you have full control over what Claude's doing. It does use the command line at the back end sort of wrapped but you can send it multiple so I could send it a 100 batch jobs and we'd go off and do batches of ten, twenty as I think jobs separately.

So they all had separate context windows and provided a basically documented into a markdown file each of those jobs. So how do you know it's correct? That's a good question. We did have a problem with a lot of hallucinations early on when we hadn't provided enough context but over time that got a lot less. Using the automation, we set up an automated validation path which looked at what was output as a little rubric and some deterministic checks. There's actually quite a lot of talks around deterministic checks that have been on.

Tanya had one yesterday. That's really important and then it gives a score in about five categories of how good that documentation is. If it's not good enough, it'll go redo those particular areas and then consider it done. And we also had human spot checks, so sometimes there's people who know these systems, they have a look at the jobs and they're pretty impressed at the outputs that were provided.

So after that, they're all marked down files locally in this repository, so then we set up an automation to validate the Mermaid code within the job using the MMDC command line utility and then use the Confluence API to upload it into their Confluence. So all these jobs ended up in Confluence in some sort of order that they could search and find, you know, information, business logic about a particular job.

We couldn't upload using the MCP because that's restricted at what you can do. You can't upload things that need plug ins like Mermaid for example, so we had to use the API. So this is an example of what a job could look like, sort of the outputs and there's also, you know, some diagrams and what the thing that's really good is the data flow because you can see at a glance what the job's doing, where it's talking, the data being passed, all that sort of stuff.

That's an example. I've got an example of experiment that I was using agent core. Once you once we were using the Claude code SDK, you can host that as an agent and have a website in front of it. So this is an example of an experiment I was doing with the public. There's an AWS mainframe repository on GitHub.

So if you put a front end in front of it with ClaudeCode in the in the agent core back end on AWS, you know, it can do all that work and give you the documentation or whatever. You can customize the prompts, make it easy for business analysts to query the jobs, all that sort of stuff.

So one thing with COBOL jobs is they're well commented. One of the COBOL developers did a lot of commenting at least in this repository that I was using, so that helps the LLM because you get a lot of business knowledge in that and they use a lot of acronyms and things consistently, relatively consistently and that was really good. Getting the database structure from the job is really good and just the efficiency in being able to scan the repository and find all the related code, ClaudeCode was very impressive in that regard. If I did things I'd do differently, one thing is around cost attribution. When you've got a lot of experiments running and a few other queries that you're doing, you can't really associate the costs very well for the task.

So I'd probably have a dedicated you can have a thing called an application inference profile on AWS which allows you to use that as your sort of model endpoint and then all the costs for example for this sort of work could be all tracked to that one thing. But you could also use an AI gateway, things like that. And going forward, doing a bunch of static analysis, there's a lot of static analysis tools.

Think a lot of most of them are paid for but they they can be used in conjunction with the LLM to make sure you've got all the dependencies for the particular task at hand. The costs for this exercise is about 2 k in tokens which is actually not that much when you think about it. Pretty good value for sort of getting that information there to be able to help our ops teams understand what these jobs actually do.

So the bigger picture. There'll be people out there who say they can convert all your COBOL automatically which even Anthropic put out a video and a blog post a few months back, you know, where they converted a whole COBOL repository as is into I can't remember what it was, Python or something. So, yeah, I can do that.

But do you want to? Because these systems have been built in such a way that they the business processes were constrained by the technology at the time and that's why there's so many batch jobs because back in the day, the batch jobs wrote to tape and then tapes were sent to places. These days we have real time interactivity, integrations to everywhere.

So these days, it's all about event driven so you wouldn't actually convert it one to one because we do things differently these days. So but what you can do is, well the way I'd approach it, is document the estate, identify the biggest pain points.

Everyone's got their pain points. Customer pain points, operational pain points, those sorts of things. And then just use the standard patterns which Thoughtworks are doing, they've been doing it for a couple of years of migrating COBOL systems to more modern languages, strangling the monolith, doing bits and pieces at a time, the highest pain areas and you don't have to do everything, you can just do the bits that where you get the most value from.

This is a real example from a public service I found online in The US. You'll find there's a clue that there's a mainframe behind something if their service hours online have a limit. So in this case, you know, from 1AM onwards during the week, you can't actually do any transactions for this particular service because they're probably doing some sort of online batch activity overnight.

So this is the sort of pain point that you could remove, you know, focusing on a particular business aspect, documenting that, using AI to document it, and pulling that that code out. So my takeaways are experiment iteratively, probably nothing new there but it it is important especially if you go into a new environment, understanding their ways of working and then sort of slowly automate that once you've got that context and you know what that context holds.

Find the person who knows where the bodies are buried. There's always someone who knows, you know, where everything is. That person is valuable. They can validate what you're doing. They can validate the context that you're using, the information that you're using, all that sort of stuff. And they're invaluable, not just COBOL obviously, there's always someone, you know, whatever language that you're doing will know that.

Keep the agent focused on one activity. As in our case, most of the stuff was batch jobs, you could focus it on that particular area because as you know, if you've given LLM access to all your code all at once, it's just gonna be pretty random at what you get back. The LLMs are like children, they'll go, what's over there?

Look over there, look at all this stuff and probably not get a coherent response. That was due until last Friday when Anthropic released dynamic workflows. So a lot of this could be redone using that process probably more efficiently because Dynamic Workflows allows it to do some exploration, figure out an inventory, and process that using, you know, 50 to a 100 or more agents to figure out do exactly what we've been doing for for this for this thing.

So so documenting your estate is step one. And then step two is figuring out how to modernize your system. Using AI and LLMs, there's been never a better opportunity to modernize because you have the documentation there. You don't have to rely on all the people. You do have to rely on people to validate a lot of the information but you can get a long way using, you know, documenting your estate. And if you don't do it, you you can do it now and get a competitive advantage on your competitors.

So that's me. Thank you.

READY
SDSF ST JOB1400
Screenshot of a terminal displaying a mainframe command-line interface.
READY
SDSF ST JOB1400

# translated for the rest of us

$ tail -f /var/log/batch/JOB1400.log

02:00 • TUESDAY

A batch job fails at 2 a.m.

You've seen this before.

Wake up. Get context. Resolve it.

If you're lucky – an hour gone.

THE PROGRAM THAT FAILED

It's COBOL.

5M LINES OF CODE

40 YEARS OF PATCHES

>_ THE THESIS

The model isn't the bottleneck. Context is.

Everything in this talk is about building that context — layer by layer.

WHAT THESE JOBS ACTUALLY DO

A batch job is rarely just "a program".

01 GENERATE CUSTOMER OUTPUT

  • 12 months → PDF → mail
  • DB2.TRANSACTIONS → format → PDF → print queue / email

Read each customer's last 12 months of activity, format per template (legalese, branding, totals), generate PDFs, queue for print or email delivery.

8M statements/month • "must finish before the postmen arrive"

02 COMPLIANCE • REGULATORY EXTRACT

  • AML • FINCEN • APRA filing
  • scan all txns → threshold filter → regulator schema → submit

Find every transaction over a regulatory threshold, format per the regulator's schema (different per jurisdiction), submit before the deadline.

hard deadline • gov't penalty if late • auditors love mainframes

→ Each one a real-world contract. An auditor expects an extract. A customer expects a statement. Miss the window and someone notices.

The slide outlines two types of batch jobs. The first, "Generate Customer Output," is illustrated by two process flows: "12 months to PDF to mail" and "DB2.TRANSACTIONS to format to PDF to print queue / email." The second, "Compliance Regulatory Extract," is illustrated by a process flow: "scan all txns to threshold filter to regulator schema to submit."

STEP ZERO • THE WORKSPACE

One repo. All the gathered context.

CLAUDE.md

# persona · the role we anchor the model in

You are an elite mainframe batch operations expert with deep expertise in IBM mainframe systems, batch job scheduling (Control-M and CA-7), JCL, and enterprise batch processing. Your role is to analyse, document, and understand complex mainframe batch operations with precision and clarity.

Δ CRITICAL: When given a task, start working IMMEDIATELY. Do NOT present greeting messages, menus, or wait for user selection. Begin executing the task right away.

# ... and ~140 more lines below this point.

A screenshot of a text editor or file viewer displaying the contents of a Markdown file named claude.md.

_> LAYER 01 - BEFORE READING ANY COBOL

A small Python utility reads what the scheduler knew.

ljob_analyser.py - a navigable model of every job, every dependency, every trigger.

WHAT IT PULLS OUT –

  • Job numbers, JCL paths, system assignments
  • Calendar IDs (daily, Mon-Fri, month-end)
  • Predecessor requirements + lead times
  • Triggered-by / triggers / virtual resource locks
  • Operational history (recorded runs, restarts, lateness)

→ 3,000 jobs rendered as a graph. The skeleton before a line of COBOL is read.

$ ljob_analyser.py ACCT1400 --tree
# Job: ACCT1400 · 3,772 runs · 2 restarts

upstream (jobs ACCT1400 waits on)
ACCT1400
├── ACCT1090
│   ├── EPAY1A
│   │   └── PAY1020
│   │       └── SPAY1A
│   ├── SACCT1B
│   └── SACCT1D
└── TIME2215

downstream (jobs blocked if ACCT1400 fails)
ACCT1400
├── EACCT1D
├── ACCT1410
│   └── ACCT1420
│       ├── ACCT1020
│       ├── ACCT1022
│       └── ACCT2050
# 27 jobs in chain · max depth 5

>_ THE ARTEFACTS BEHIND A SINGLE JOB

A "batch job" deconstructed (JCL)

... $ how a single job is wired

//PAYROLL  JOB (ACCT),'NIGHTLY',CLASS=A
//STEP1    EXEC PGM=DSNMTU01,PARM='DLI,PAYR01,PAYRPSB'
//SYSLIB   DD DSN=PROD.COPYLIB
//PAYIN    DD DSN=PROD.PAYROLL.IN,DISP=SHR
  • //PAYROLL JOB: JCL: what runs, what files, what order
  • //SYSLIB: compiler resolves COPY statements here
  • //PAYIN: input dataset

PAYR01 // COBOL program - the actual logic

  • COPY CUSTMAST: copybook · shared data layout
  • PSB: PAYRPSB: IMS access contract
    • PCB → DBD: which database · which segments · RO/RW
  • EXEC SQL ...: DB2 cursors inline in COBOL

Multiple artefacts. Independently maintained. Must stay in sync byte-for-byte.

That's the documentation problem.

WHEN SOURCE ISN'T LOCAL

The agent learns to go look for itself.

agent - autonomous fallback

$ curl -s -u ":${AZDO_PAT}" -X POST 
    -H "Content-Type: application/json" 
    -d '{"searchText": "ACCT1400", "stop": 10}' 
    "https://almsearch.dev.azure.com/...codesearchresults?api-version=7.1-preview.1"

# -> returns ACCT1400.job content directly to the agent

# -> no human needed to locate the file

-> Find the source code that is not local.

>_ LAYER 03 TRIBAL KNOWLEDGE

The stuff that isn't in any file.

CURATED SOURCES WE FED IN -

  • Azure DevOps wikis – architectural decisions, known issues, "why is this job structured this way" answers
  • Confluence pages – runbooks, operational context
  • Proprietary PDFs → markdown – vendor docs and internal specs converted so the agent can grep them like source

MANUAL → SEMI-AUTOMATED → HEADLESS

Three stages of autonomy.

  1. Hands-on prompting · Claude Code CLI
  2. mainframe-batch-ops subagent · Claude Code CLI
  3. claude-agent-sdk · headless

>_ THE QUESTION EVERY AUDIENCE ASKS

"How do you know it's correct?"

  1. Agent self-check (inline)
  2. Automated validation pass
  3. Fix pass
  4. Human spot checks

>_ THE LAST MILE UPLOAD_JOB_DOCS.PY

3,000 markdown files → stakeholder-readable Confluence pages.

This slide outlines the process for converting markdown files into Confluence pages:

  • Starting with markdown files, e.g., jobs/ACCT1400.md
  • **Mermaid validation** using the mmdc utility.
    • If invalid, an auto-fix process applies 15 patterns, then retries validation.
    • If valid, the process continues.
  • **Markdown conversion** to ADF (Atlassian Document Format), which is JSON-based.
  • **Pairing Mermaid blocks** with the Atlassian Labs Forge extension.
    // Note: The extension reads code blocks by index, requiring a global counter.
  • **Page creation/update** in Confluence, specifically under the path ACCT/Batch Jobs/Batch Documentation.
  • A **rate limit** of 0.5 seconds between API calls is enforced, with retries on a 429 (Too Many Requests) error.

A flowchart illustrating the automated pipeline for converting Mermaid markdown documentation into Confluence pages, detailing steps like validation, auto-fixing, format conversion, pairing Mermaid blocks, and page creation with rate limiting.

THE STANDARD • ONE OF 3,000+

The shape of every documented job – live.

URL: /Users/matt/dev/v2/ai-engineer-talk/cobol-and-ai.html

Document Navigation:

  • BATCH DOCUMENTATION
  • AI-Generated - v2.0
  • THIS JOB
  • Overview
  • Job Information
  • Source JCL
  • Business Purpose
  • ARCHITECTURE
  • System Architecture
  • Data Flow
  • Job Steps
  • Database Structure
  • Processing Logic
  • OPERATIONS
  • Output Files
  • Error Handling
  • Execution Requirements
  • Downstream Dependencies
  • Alerts & Monitoring
  • REFERENCE
  • Related Jobs
  • Technical Notes

Data Flow

SEQUENCE DIAGRAM - STEP-BY-STEP DATA MOVEMENT

This diagram depicts interactions between the following systems/components:

  • Claims Web Portal
  • TRZ103 DR2
  • DGM7V01
  • DIQ10B Claim Master
  • DIQ20R Financials
  • GDC Output Dataset
  • CLAPR141 Report

19 sections • 3 mermaid diagrams • same shape across all ~3,100 jobs.

Screenshot of a web browser displaying a technical documentation page. The page has a left navigation sidebar listing various document sections and a main content area. The main content area displays a detailed sequence diagram, characteristic of a Mermaid diagram, titled 'SEQUENCE DIAGRAM - STEP-BY-STEP DATA MOVEMENT'. The diagram illustrates data flow and interactions between seven components: Claims Web Portal, TRZ103 DR2, DGM7V01, DIQ10B Claim Master, DIQ20R Financials, GDC Output Dataset, and CLAPR141 Report.

COBOL & AI - Building a Serverless Mainframe on AWS

A screenshot of a web browser showing a local HTML file.

>_ DEMO - CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Screenshot of a web application interface showing an AI agent (Claude Code on Bedrock Agentcore) in action. The interface displays input fields for query parameters, a text area for a user's question about mainframe business logic, a "Run Query" button, and a "Live activity" section detailing the agent's progress and tool calls (e.g., ToolSearch, Glob) to pull source files.

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

A screenshot of a web application interface for an AI agent demo, showing fields for configuring queries, a question input, a "Run Query" button, and sections for live activity and recent queries.

-> DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Screenshot of a web interface for an AI agent, displaying input fields for token and time budgets, response mode, a list of recent queries, and a live activity log showing the progress of a query, including repository retrieval, synthesis, and tool calls.

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Screenshot of a web application interface in a browser. The application features input fields for query parameters such as 'Primary repository', 'Query type', 'Token budget', 'Time budget', and 'Response mode'. There is a large text area labeled 'Question' containing a prompt for a mainframe expert to extract business logic and create a high-level component diagram. Below this, a 'Run Query' button is visible, followed by a 'Live activity' log showing streaming progress, including tool calls like 'ToolSearch: query=select:Glob,Grep,Read' and 'Glob: pattern=/mnt/efs/repos/aws-mainframe-modernization-carddemo/**/*.cbl'.

> DEMO - CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Time budget (seconds): 100000

300

Response mode: Streaming activity

Recent queries

  • freeform

    you are a mainframe expert - please pull out off the business logic for this application per application domain - include a high level component diagram

    g_4208288c85e74

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Screenshot of a web application interface showing an AI agent in action. The interface includes sections for recent queries and live activity, displaying tool calls and file paths related to AWS mainframe modernization COBOL code.

>_ DEMO - CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

CardDemo – Business Logic by Application

A screenshot of a web application interface in a browser, titled 'CardDemo – Business Logic by Application'. The interface displays an AI agent generating a high-level component diagram for a CICS online tier, detailing Security, Account, and Credit Card domains with associated COBOL programs.

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

High-Level Component Diagram

CARDDEMO APPLICATION

CICS ONLINE TIER

  • Security Domain
    • COSGN00C (Signon)
  • Account Domain
    • COACTVWC (View Acct)
    • COACTUPC (Upd Acct)
  • Credit Card Domain
    • COCRDLIC (List Cards)
    • COCRDSLC (Card Detail)
    • COCRDUPC (Card Update)
  • Menu Domain
    • COADM01C
  • Transaction Domain
    • COTRN00C
  • Billing Domain
A high-level component diagram shows the architecture of a CARDDEMO APPLICATION within a CICS ONLINE TIER. It displays six domains: Security, Account, Credit Card, Menu, Transaction, and Billing. Each domain lists specific COBOL programs or functions, such as COSGN00C (Signon) in the Security Domain, COACTVWC (View Acct) and COACTUPC (Upd Acct) in the Account Domain, and COCRDLIC (List Cards), COCRDSLC (Card Detail), COCRDUPC (Card Update) in the Credit Card Domain. Arrows indicate functional relationships, for example, from Security to Account and to Menu, and from Menu to Transaction.

DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

High-Level Component Diagram

CARDDEMO APPLICATION

CICS ONLINE TIER

  • Security Domain
    • COSGN00C (Signon)
  • Account Domain
    • COACTVWC (View Acct)
    • COACTUPC (Upd Acct)
  • Credit Card Domain
    • COCRDLIC (List Cards)
    • COCRDSLC (Card Detail)
    • COCRDUPC (Card Update)
  • Menu Domain
    • COADM00C
  • Transaction Domain
    • COTRN00C
  • Billing Domain
A high-level component diagram of a CARDDEMO APPLICATION on a CICS ONLINE TIER. It shows interconnected domains: Security, Account, Credit Card, Menu, Transaction, and Billing, each listing associated COBOL programs like COSGN00C for Signon, COACTVWC for View Acct, and COCRDLIC for List Cards.

>_ DEMO • CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

The diagram displays a COBOL system architecture with the following components:

  • Account Batch Programs: CBACT01C (Acct Rpt), CBACT02C, CBACT03C (Acct Rpt3)
  • Transaction Batch Programs: CBTRN01C (Verify Daily), CBTRN02C (Post Daily Trn), CBTRN03C (Tran Report)
  • Interest Calculation Program: CBACT04C (Interest Calculator)
  • Customer Batch Program: CBCUS01C
  • VSAM Data Stores: USRSEC, ACCTDAT, CUSTDAT, CARDDAT, CARDXREF, TRANSACT, TCATBAL
  • Domain: Security & Authentication

A blue diagram on a dark background illustrating a COBOL batch system architecture. It shows a series of interconnected rectangular blocks representing different batch processes like Account, Transaction, Interest Calculation, and Customer Batch, each containing specific COBOL program names. These processes interact with a horizontal row of VSAM Data Stores listed at the bottom. The entire structure is categorized under "Domain 1 - Security & Authentication".

_> DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

USRSEC | ACCTDAT | CUSTDAT | CARDDAT | CARDXREF | TRANSACT | TCATBAL |

Domain 1 - Security & Authentication

Programs: COSGN00C

Transaction: CC00

Business Rules:

  • On first entry (EIBCALEN=0), the sign-on screen is presented [COSGN00C line 80-83].
  • User ID and password are both mandatory; blank values produce inline error messages [COSGN00C lines 118-130].
  • User ID is forced to UPPER-CASE before lookup [COSGN00C line 132-136].
  • The system reads the USRSEC VSAM file by User ID key [COSGN00C lines 211-219].

Screenshot of a web page titled "COBOL & AI - Building a..." within a browser, displaying documentation generated for a COBOL program. The page shows navigation tabs at the top, followed by a section on "Domain 1 - Security & Authentication" which details program information and a list of business rules.

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

  • Programs: COSGNOOC
  • Transaction: CC00

Business Rules:

  • On first entry (EIBCALEN=0), the sign-on screen is presented [COSGN00C line 80-83].
  • User ID and password are both mandatory; blank values produce inline error messages [COSGN00C lines 118-130].
  • User ID is forced to UPPER-CASE before lookup [COSGN00C line 132-136].
  • The system reads the USRSEC VSAM file by User ID key [COSGN00C lines 211-219].
  • Password is compared directly against the stored value ( SEC-USR-PWD ); mismatch returns "Wrong Password. Try again" [COSGN00C lines 223-245].
  • User type code ( SEC-USR-TYPE ) drives post-login routing:
    • Admin users → XCTL to COADM01C (Admin Menu) [COSGN00C lines 230-233].
    • Regular users → XCTL to COMEN01C (Main Menu) [COSGN00C lines 235-238].

_ DEMO - CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

  • User ID and password are both mandatory; blank values produce inline error messages [COSGN00C lines 118-130].
  • User ID is forced to UPPER-CASE before lookup [COSGN00C line 132-136].
  • The system reads the USRSEC VSAM file by User ID key [COSGN00C lines 211-219].
  • Password is compared directly against the stored value ( SEC-USR-PWD ); mismatch returns "Wrong Password. Try again" [COSGN00C lines 223-245].
  • User type code ( SEC-USR-TYPE ) drives post-login routing:
    • Admin users → XCTL to COADM01C (Admin Menu) [COSGN00C lines 230-233].
    • Regular users → XCTL to COMEN01C (Main Menu) [COSGN00C lines 235-238].
  • If the user record is not found (RESP=13), "User not found" is displayed [COSGN00C line 247-250].
  • PF3 terminates with "Thank you" plain-text message and ends the CICS session [COSGN00C lines 891].

Domain 2 - Menu & Navigation

Screenshot of a terminal-like interface, possibly within a web browser, displaying bullet points that describe a user authentication and routing process, including references to COBOL code and CICS session management.

>_ DEMO CLAUDE CODE ON BEDROCK AGENTCORE

Seeing it run.

Domain 3 – Account Management

Programs: COACTVWC (View), COACTUPC (Update)

Transactions: CAVW, CAUP

Business Rules:

Account View (COACTVWC)
  • The user enters an 11-digit, non-zero numeric Account ID; any other format produces a validation error [COACTVWC lines 666-676].
  • The lookup chain is:
    1. Read CARDXREF (CXACAIX) by Account ID (alternate index) to get Card Number and Customer ID [COACTVWC lines 727-769].
    2. Read ACCTDAT by Account ID for balance and limit data [COACTVWC lines 776-820].
    3. Read CUSTDAT by Customer ID for personal/demographic data [COACTVWC lines 826-869].

Seeing it run.

Domain 4 - Credit Card Management

  • Programs: COCRDLIC (List), COCRDSLC (Detail), COCRDUPC (Update)
  • Transactions: CCLI, CCDL, CCUP
Business Rules:
Card List (COCRDLIC)
  • Paginates the CARDDAT VSAM file browsing forward and backward by Account ID alternate index (CARDAIX) [COCRDLIC program, identified via COACTVWC literals lines 151-157].
Card Detail (COCRDSLC)
  • Account ID must be numeric 11-digit; Card Number must be numeric 16-digit; both are validated with specific error messages [COCRDSLC lines 647-719].
  • If entering from COCRDLIC (card list), Account and Card fields are protected (read-only).

// SECTION FOUR

What worked.

What didn't.

What worked. What I'd do differently.

  • worked well
    • Well-commented source – dated business-rule history inline
    • Dependency graphs from schedule data
    • Standard business-purpose descriptions
    • Database structure from JCL DDNAMEs
    • grep / glob / read across source repos – unexpected efficiencies
    • Azure DevOps fallback when source missing
  • what I'd do differently
    • Front it with an AI gateway or proxy – the Claude Code SDK has no OTEL telemetry yet; gateways do
    • Cost attribution – Bedrock application inference profiles from day one
    • Auto-update on code change – wire doc-gen into the batch pipelines
    • Lean on static analysis – deterministic code-analysis tooling to ground the AI

>_ THE ACTUAL COST
What it actually cost.

MONTHCOST (USD)TOKENSCACHE HIT
Nov 2025$1,224.64780 M75.8%
Dec 2025$1,463.521.36 B96.2%
Jan 2026$91.3091 M95.7%
TOTAL$2,779.462.23 B89.1%
  • Nov – exploration + prompt iteration (low cache – still finding the shape)
  • Dec – parallel batch campaign (~3,000 jobs – cache hits soar)
  • Jan – fix pass + maintenance (near-zero new cost)

$ Claude Sonnet 4.5 - AWS Bedrock ap-southeast-2

SECTION FIVE

The bigger picture. What this actually unlocks.

A large, green outlined number "05" is displayed on the left side of the slide.

A CONTRARIAN TAKE

The vendor pitch: "AI converts your COBOL automatically."

The demos are impressive. They're also not realistic for 99% of organisations.

Full automated conversion of 5M lines assumes:

  • The output is correct – and you have a way to know
  • The business processes should be preserved as-is
  • The goal is like-for-like replacement

None of those assumptions hold.

THE REALISTIC PATH · STRANGLER FIG

Modernise the right things. In the right order. With confidence.

  • 5M lines of COBOL
  • [ AI extracts business logic, data contracts, rules ]
  • document the full estate // what we built
  • identify highest-pain modules
    • most failures
    • most maintenance
    • most blocking
  • AI-assisted conversion of those modules → Python / services
  • strangle the monolith incrementally
    • new system handles one module · old COBOL runs the rest
    • prove it works · repeat

You don't have to modernise everything.

A flow diagram illustrating a modernization process for a COBOL monolith, involving AI extraction of business logic, documentation, identifying high-pain modules, AI-assisted conversion to Python/services, and incremental strangling of the monolith.

>_ WHAT BATCH ARCHITECTURE COSTS THE USER

2 a.m. is also when they can't log in.

Service Hours

My ████████ is available during the following service hours (Eastern Time)

DayService Hours
Monday – Friday5:00 a.m. – 1:00 a.m.
Saturday5:00 a.m. – 11:00 p.m.
Sunday8:00 a.m. – 11:30 p.m.
Federal HolidaysSame hours as the day the holiday occurs

Close this window to return to the application.

  • 4h offline window Mon-Fri – nightly batch must finish before customers come back.
  • 6h offline Saturday – weekly reconciliation jobs.
  • 8.5h offline Sunday – the long batch. Month-end? Full reconciliation? You don't know unless you know the JCL.
  • Federal holidays match the day's schedule. The system isn't offline because users aren't there. It's offline because the scheduler says so.

→ When I said "highest-pain modules" – this is one. Every offline hour is a citizen who can't access their own data. That's the prize.

A screenshot of a "Service Hours" dialog box showing the times a system is available, alongside a list of reasons for system downtime due to batch processing.

WHAT TO TAKE TO YOUR TEAM ON MONDAY

Practical takeaways.

  1. Experiment iteratively, then automate with validation.

    Clone the repos locally for fast iterations. Learn what good looks like – then go headless, with a quality gate you trust.

  2. Find the person who knows where the bodies are buried.

    The richest context lives in people, not files. Track them down early.

  3. Keep the agent focused on one activity.

    One component. One job. LLMs are curious children – “hey, what’s that over there?”

  4. Documenting your estate is step 1.

    Modernising it is the end game.

AI E--

AI Engineer Melbourne

Technologies & Tools

  • .NET
  • Anthropic Claude
  • Application Inference Profile
  • Atlassian MCP
  • AWS Agent Core
  • AWS Bedrock
  • Azure DevOps
  • CA7
  • CICS Transaction Gateway
  • Claude Agent SDK
  • Claude Code
  • COBOL
  • Confluence
  • Copybook
  • Docling
  • JCL
  • Mermaid
  • MMDC
  • Python
  • SDSF
  • SOAP
  • z/OS

Concepts & Methods

  • AI Gateway
  • CLAUDE.md
  • Deterministic checks
  • Dynamic Workflows
  • Hallucinations
  • Strangler Fig pattern
  • Sub agents

Organisations & Products

  • BMC
  • Computer Associates
  • GitHub
  • Thoughtworks