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.
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.
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.
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.
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.
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.
Copybooks aren't documented in isolation — every other program in your engagement that consumes the same copybook is listed. Change blast radius, instantly visible.
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.
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.
| Dir. | File | DD | Org. | Access | Status Var. |
|---|---|---|---|---|---|
| In | TRANSACT-FILE | TRANFILE | Seq. | Seq. | TRANFILE-STATUS L116 |
| In | XREF-FILE | CARDXREF | Idx. | Random | CARDXREF-STATUS L133 |
| In | TRANTYPE-FILE | TRANTYPE | Idx. | Random | TRANTYPE-STATUS L149 |
| In | TRANCATG-FILE | TRANCATG | Idx. | Random | TRANCATG-STATUS L167 |
| In | DATE-PARMS-FILE | DATEPARM | Seq. | Seq. | DATEPARM-STATUS L250 |
| Out | REPORT-FILE | TRANREPT | Seq. | Seq. | TRANREPT-STATUS L246 |
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)
| File | Status Variable | Failure Action |
|---|---|---|
| TRANSACT-FILE | TRANFILE-STATUS | DISPLAY → 9910 → 9999 |
| REPORT-FILE | TRANREPT-STATUS | DISPLAY → 9910 → 9999 |
| XREF-FILE | CARDXREF-STATUS | DISPLAY → 9910 → 9999 |
| TRANTYPE-FILE | TRANTYPE-STATUS | DISPLAY → 9910 → 9999 |
| TRANCATG-FILE | TRANCATG-STATUS | DISPLAY → 9910 → 9999 |
| DATE-PARMS-FILE | DATEPARM-STATUS | DISPLAY → 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[].
EXEC SQL)EXEC CICS)SORT / MERGE in COBOL (JCL handles sorting)CALLs (sole CALL → LE service CEE3ABD)LINKAGE SECTIONREWRITE or DELETESTRING / UNSTRING / INSPECTCOMPUTE (arithmetic via ADD/SUBTRACT)ACCEPT or STOP RUNGO TO statements| Copybook | Defines | Shared with (corpus-wide) |
|---|---|---|
| CVTRA05Y | TRAN-RECORD (350B) | 8 others — CBACT04C, CBTRN01C/02C, COBIL00C, CORPT00C, COTRN00C/01C/02C |
| CVACT03Y | CARD-XREF-RECORD (50B) | 11 others — CBACT03C/04C, CBSTM03A, CBTRN01C/02C, COACTUPC/VWC, COBIL00C, COPAUA0C/S0C, COTRN02C |
| CVTRA03Y | TRAN-TYPE-RECORD (60B) | Unique to CBTRN03C |
| CVTRA04Y | TRAN-CAT-RECORD (60B) | Unique to CBTRN03C |
| CVTRA07Y | Report layouts | Unique to CBTRN03C |
From cross_corpus.copybook_consumers[] — verified by source COPY resolution.
| # | Step | Program | Purpose |
|---|---|---|---|
| 1 | STEP05R.PRC001 | IDCAMS | Backup copy of the transaction KSDS to a sequential GDG (housekeeping) |
| 2 | STEP05R | SORT | Date-range filter + sort by TRAN-CARD-NUM at offset 263 |
| 3 | STEP10R | CBTRN03C | Produces the formatted report JCL L59 |
From jcl_facts.tier2_enhanced.step_sequence.
| DD | DSN | DISP |
|---|---|---|
| TRANFILE | AWS.M2.CARDDEMO.TRANSACT.DALY(+1) | SHR |
| CARDXREF | AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS | SHR |
| TRANREPT | AWS.M2.CARDDEMO.TRANREPT(+1) | (NEW,CATLG,DELETE) |
The same facts, rendered as a flow diagram. Auto-generated. Source-grounded.
Send me a work email and I'll send the complete CBTRN03C PLM as PDF — six more sections, full data dictionary, every line cited.