StmtRecon
MT940 fields and statement controls

Merge MT940 pages using :28C: statement and sequence numbers

The components of :28C: identify the statement number and optional page sequence. Key the merge by account, reporting cycle and sequence before testing the intermediate balance.

Open this sample in Air-Gapped Converter

Worked bank sample

Synthetic bank data for local reconciliation.

:20:REPORT-1
:25:EUR-OPERATING
:28C:00042/1
:60F:C261130EUR100,00
:61:2611301130C25,00NTRFINV-0042//BANK-841
:86:First page receipt
:62M:C261130EUR125,00
:20:REPORT-2
:25:EUR-OPERATING
:28C:00042/2
:60M:C261130EUR125,00
:61:2611301130C25,00NTRFINV-0042//BANK-841
:86:Second page receipt
:62F:C261130EUR150,00

Field anatomy

Field or pathMeaning in this fileType or formatERP or Excel import risk
:28C: before /Statement numberUp to five digitsStripping zeros breaks external file keys.
:28C: after /Sequence within statementUp to five digitsLexical sorting puts page 10 before page 2.

Root cause and ERP fix

  1. A delivery repeats page one. Compare account, statement, sequence and content before suppressing it.
  2. Pages arrived out of order. Sort numerically on the sequence and test the carry.
  3. Numbering restarted in a new cycle. Add reporting period and account to the merge key.

Inspect with the MIT parser

Save the sample as mt940-statement-sequence-merging.sta and the script as inspect.mjs. With @stmtrecon/parser installed, run node inspect.mjs mt940-statement-sequence-merging.sta.

import { readFile } from 'node:fs/promises';
import { inspect } from '@stmtrecon/parser';
const text = await readFile(process.argv[2], 'utf8');
const blocks = text.replace(/\r/g, '').replace(/^-[ \t]*$/gm, '').trim().split(/(?=^:20:)/m);
const reports = blocks.map(block => inspect(block.trim(), { transactions: true }));
const parts = reports.map(r => r.header.statementNumber.split('/'));
console.table(parts.sort((a, b) => Number(a[1]) - Number(b[1])));
Open this sample in Air-Gapped Converter

Export a multi-sheet Excel workbook with balance checks and batch reconciliation on your device. No Node installation or cloud upload is required.

npm package · SDK source · Format reference

Related MT940 fields and statement controls

Export your full workbook

Purchases are currently unavailable. Existing licenses can be activated offline.