Question

I have written an EDI document generator, and it currently pads any fields in the ISA segment that are less than the required number of characters with spaces on the left, e.g. ' 1234567890' for a 15 character element. I have a client who wants me to pad with spaces on the right. I can do this, but does ANSI X12 specify how elements in the ISA segment should be padded?

Was it helpful?

Solution 2

yes, this is specified.
in x12 alfanumeric fields are left-aligned, so spaces are on right: '1234567890' should be '1234567890 '

OTHER TIPS

Padding to the left (right justified) is uncommon (but legal) in an X12 document, at least with retail documents. Here's a link to a healthcare document with the padding you're currently doing: http://www.xtranslator.com/prod/beginguidex12.pdf

The ISA is important because it is the only fixed length segment in the standard, and as such, is probably the most important segment for a a parser. The ISA MUST be 106 characters. There is a min/max definition of each element. If you don't have enough data to fill that element it should be padded with spaces on the right. The ISA02 and ISA04 are commonly empty elements, but need to be padded to make up the fixed length width of the segment. Sender IDs and Receiver IDs are commonly less than 15 characters (see snippet below), and therefore must be padded.

ISA snippet:

ISA*00*          *00*          *ZZ*RECEIVERID     *12*SENDERID       *100325*1113*U*00403*000011436*0*T*>~

I suspect you're going to find more partners who want left justified for the sender / receiver elements than right justified.

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