# Convert BAI2 bank balance files to Iceberg tables Snowflake can query

**BAI2 balance-reporting files from your banks become typed Iceberg
tables — account balances and transaction detail with typed amounts —
queryable from Snowflake without hand-written parsers.** Lakewright
identifies BAI2 by its record-code structure (01/02/03/16/49/98/99).

## What is BAI2?
The Bank Administration Institute format for prior-day/intra-day
balance reporting: comma-delimited records with positional meaning,
continuation records, and control totals — close enough to CSV to
fool tools, different enough to break them.

## How are records handled?
Account records (03) and transaction detail (16) become rows carrying
their file/group context; control totals (49/98/99) are available for
reconciliation. Amounts convert from implied-decimal.

## The steps
```bash
lakewright scan  sftp-drop/treasury/
lakewright approve plans/treasury_bai.plan.yaml
lakewright load  plans/treasury_bai.plan.yaml --rest $CATALOG
```

## FAQ
**Multiple banks, one drop?** Each bank's files cluster into feeds by
structure; sender identity rides in the file header record.
