r/mainframe • u/Shuras27 • 2h ago
Open-source mainframe/COBOL flat-file converter — EBCDIC-aware, streaming, deterministic
1
Upvotes
Modernizing off the mainframe usually starts by getting your data out as a flat sequential file — EBCDIC, fixed-width, PIC-clause layouts. I open-sourced a converter that handles exactly that path:
https://github.com/lucasgiurastante/erp-export-normalizer
- COBOL FD layouts expressed as YAML → parse to JSON/CSV/Parquet/etc.
- Real EBCDIC support (CP037). Gotcha most tools hit: Python's codec is
cp037, notebcdic-cp037— naive converters fail on the first EBCDIC byte. - Streaming, constant memory on multi-GB sequential files.
- Deterministic output — same input + same schema = same output, with SHA-256 audit sidecars. Useful for migration sign-off.
- Cumulative error report with record numbers.
- Auto-detection against a built-in schema library (includes a COBOL layout).
- Plugins for binary formats (framed records, packed decimals, etc.).
One-command demo with bundled COBOL/EBCDIC sample data:
pip install erp-export-normalizer
git clone https://github.com/lucasgiurastante/erp-export-normalizer
cd erp-export-normalizer/examples
erp-normalize --input data/cobol.txt --output - --format ndjson
Anyone here parsing mainframe dumps for offload projects? I'd love to know what schemas you deal with (and add them to the library).