Brevidy
A guided tour · 4-minute scroll

How Brevidy reads a COBOL program.

Watch a 782-line batch report — CardDemo's CBTRN03C — become a financial-grade Program Logic Manual. Scroll on the right to advance; the narrative on the left will follow.

Step 1 of 7

It starts with one program.

CBTRN03C is a daily transaction report — a batch COBOL deck that reads transactions, enriches them from three lookup files, and produces a formatted print file. Brevidy ingests the source and writes a grounded narrative — no invention, every fact line-cited.

Step 2 of 7

Every file gets a row.

The PLM's I/O Summary lists every file the program touches — direction, organization, access mode, record key, and the file-status variable used to check for errors. Six files, six rows, no fabricated columns.

Step 3 of 7

Every PERFORM gets a line.

An auto-generated structure chart shows the full call hierarchy — even the COBOL idioms most parsers miss, like NEXT SENTENCE exiting a loop, or implicit error-handler chains.

Step 4 of 7

Failure paths are first-class.

For each I/O operation, the PLM names the status variable, the success and failure branches, and the abend code raised on error. Compliance reviewers don't need to grep — they need to read.

Step 5 of 7

We say what isn't there.

Most AI-generated docs simply omit what they didn't find. Brevidy reports negative assertions explicitly — so a reader can be confident "no embedded SQL" is a verified result, not an oversight.

Step 6 of 7

And we map the whole corpus.

Copybooks aren't documented in isolation — every other program in your engagement that consumes the same copybook is listed. Change blast radius, instantly visible.

Step 7 of 7

Down to the JCL deck.

The PLM doesn't stop at the program boundary. It traces the JCL — job-step sequence, DD statements, GDG generations, PROC expansions — so the documentation matches what operations actually runs.

s01 · Program Narrative

Daily Transaction Report

CBTRN03C is a batch COBOL report program in the CardDemo application that produces a Daily Transaction Report L5, L179. It reads a sequential transaction file pre-sorted and pre-filtered by a JCL SORT step, enriches each transaction with card-to-account cross-reference data, transaction type descriptions, and transaction category descriptions via three indexed lookup files, then writes a formatted report.

The program's function is stated in its header comment as "Print the transaction detail report" L5. PROGRAM-ID is CBTRN03C L23; AUTHOR is AWS L24.

Excerpt from §s01 — Program Narrative.

s01 · I/O Summary

Every file the program touches

Dir.FileDDOrg.AccessStatus Var.
InTRANSACT-FILETRANFILESeq.Seq.TRANFILE-STATUS L116
InXREF-FILECARDXREFIdx.RandomCARDXREF-STATUS L133
InTRANTYPE-FILETRANTYPEIdx.RandomTRANTYPE-STATUS L149
InTRANCATG-FILETRANCATGIdx.RandomTRANCATG-STATUS L167
InDATE-PARMS-FILEDATEPARMSeq.Seq.DATEPARM-STATUS L250
OutREPORT-FILETRANREPTSeq.Seq.TRANREPT-STATUS L246
s04 · Hierarchical Structure Map

The full PERFORM tree

PROCEDURE DIVISION (L291–L349)
├── PERFORM 0000-TRANFILE-OPEN  (L293)
├── PERFORM 0100-REPTFILE-OPEN  (L294)
├── PERFORM 0200-CARDXREF-OPEN  (L295)
├── PERFORM 0300-TRANTYPE-OPEN  (L296)
├── PERFORM 0400-TRANCATG-OPEN  (L297)
├── PERFORM 0500-DATEPARM-OPEN  (L298)
├── PERFORM 0550-DATEPARM-READ  (L300)
├── PERFORM UNTIL END-OF-FILE = 'Y'  (L302–L338)
│   ├── PERFORM 1000-TRANFILE-GET-NEXT  (L304)
│   ├── [date range filter — NEXT SENTENCE exits loop]
│   ├── [card-number control break]
│   │     ├── PERFORM 1120-WRITE-ACCOUNT-TOTALS  (L315)
│   │     └── PERFORM 1500-A-LOOKUP-XREF         (L319)
│   ├── PERFORM 1500-B-LOOKUP-TRANTYPE           (L322)
│   ├── PERFORM 1500-C-LOOKUP-TRANCATG           (L327)
│   └── PERFORM 1100-WRITE-TRANSACTION-REPORT    (L328)
├── PERFORM 9000-TRANFILE-CLOSE  …  9500-DATEPARM-CLOSE  (L340–L345)
└── GOBACK (L349)
s08 · Error and Exception Handling

