Question

I am implementing an EDI-x12 header parser (only to parse "ISA" segment) I notice that there are several character sets can be used.

My question is that how do I know that which one is used of incoming edi-x12 message so that I know how to interpret the message?

Was it helpful?

Solution

actually there is no such thing as a character set in x12. this is up to the partners/interchange agreement. but as X12 is mainly used in USA, it is us-ascii (almost always). (but .....some companies send x12 as EBCEDIC ;-)))

OTHER TIPS

If you're only doing ANSI X12, the ISA segment should be easy for you to parse, as it is a fixed length.

Position 4 will give you the element delimiter (field delimiter).
Position 106 will give you the record terminator.
Position 105 will give you the subelement delimiter

You probably won't have much use for the subelement delimiter, depending on the document type. Once you figure out what your field delimiters are and then the record delimiter, it should be a snap.

(Standard disclaimer: there are many great tools out there in the form of data translators that make this job much simpler than having a programmer reinvent the wheel. Some of these tools are even open source and free. Just sayin'...)

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top