Reading a balance reporting file line by line: records, control totals and type codes
A balance reporting file looks like noise until you know the line types. Learn how the boxes open and close, how control totals catch a damaged file, and what the type codes mean.
L1–L4 are part of the Pro pass
L0 Explain simply
Every morning Bank Alfa sends Asha Traders a plain text file. Everything in this story is SYNTHETIC / TRAINING ONLY. Maya Chen opens it and sees lines that start with numbers such as 01, 02, 03, 16, 49, 98 and 99. It looks like noise, but it is carefully ordered.
The file is a bank statement written for a computer. Its format is called , a layout first published by the Bank Administration Institute and still sent by many banks. The first number on each line says what kind of line it is.
The lines open things and then close them, like a set of boxes. A file holds groups, a group holds accounts, and an account holds the transaction lines. Each box has a closing line that carries totals.
Those totals are the clever part. They let the receiver check that no line was lost on the way. A file whose counts do not match is a damaged file, and a damaged file is a reason to stop and ask, not to post.
Once you know the line types, a BAI2 file reads like a tidy parcel, not like noise.
PICTURE IT
Nested boxes with a packing slip on each lid
A courier delivers a large box. Inside are smaller boxes, and inside each of those are envelopes. Every box and envelope has a lid with a packing slip that says how many items are inside and what they add up to. The receiver opens the boxes from the outside in and checks each slip against what is there.
THE REAL JOB A BAI2 file nests file, group and account, and each closing line carries a total and a count.
- The file opens
- A group opens
- An account opens with its balances
- Transactions follow
- Each closing line carries a total
HOW THE PICTURE MAPS
| In the picture | In the payment |
|---|---|
| The large outer box | The file, opened by 01 and closed by 99 |
| A smaller box inside it | A group, opened by 02 and closed by 98 |
| An envelope inside that | An account, opened by 03 and closed by 49 |
| Each item in the envelope | A transaction on a 16 line |
| The packing slip on each lid | The control total and record count |
WHERE THIS PICTURE STOPS
- A packing slip is written by a person. A control total is worked out by software and checked by software.
- The picture has one kind of box at each level. Guides disagree on whether a file holds one group or several.
- Matching counts and totals cannot prove file identity or authenticity: equal offsetting substitutions can preserve both. Currency/profile, not an absent point, determines implied decimals.
HOOK
Check the slip before you open the next box.
TELL A FRIEND
A BAI2 file nests file, group and account, and each closing line carries a total and a count. A difference means the file may be damaged, so hold it.
OFTEN MIXED UP WITH The format your bank reports back in (BAI2, MT940, camt.053). That lesson compares three statement formats and what each is for. This one reads one of them, BAI2, line by line and shows how it checks itself.
PRACTISE AND KEEP
Sources for this topic — 11 sources
- Market practice
Bank Administration Institute format 2 (BAI2) statement format (Westpac BankRec documentation) ↗ — Westpac · Record sequence and a single group per file search excerpt, page not opened
Verified from web-search excerpts on the access date; the page was not opened. Another bank's guide in the same results said a file can hold several groups. Use only the label market-practice from an excerpt-only source.
- Market practice
Bank Administration Institute format 2 (BAI2) reporting reference guide (East West Bank) ↗ — East West Bank · Structure, control totals and implied decimal places search excerpt, page not opened
Verified from web-search excerpts on the access date; the file was not opened. A second East West Bank file in the same results agreed. Use only the label market-practice from an excerpt-only source.
- Market practice
Account information file in the Bank Administration Institute format 2 (BAI2) (National Australia Bank guide) ↗ — National Australia Bank · Amount format search excerpt, page not opened
Verified from web-search excerpts on the access date; the file was not opened. Use only the label market-practice from an excerpt-only source.
- Market practice
Checks made by a Bank Administration Institute format 2 (BAI2) file reader (NetSuite help) ↗ — Oracle NetSuite · Reader program checks of totals and counts search excerpt, page not opened
Verified from web-search excerpts on the access date; the page was not opened. Use only the label market-practice from an excerpt-only source.
- Market practice
Bank Administration Institute format 2 (BAI2) transaction detail type codes (International Business Machines documentation) ↗ — IBM · Type code ranges search excerpt, page not opened
Verified from web-search excerpts on the access date; the page was not opened. A bank's code sheet in the same results agreed on the ranges. Use only the label market-practice from an excerpt-only source.
- Market practice
ANSI X9.121 — Balance and Transaction Reporting Standard (BTRS) ↗ — Accredited Standards Committee X9, Inc. (ASC X9), published through ANSI · Ownership and the successor standard search excerpt, page not opened
x9.org could not be fetched, confirmed by direct probe on the access date, as did the copies of the standard and its format guide hosted at x9.org and at minneapolisfed.org. The document was NOT opened. Every claim this entry supports was corroborated across two independent web searches whose result content named the designation, the committee and the backwards-compatibility intent. No clause, field or code value is quoted from it, and no version number is asserted here. The version in force is carried as a dated fact in content/standards/current-facts.json, so it can be rechecked.
- Market practice
moov-io/bai2 — a reader, writer and validator for the BAI2 format ↗ — The Moov Authors (open source, Apache 2.0) · Specification named by an open implementation search excerpt, page not opened
Only README.md was read, at raw.githubusercontent.com on the access date at the master branch. Its Go source was not: this session could not enumerate the repository tree (the GitHub API and codeload both refused, and probed raw paths returned 404). So nothing about the field layout is taken from it and it backs up no position. Listed rather than omitted because the identity claim it supports is the one claim on this page that a blocked publisher would otherwise leave resting on search excerpts alone.
- Market practice
X9 edition of the Bank Administration Institute version 2 manual (2009), preview pages on the American National Standards Institute web store ↗ — Accredited Standards Committee X9, Inc., via the American National Standards Institute web store · Who owns the version 2 manual now; search excerpt, page not opened
Known from web-search excerpts on the access date, page not opened. The publisher's own domain cannot be fetched from the authoring environment, so nothing is quoted from the page itself. One other summary dated the copyright transfer to 2008, so the year is stated as this preview gives it.
- Market practice
New Transaction Codes and Format to Support The Clearing House Real-Time Payments ↗ — Accredited Standards Committee X9, Inc. · Codes added for real-time payments; search excerpt, page not opened
Known from web-search excerpts on the access date, page not opened. The publisher's own domain cannot be fetched from the authoring environment, so nothing is quoted from the page itself.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal · Asha Traders, Bank Alfa and Maya Chen are invented; the boxes picture and Maya's step order are this site's frame.
What this simplifies: The original specification was not reached; guides disagree on groups per file, sign placement and release date.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
- Implementation-specific0.5alpha; copyright 2003
ScotiaConnect BAI2 Export File Specification ↗ — Scotiabank · Historical ScotiaConnect version 0.5alpha pp.10–13: currency determines implied decimals; opened bank guide
Opened primary PDF after normal web search. Its profile defaults and supported funds types are not generalised to other banks.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.