EDIFACT Service Segments
General building blocks of EDIFACT messages
The EDIFACT file structure is specified using so called service segments with tag name starting with "UN". The segment pairs UNB-UNZ (interchange), UNG-UNE (functional group) and UNH-UNT (message) are used to tag the header and the trailer of each envelope.
UNA = Service String Advice
The conditional UNA segment provides the capability to specify the separator and other service characters used in the interchange in case they differ from the default values.
The default separators are:
(UNA1) Component data element separator | : | colon |
(UNA2) Data element separator | + | plus sign |
(UNA3) Decimal notation | . | full-stop |
(UNA4) Release character | ? | question mark |
(UNA5) Repetition character | empty (syntax 3) or asterisk (syntax 4) | |
(UNA6) Segment separator | ‘ | apostrophe |
UNB = Interchange Header
The compulsory UNB segment is used to start, identify and specify an interchange.
It identifies the sender and the receiver of the file, contains a time stamp, specifies the character set used in the file, and contains other general information about the interchange, such as acknowledgement requests. UNB does not include information about the contents of the document. The reference number stated in UNB segment shall be stated in Interchange Trailer (UNZ).
EDIFACT Character sets
There are several available character sets for EDIFACT syntax. The originals are UNOA and UNOB, of which UNOA is the most limited (A to Z, 0 to 9, segment separator characters and a few others). UNOB also contains characters from a-z. Newer and more comprehensive character sets are UNOC, UNOD, UNOE, UNOF, UNOG, UNOH, UNOI, UNOJ, UNOK, UNOX, and UNOY, KECA.
UNG = Functional Group Header
The optional UNG segment is used to head, identify and specify a functional group. Similar messages can be grouped within a header (UNG) and a trailer (UNE). There can be many functional groups in one interchange.
UNE = Functional Group Trailer
The UNE segment accompanies an optional UNG segment and is used to determine the end of the functional group.
UNH = Message Header
The compulsory UNH segment is used to head, identify and specify a message. The message segments shall be provided between UNH-UNT segments.
UNS = Section Control
The UNS segment can be used to separate header, detail, and summary sections of a message.
UNT = Message Trailer
The compulsory UNT segment is used to end a message that has been started with a UNH (Message Header).
UNT segment shall specify the number of message segments and repeat the message reference number stated in UNH segment.
UNZ = Interchange Trailer
The compulsory UNZ segment is used to end an interchange that has been started with a UNB (Interchange Header).
UNZ segment shall specify either the number of messages or, if used, of the number of functional groups in an interchange. It shall also repeat the interchange control reference stated in UNB segment.
Learn more about EDIFACT syntax.