in reply to 850 EDI Help

Perhaps the filenames of the incoming data are not named properly because there is no fixed header or footers. The file is ASCII text, but it seems to to be delimited by *. I am weary of giving examples because it is real data that should not be shared, and I am one of the last people that can authorize its release.

However, I can say that there are tags that start the lines and determine the data that will follow. Some examples of tags are 'BEG', 'N1', 'N3', 'N4', 'PO1', 'PID'. All I can gather thus far is that the BEG always starts the file and the N_ tags describe where products will be shipped to, billed to, etc..

My problem is that a common distributor has various clients (some of which are large, i.e national). My company accepts files that detail the orders because we are in charge of shipping. I was wondering if there were absolutes regarding where information is stored within these 850 files.

As a result of reading, it appears that the 850 guys only created a set of tags and formats to be used, not how to use them. It also appears as if each client has their own way... so it seems up to me to make some calls and determine if a set of characteristics and/or formats can be developed to make my job of determing who to ship stuff to easier.

Thanks to all who have offered their opinions.

the_Don
...making offers others can't rufuse.

Replies are listed 'Best First'.
Re: Re: 850 EDI Help
by jordanh (Chaplain) on Oct 02, 2002 at 16:50 UTC
    Can't be sure, but it sounds like what you are looking at are files using \n as the segment terminator and '*' as the element separator. With \n as the segment terminator, it's natural to just read the segments as separate lines.

    These are good choices for the terminator, even recommended by the standards, IIRC. You're in luck in that your partners haven't used non-printable characters so this data is easy to read by just eyeball inspection. Oh, if you're trying to parse out the elements (the data between the '*'s), remember to quote the '*' properly in the split command. That's one pitfall of using '*', but an easy one to overcome.

    The 'BEG', 'N1', 'N3', 'PO1' are called Segment Identifiers. Each field in those segments is defined in terms of allowable values (alpha, numeric, special tables of values, etc.), but there is a lot of latitude on how to use these standards. This latitude is typically nailed down in ICs (Implementation Conventions). In this discussion I have some links to some sample ICs used by the Government and others. These Sample ICs are actually based on the ASC X12 documents.

    Ask around and see if your trading partners have written up ICs. It may well be the case that they haven't, in which case you have to reverse engineer them from their use. Getting this right can be complicated.