BankLang

Migration analysis

Reading COBOL that already exists, and saying what is in it.

pnpm bankc analyse path/to/programs
pnpm bankc analyse path/to/programs --out dist/analysis

This is the one part of the toolchain that generates nothing. Before a bank asks whether a compiler produces COBOL it likes, it asks what would happen to the two thousand programs it already has — and the honest first answer is a count.


What it reads

Reference-format text. It parses nothing semantically and compiles nothing, which is what lets it work on a member that will not compile without copybooks the tool does not have — and on an estate, that is most of them.

Found How
Program name PROGRAM-ID
Paragraphs and sections A name and a period in Area A
PERFORM and GO TO The statement, with the far end of a THRU
Files SELECT, ASSIGN TO, ORGANIZATION, FILE STATUS
File operations OPEN/CLOSE/READ/WRITE/REWRITE/DELETE/START
SQL Each EXEC SQL block, its verb, and the names in it
CICS Each EXEC CICS command, its resource, and whether it captures RESP
Calls CALL "X" and CALL 'X', and a count of dynamic ones
Copybooks COPY
ALTER Counted, because of what it costs

What it says to look at

Deliberately not a score, because a single number is what lets a conversation skip the properties, and the properties are the whole point. Each flag is a specific thing with a specific consequence:

The paragraph graph

--out writes one Mermaid graph per program, which renders wherever the reader already is — a Markdown file, a pull request — rather than needing a tool installed.

A PERFORM is a solid arrow, the far end of a THRU a dotted one, and a GO TO a thick one. The difference between the three is the question a reader is actually asking.

What it does not know

Printed on every report, because a count that is read as an estimate is worse than no count:

Reading it on this repository

The conversions directory holds both an original and what the compiler produced from its BankTS, so pointing the tool at it prints the argument as a table:

pnpm bankc analyse conversions/01-sequential-update
| Program    | Member                    | Lines | Paragraphs | Jumps | Files |
| ---------- | ------------------------- | ----- | ---------- | ----- | ----- |
| `ACCTUPDT` | .../generated/...         |   451 |         16 |     0 |     4 |
| `ACCTUPDT` | .../original/ACCTUPDT.cbl |    92 |          5 |     3 |     4 |

and the only thing under "what to look at first" is the original's four files with no FILE STATUS between them.

What somebody else's COBOL found

Everything above was written against conversions/, and every original in conversions/ was written by the author of this reader. On 2026-08-07 it was pointed at AWS CardDemo — thirty-one CICS and batch programs, Apache-2.0 — and got two things wrong that no test here could have caught, because neither shape occurs in code this project wrote:

Both are fixed and both shapes are regression tests. The second is the worse one: a finding invented out of a message is the kind a reader checks, does not find, and stops trusting the rest of the report over.

The reader is still what this page says it is — reference-format text, nothing compiled — so the honest expectation for a first run against an unfamiliar estate is that something else is wrong in the same way, and that the report saying what it does not know is the part that matters most.


Read this page as Markdown on GitHub →