edix12

Correct padding for EDI ISA segment


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?


Solution

  • Yes, this is specified.

    In x12 alphanumeric fields are left-aligned, so spaces are on right:

    '1234567890' should be '1234567890 '