Error messages / MT940 file validator
Fields are not in the order the MT940 format lists them
What the validator shows
This is the finding for the sample file mt940-error-field-order.sta:
- ErrorFields are not in the order the MT940 format lists themLine 3 ยท Field 20 (transaction reference)
- Found
- :20: after a field that belongs after it
:20:MUSTER-2026-190
Spaces are shown as dots so that they can be counted.
A message of the MT940 file validator, reported as an error. The fields of an MT940 message come in a fixed order: 20, 21, 25, 28C, 60a, then the entries, then 62a. How the validator finds a field out of place.
The order
The fields of an MT940 message stand in the order SWIFT's description lists them: the reference (:20:), an optional related reference (:21:), the account (:25:), the statement number (:28C:), the opening balance (:60F: or :60M:), then any number of entries (:61:, each optionally followed by an :86:), the closing balance (:62F: or :62M:), optionally the available balances (:64:, :65:) and a final :86:. The German banks' specification gives the same order.
What the finding shows
The validator names each field that stands after a field that belongs behind it. In the sample for this page the account and the reference have swapped places, so the reference is reported.
Why it happens
- A program writes fields in the order of its own database.
- Lines were sorted, moved or merged by hand, or two files were joined in the wrong place.
- A field belonging to the next message ended up in the previous one because the line with the hyphen between them is missing.
How to fix it
Download the statement again. If the bank's own file has the wrong order, tell the bank; software that reads MT940 line by line may still cope, but the file does not follow the format. This tool does not reorder fields.
Source: SWIFT, Category 9 Message Reference Guide (MT 940), and Die Deutsche Kreditwirtschaft, DFU Agreement Appendix 3 V3.8, chapter 8.
Check your own file
Drop your file into the MT940 file validator. It reports problems and does not change the file.
Other MT940 file messages
- This does not look like an MT940 file
- A mandatory field of the statement is missing or empty
- A field 86 does not follow a field 61
- A field tag is not one the MT940 format lists
- A character is used that the SWIFT character set does not include
- A reference starts or ends with a slash, or has two slashes in a row
- Field 28C is not a statement number of up to 5 digits, optionally followed by / and a sequence number
- A balance date is not a valid date (YYMMDD)
- An amount is not digits with a decimal comma
- The debit/credit mark of a statement line is not C, D, RC or RD
- The transaction type of a statement line is not S, N or F
- An opening balance differs from the closing balance of the previous message of the account
- In this file the opening balance plus the entries does not equal the closing balance