How to understand an EDI file?
Asked Answered
A

6

37

I've seen XML before, but I've never seen anything like EDI.

How do I read this file and get the data that I need? I see things like ~, REF, N1, N2, N4 but have no idea what any of this stuff means.

I am looking for Examples and Documentations. Where can I find them?

Aslo EDI guide i found says that it is based on " ANSI ASC X12/ ver. 4010". Should I search form X12 ?

Kindly help.

Aerography answered 16/9, 2009 at 4:28 Comment(3)
hibcc.org/EBUS/editemplates.htm has a few healthcare-related EDI examples, which are still very common.Gargantuan
See my comments on #1551966Rubato
edi.stedi.com/inspectorMunn
F
32

Wow, flashbacks. It's been over sixteen years ...

In principle, each line is a "segment", and the identifiers are the beginning of the line is a segment identifier. Each segment contains "elements" which are essentially positional fields. They are delimited by "element delimiters".

Different segments mean different things, and can indicate looping constructs, repeats, etc.

You need to get a current version of the standard for the basic parsing, and then you need the data dictionary to describe the content of the document you are dealing with, and then you might need an industry profile, implementation guide, or similar to deal with the conventions for the particular document type in your environment.

Examples? Not current, but I'm sure you could find a whole bunch using your search engine of choice. Once you get the basic segment/element parsing done, you're dealing with your application level data, and I don't know how much a general example will help you there.

Fowler answered 16/9, 2009 at 5:3 Comment(2)
And people complain about XML.Contract
Is this an old process that these days we can process with CSV or XML over FTP? It sounds like inflated business waffle for standard the sender and receiver can agree on so on both sides get a computer readable file.Hainan
O
92

Several of these other answers are very good. I'll try to fill in some things they haven't mentioned.

EDI is a set of standards, the most common of which are:

  • ANSI X12 (popular in the states)
  • EDIFACT (popular in Europe)

Sounds like you're looking at X12 version 4010. That's the most widely used (in my experience, anyway) version. There are lots and lots of different versions.

The file, or properly "interchange," is made up of Segments and Elements (and sometimes subelements). Each segment begins with a two- or three-word identifier (ISA, GS, ST, N1, REF).

The structure for all documents begins and ends with an envelope. The envelope is usually made up of the ISA segment and the GS segments. There can be more than one GS segment per file, but there should only be one ISA segment per file (note the should, not everyone plays by the rules).

The ISA is a special segment. Whereas all the other segments are delimited, and therefore can be of varying lenghts, the ISA segment is of fixed width. This is because it tells you how to read the rest of the file.

Start with the last three characters of the ISA segment. Those will tell you the element delimiter, the sub-element delimiter, and the segment delimiter. Here's an example ISA line.

ISA:00: :00: :01:1515151515 :01:5151515151 :041201:1217:U:00403:000032123:0:P:*~

In this case, the ":" is the element delimiter, "*" is a subelement delimiter, and "~" the segment delimiter. It's much easier if you're just trying to look at a file to put linebreaks after each segment delimiter (~).

The ISA also tells you who the document is from and to, what the version is (00403, which is also known as 4030), and the interchange control number (0000321233). The other stuff is probably not important to you at this stage.

This document is from sender "01:1515151515" and to receiver "01:5151515151". So what's with the "01:"? Well, this introduces an important concept in EDI, the qualifier. Several elements have qualifiers, which tell you what type of data the next element is. In this case, the 01 is supposed to be a Dunn and Bradstreet number. Other qualifiers for the ISA05 and ISA07 elements are 12 for phone number, and ZZ for "user defined". You'll find the concept of qualifiers all over EDI segments. A decent rule of thumb is that if it's two characters, it's a qualifier. In order to know what all the qualifiers mean, you'll need a standards guide (either in hard copy from the EDI standards body, or in some software).

The next line is the GS. This is a functional group (a way to group like documents together within an interchange.) For instance, you can have several purchase orders, and several functional acknowledgements within an ISA. These should be placed in separate functional groups (GS segments). You can figure out what type of documents are in a GS segment by looking at the first GS01 element.

GS:PO:9988776655:1122334455:20041201:1217:128:X:004030

Besides the document type, you can see the from (9988776655) and to (1122334455) again. This time they're using different identifiers, which is legal, because you may be receiving an interchange on behalf of someone else (if you're an intermediary, for instance). You can also see the version number again, this time with the trailing "0" (0004030). Use significant digits logic to strip off the leading zeros. Why is there an extra zero here and not in the ISA? I don't know. Lastly this GS segment also has it's own identifier, 128.

That's it for the beginning of the envelope. After that there will be a loop of documents beginning with ST. In this case they'd all be POs, which have a code (850), so the line would start with ST:850:blablabla

