What are Delimiters
In short, delimiters are characters that separate the elements of data so that one piece of data can be distinguished from another. EDI files don’t have externally set delimiters. This means in a pure sense, that an EDI parser may not know what the delimiters will be until it has begun to parse the file. This may sound chaotic for someone familiar with strict delimited files. But we need to remember that in and EDI file, the first segment is fixed position. This is how EDI addresses the problem.
In EDI there are three delimiters, each with a separate purpose and usage. First, there is a segment delimiter. This is the last character of every segment. It is sometimes referred to as the segment terminator. Next, there is the Element delimiter. This character separates each data element from the neighbouring data elements. This character will most likely be the most common character in any given EDI file. The least commonly used character is the sub-element delimiter. Some elements have sub elements defined within them. In my experience these location asre used rarely. You will probably find that this character only appears once in most of your EDI files, and that is in the ISA segment where it is defined.
Where do you find the delimiters in the EDI file?
Delimiters are essential in deciphering the contents of an EDI file and getting data out of it. Because the parser needs to know the identity of these character before it can do meaningful parsing. It must know where to find them. In every EDI file the first segment is the ISA segment. This segment is always 106 characters long, counting the first character “I” as 1. This means that if our parser grabs the 106th character it shows the segment delimiter. And the two characters that preceded it are the element and sub-element.
Element Delimiter = Character 104
Sub-Element Delimiter = Character 105
Segment Delimiter = Character 106
What good are delimiters?
First lets say that this list of criteria will be incomplete as it is mostly based on my experiences. Second, though I am gifted I doubt that I can imagine every possible way to create confusion. Now here are the rules:
1. Delimiters must be unique. Even if you don’t use the sub-element, you still have to use a different character than used in the other delimiters.
2. Delimiters must be single characters. (we will talk about the exception on the Good Form section)
3. Delimiters must be printable ASCII characters, excluding the alpha and numbered characters. Also excluding the common punctuation. (having the letter “B” as a delimiter would make a file unreadable.
4. There are characters that are forbidden like the back tick.
5. There are characters that are allowed like “*” but that are appear commonly in text fields and descriptions, so they should be avoided.
Included with my EDI Usage Specification are a set of recommended delimiters. I set my transformer to use them as default, and encourage my trading partners to do the same.
What’s the big deal?
Delimiters are critical to having your integration function smoothly. Selecting good delimiters and following good practices for using them help keep things from facing constant revision. Being consistent helps your trading partners.
Looking for something else relating to EDI? Check out the EDI Primer post