Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't know of any X12 EDI perl modules, but I used to work for a company that did EDI (I even wrote a perl program that colorized/pretty-formatted X12 EDI). The following is purely from memory and may not be quoite right, but I hope you find it helpful.

X12 EDI documents are basically deimited files (i.e. split works great on them). Their are record separators, element separators, and sub-element separators. The first record in any X12 document is the ISA header, and this is fixed-length, so you can use it to find what all the separators are.

Once you know the separators, if you split the document on the record separator, you'll see its structured as follows (indentation added for clarity). If you then separate each record into elements by splitting on the element separator, the first element of each record is its record type:


ISA
  GS
    ST
      .. one transaction in here
    SE
    ST
      ..
    SE
  GE
  GS
    ...
  GE
IEA

i.e. the ISA/IEA records are the "document header and footer", it can contain one or more groups (delimited by GS/GE), each group contains one or more transactions (delimited by ST/SE). These ST/SE are the individual transactions (your 850, among others)

The 2 outer envelopes (ISA/IEA and GS/GE) contain routing information that indicates how to deliver the transcations. Within the ST/SE section are all the records that make up the individual 850. I don't remember what the exact records are.

Within the ST/SE block each record corresponds to specific information about the transaction.

That's about all I can remember for now. I'll post more if I can remember any other information in the structure of 850s....


In reply to Re: 850 EDI Help by lhoward
in thread 850 EDI Help by the_Don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found