Parse the optional funds code in MT940 :61:
An optional letter between the debit or credit mark and the amount can report the third character of the funds currency code. The letter alone cannot identify a currency or establish an exchange rate.
Open this sample in Air-Gapped ConverterWorked bank sample
Synthetic bank data for local reconciliation.
:20:REPORT-1
:25:EUR-OPERATING
:28C:007/1
:60F:C261130EUR100,00
:61:2611301130CR25,00NTRFFUNDS-01//REF-09
:86:Funds code R in a EUR statement
:62F:C261130EUR125,00Field anatomy
| Field or path | Meaning in this file | Type or format | ERP or Excel import risk |
|---|---|---|---|
| After C in CR25,00 | Optional funds code R | One uppercase letter | Treating CR as a reversal loses the credit. |
| :60F: currency | Statement currency | Three letters | Deriving a full currency from R is ambiguous. |
Root cause and ERP fix
- A fixed offset consumes the first amount digit when the letter is absent. Parse the optional token.
- A parser treats CR as RC. Inspect the mark and the following funds letter in order.
- Treasury used the letter for FX conversion. Obtain the full currency and exchange rate from the advice.
Inspect with the MIT parser
Save the sample as mt940-optional-funds-code.sta and the script as inspect.mjs. With @stmtrecon/parser installed, run node inspect.mjs mt940-optional-funds-code.sta.
import { readFile } from 'node:fs/promises';
import { inspect } from '@stmtrecon/parser';
const text = await readFile(process.argv[2], 'utf8');
const report = inspect(text, { transactions: true });
const lines = text.split(/\r?\n/).filter(line => line.startsWith(':61:'));
const parts = lines[0].match(/^:61:\d{6}(?:\d{4})?(RC|RD|C|D)([A-Z])?(?=\d)/);
console.log(parts[1], parts[2], report.currency);Open this sample in Air-Gapped ConverterExport 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