Status checks for every I/O

FileStatus VariableFailure Action
TRANSACT-FILETRANFILE-STATUSDISPLAY → 9910 → 9999
REPORT-FILETRANREPT-STATUSDISPLAY → 9910 → 9999
XREF-FILECARDXREF-STATUSDISPLAY → 9910 → 9999
TRANTYPE-FILETRANTYPE-STATUSDISPLAY → 9910 → 9999
TRANCATG-FILETRANCATG-STATUSDISPLAY → 9910 → 9999
DATE-PARMS-FILEDATEPARM-STATUSDISPLAY → 9910 → 9999

A single user-abend code — 999 — is raised for all I/O failures via CALL 'CEE3ABD' from 9999-ABEND-PROGRAM L758.

The full PLM also includes a 19-row table of every literal error message the program emits, by paragraph and line — sourced from notable_constructs.display_statements[].

s01 · Negative Assertions

What this program does not do

  • absent No embedded SQL (EXEC SQL)
  • absent No CICS commands (EXEC CICS)
  • absent No IMS DL/I calls
  • absent No SORT / MERGE in COBOL (JCL handles sorting)
  • absent No application CALLs (sole CALL → LE service CEE3ABD)
  • absent No LINKAGE SECTION
  • absent No REWRITE or DELETE
  • absent No STRING / UNSTRING / INSPECT
  • absent No COMPUTE (arithmetic via ADD/SUBTRACT)
  • absent No ACCEPT or STOP RUN
  • absent No GO TO statements
s18 · Copybook Inventory

Copybooks, and who else uses them

CopybookDefinesShared with (corpus-wide)
CVTRA05YTRAN-RECORD (350B)8 others — CBACT04C, CBTRN01C/02C, COBIL00C, CORPT00C, COTRN00C/01C/02C
CVACT03YCARD-XREF-RECORD (50B)11 others — CBACT03C/04C, CBSTM03A, CBTRN01C/02C, COACTUPC/VWC, COBIL00C, COPAUA0C/S0C, COTRN02C
CVTRA03YTRAN-TYPE-RECORD (60B)Unique to CBTRN03C
CVTRA04YTRAN-CAT-RECORD (60B)Unique to CBTRN03C
CVTRA07YReport layoutsUnique to CBTRN03C

From cross_corpus.copybook_consumers[] — verified by source COPY resolution.

s02 · System-Level Context

How CBTRN03C runs in production

Pipeline step sequence — job TRANREPT

#StepProgramPurpose
1STEP05R.PRC001IDCAMSBackup copy of the transaction KSDS to a sequential GDG (housekeeping)
2STEP05RSORTDate-range filter + sort by TRAN-CARD-NUM at offset 263
3STEP10RCBTRN03CProduces the formatted report JCL L59

From jcl_facts.tier2_enhanced.step_sequence.

DD statements (selected)

DDDSNDISP
TRANFILEAWS.M2.CARDDEMO.TRANSACT.DALY(+1)SHR
CARDXREFAWS.M2.CARDDEMO.CARDXREF.VSAM.KSDSSHR
TRANREPTAWS.M2.CARDDEMO.TRANREPT(+1)(NEW,CATLG,DELETE)

And we draw the whole thing.

The same facts, rendered as a flow diagram. Auto-generated. Source-grounded.

CBTRN03C structure diagram — auto-generated flowchart of the program control flow.
Generated from the structured baseline · same input → same diagram, every run · scroll horizontally to see full graph

This was the tour. The PLM is 30 pages.

Send me a work email and I'll send the complete CBTRN03C PLM as PDF — six more sections, full data dictionary, every line cited.

We'll only use your details to send the PDF and (occasionally) follow up.