Segments

A segment is a set of two or more related data elements. The segment describes the data in the data element. For example, individually, the data elements FNAME and LNAME have little meaning. However, when combined, they form the CUSTOMER NAME data segment.

An EDI standard provides a wide range of segment types to support a variety of business needs. Each segment contains data elements that define the purpose of the segment. Most segments are variable-length because the associated data elements are variable-length.

A segment terminator is a special character that marks the end of a segment.

The segment terminator must be defined in the EDI data format. Select a character that is not likely to be used in any content information. This will help prevent translation errors during processing. The tilde (~) and new line (N/L) characters are common segment terminators for the ANSI X12 standard. The single quote (') is a common segment terminator in the UN/EDIFACT and TRADACOMS standards.

The following figure shows a segment structure:

Information about this image can be found in the surrounding text.