The envelope stuff ends with a GE segment which references the GS identifier (128) so you know which segment is being closed. Then comes an IEA which similarly closes out the ISA.

GE:1:128~ IEA:1:000032123~

That's an overview of the structure and how to read it. To understand it you'll need a reference book or software so you understand the codes, lots and lots of time, and lots and lots of practice. Good luck, and post again if you have more specific questions.

Overbear answered 22/10, 2009 at 10:1 Comment(4)
I found your post very helpful. Here are some links that helped me get started with a custom EDI parser for an 810 (invoice) EDI document: webobjects.cdw.com/webobjects/media/pdf/e-procurement/downloads/… timrayburn.net/blog/parsing-an-x12-edi-by-handMarylandmarylee
Really helpful. After I read it, I began to understand what all these letters, asterisks and digits mean.Vickeyvicki
Greattttt artical Adam. I wish I could give it up 100 times. Thanks.Swollen
This is a great primer I wish I'd seen before my first foray into EDI. +1Yeung
F
32

Wow, flashbacks. It's been over sixteen years ...

In principle, each line is a "segment", and the identifiers are the beginning of the line is a segment identifier. Each segment contains "elements" which are essentially positional fields. They are delimited by "element delimiters".

Different segments mean different things, and can indicate looping constructs, repeats, etc.

You need to get a current version of the standard for the basic parsing, and then you need the data dictionary to describe the content of the document you are dealing with, and then you might need an industry profile, implementation guide, or similar to deal with the conventions for the particular document type in your environment.

Examples? Not current, but I'm sure you could find a whole bunch using your search engine of choice. Once you get the basic segment/element parsing done, you're dealing with your application level data, and I don't know how much a general example will help you there.

Fowler answered 16/9, 2009 at 5:3 Comment(2)
And people complain about XML.Contract
Is this an old process that these days we can process with CSV or XML over FTP? It sounds like inflated business waffle for standard the sender and receiver can agree on so on both sides get a computer readable file.Hainan
G
6

EDI is a file format for structured text files, used by lots of larger organisations and companies for standard database exchange. It tends to be much shorter than XML which used to be great when data packets had to be small. Many organisations still use it, since many mainframe systems use EDI instead of XML.

With EDI messages, you're dealing with text messages that match a specific format. This would be similar to an XML schema, but EDI doesn't really have a standardized schema language. EDI messages themselves aren't really human-readable while most specifications aren't really machine-readable. This is basically the advantage of XML, where both the XML and it's schema can be read by humans and machines.

Chances are that when you're doing electronic banking through some client-side software (not browser-based) then you might already have several EDI files on your system. Banks still prefer EDI over XML to send over transaction data, although many also use their own custom text-based formats.

To understand EDI, you'll have to understand the data first, plus the EDI standard that you want to follow.

Gargantuan answered 16/9, 2009 at 15:16 Comment(2)
+1. I'd call EDI a binary format rather than a text format, though - it all depends on what separators/terminators the partners choose. And it frequently has no line breaks.Rubato
There is a format and syntax to EDI and there are standards, most commonly I see ANSI X12, and generally if you implement your parser on the right standard, version, and revision, you can trade with anyone who use the same standard, version, revision as you do. Within industries there is generally at least 1 of these used prolifically throughout making EDI incredibly convenient, albeit a touch contrived.Yeung
S
1

Assuming the data stream starts with “ISA”, towards the beginning there should be a section “~ST*” followed by three numeric digits. If you can post these three digits, I can probably provide you with more information. Also, knowing the industry would be helpful. For example, healthcare uses 270, 271, 276, 277 and a few others.

Samira answered 16/9, 2009 at 7:33 Comment(0)
B
0

An EDI file is a data file structured using one of the several EDI standards. EDI standards are specific guidelines that govern the content and format of EDI files. EDI file contains structured data stored in a plain text format and is used for transferring business data between multiple organizations.

The primary reason for having these EDI standards is to ensure that businesses can communicate in a” universal language”.

EDI files can be saved by various standards. Here are the common EDI file formats,

cXML xCBL ebXML CSV ANSI X12 EDIFACT EDIFICE (Information Technology) EDITRANS (Transportation) ETIS (Telecommunications)

Different types of EDI File formats Flat file Variable file Fixed flat file

Here is a indepth blog about EDI file and its structure with relevant examples - https://www.commport.com/2022/07/12/edi-file/

Biller answered 6/9, 2023 at 19:45 Comment(0)
N
0

EDI has so many sets and versions. The best resource i have found to answer all my questions has been at this site below.

https://www.stedi.com/edi

You can search by set/version anything really. It also has an EDI inspector that will show you what is wrong with your EDI if you are creating it.Best of Luck !

Neoplasticism answered 20/12, 2023 at 22:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.