EDIFACT CONTRL message: example and error codes
A CONTRL is the syntax answer to an interchange: received and readable, or rejected with the exact segment and data element. Here is a positive and a negative CONTRL from the German energy market, and how to read them.
Positive or negative
CONTRL (UN version D:3) is the syntax and service report of EDIFACT. In the German energy market (MaKo) the version in force is CONTRL 2.0b (BDEW MIG). A positive CONTRL acknowledges an interchange: action code 7 in UCI, no error. Here is one from our test files (fictitious data):
UNB+UNOC:3+9900000000028:500+9900000000011:500+261105:0935+REF-CTRL-1' UNH+CTR-1+CONTRL:D:3:UN:2.0b' UCI+REF-UTIL-1+9900000000011:500+9900000000028:500+7' UCM+MSG-1+UTILMD:D:11A:UN:S2.1+7' UNT+4+CTR-1' UNZ+1+REF-CTRL-1'
A negative CONTRL has action code 4 (rejected) and says where the problem is, down to the data element. EDI Reader Energie shows “CONTRL: no error” in the status bar for the first and the error count for the second.
A negative CONTRL, line by line
UNB+UNOC:3+9900000000028:500+9900000000011:500+261105:0935+REF-CTRL-1' UNH+CTR-1+CONTRL:D:3:UN:2.0b' UCI+REF-UTIL-1+9900000000011:500+9900000000028:500+4' UCM+MSG-1+UTILMD:D:11A:UN:S2.1+4' UCS+14+13' UCS+21' UCD+12+4:2' UNT+7+CTR-1' UNZ+1+REF-CTRL-1'
- UCI+REF-UTIL-1+…+4: the interchange answered (the reference from its UNB), sender, recipient and action code 4, rejected.
- UCM+MSG-1+UTILMD:D:11A:UN:S2.1+4: the message answered (the reference from its UNH), its type and version, rejected.
- UCS+14+13: segment 14 of that message, syntax error 13. Segments are counted from UNH, which is segment 1.
- UCS+21: segment 21, without its own error code: the UCD lines after it say what is wrong inside.
- UCD+12+4:2: syntax error 12 in data element 4, component 2, of segment 21.
With Pro, EDI Reader Energie opens the original UTILMD and puts these two errors at their place, also in the Problems view: “CONTRL 13: Missing (Segment 14)” and “CONTRL 12: Invalid value (Segment 21, Element 4.2)”. Free, you see the error count and whether the original interchange is in the folder.
Syntax error codes
The codes come from data element 0085 of ISO 9735 (UN/CEFACT service code list). These are the ones you meet most, with the labels EDI Reader Energie shows on hover:
- 12: Invalid value
- 13: Missing
- 14: Value not supported in this position
- 15: Not supported in this position
- 16: Too many constituents
- 21: Invalid character(s)
- 23: Unknown interchange sender
- 26: Duplicate detected
- 29: Control count does not match the number of instances received
- 35: Too many repetitions
- 37: Invalid type of characters
- 39: Data element too long
What usually causes them
- 29, count does not match: the segment count in UNT, or the message count in UNZ, was not updated after a file was edited by hand, merged or cut.
- 13, missing: a mandatory segment or data element is absent at that position, often after a mapping change.
- 12, invalid value: a value is not allowed in that element, for example a code that is not in its code list.
- 21, invalid characters: a character outside the character set declared in UNB (UNOC here), or a separator that was not escaped with ?.
- 23, unknown sender, and 26, duplicate: the interchange came from an MP-ID the partner does not know, or its reference was already received.
A file that ends without UNT or UNZ is usually a transfer that was cut. EDI Reader Energie says so on opening: “File ends without UNT/UNZ: read up to segment 22.” in our test.
Frequently asked questions
What is a CONTRL message in EDIFACT?
The syntax and service report message: the receiver says whether an interchange was received and could be read, and if not, which interchange, message, segment and data element failed and why, with an ISO 9735 code.
What does a negative CONTRL mean?
The interchange or a message in it was rejected for syntax reasons (action code 4) and was not processed. Fix the error at the segment it names and send the message again.
How are segments counted in a CONTRL?
From the UNH of the message, which is segment 1. UNA and UNB are not counted. Data elements are counted from the first one after the segment tag; 4:2 means the fourth data element, second component.
See your own APERAK and CONTRL the same way
EDI Reader Energie for VS Code names every segment of your UTILMD, MSCONS, APERAK and CONTRL, shows the format version and Prüfidentifikator of each transaction, counts the errors of a rejection and says whether the original message is in the folder, on your machine. Free, no account; Pro opens the original and marks each error at its transaction, segment and data element.