Show

ISA — interchange header (24)

SeverityCodeFinding
ERROR isa.component-separator-invalid Discuss ↗ The component separator is not a usable delimiter

ISA16 -- the component (sub-element) separator -- is an alphanumeric byte or a space, so it collides with element data or padding. This is reported as an error here because many interchanges carry no composite elements; the body parser escalates it to fatal at the first segment that does.

FATAL isa.delimiter-collision Discuss ↗ Two delimiters are the same byte

The segment terminator is the same byte as the element separator or the component separator. Segment boundaries then cannot be told apart from element or composite boundaries anywhere in the interchange, so it cannot be parsed.

FATAL isa.delimiter-misaligned Discuss ↗ The ISA line cannot be decomposed at the element separator

Splitting the ISA line on the element separator left both the component separator (ISA16) and the byte after it -- the segment terminator -- as letters or digits, which cannot be told apart from data. The usual cause is a byte equal to the element separator occurring inside ISA06 or ISA08 data, which shifts every field after it: the line holds 16 separators but the wrong boundaries, so it cannot be trusted.

WARNING isa.element-embedded-newline Discuss ↗ A carriage return or line feed sits inside an ISA element

An ISA element value contains a CR or LF byte -- almost always a sender that hard-wrapped the ISA segment across lines. The delimiters are already known at this point, so the byte cannot be a delimiter (ISA11 when it carries the repetition separator, and ISA16, are left untouched); it is replaced with a space and the element is then measured against its fixed width.

FATAL isa.element-overflow Discuss ↗ An ISA element holds non-space data past its fixed width

This element is longer than its fixed width and the overflow is real data, not padding. There is no way to know the sender's intent -- an element separator may have been dropped, merging two fields, or the sender may have overrun the field. Guessing either way risks corrupting an identifier, so the ISA line is not reconstructed.

FATAL isa.element-separator-invalid Discuss ↗ The element separator is a letter or digit

The 4th byte of the ISA segment -- the element separator -- is a letter or digit. X12 does not restrict which byte a sender may use as a delimiter, but a letter or digit cannot be told apart from the data inside elements, so no segment in the interchange can be split reliably. x12-tidy refuses on that ground, not because the byte is forbidden.

ERROR isa.element-width Discuss ↗ An ISA element is not its fixed width

Every ISA element has a fixed width -- ISA06 is 15 bytes, ISA13 is 9, and so on. This element was shorter (space-padded on the right to fit) or longer only by trailing spaces (trimmed). The value itself is unchanged. A sender that right-trims blank fixed-width fields is the usual cause. This is an error, not a warning: the ISA line is no longer 105 bytes, and conventional VAN services and fixed-offset parsers cannot read the interchange at all until it is repaired.

FATAL isa.gs-not-found Discuss ↗ No GS header found after the ISA segment

x12-tidy locates the end of the ISA line by finding the 'GS' functional-group header that follows it (matched as 'GS' plus the element separator). The bytes 'GS' + separator do not appear anywhere after the ISA segment, so the ISA line cannot be bounded. (Contrast isa.separator-count-high, where a 'GS' + separator was found but is too far past the ISA segment to be its header.)

ERROR isa.identifier-lowercase Discuss ↗ ISA segment identifier is not uppercase

The segment identifier was found as 'isa' or mixed case (e.g. 'Isa'). X12 segment identifiers are uppercase. x12-tidy matched it case-insensitively and continued -- a file with a non-uppercase ISA identifier almost certainly has every other segment identifier the same way, which downstream steps must also tolerate.

WARNING isa.identifier-utf16 Discuss ↗ File is UTF-16 encoded

The bytes 'I', 'S', 'A' appear separated by NUL bytes near the start of the file -- a UTF-16-encoded 'ISA'. An X12 interchange is a single-byte stream, so x12-tidy transcodes the file to single-byte and parses that. Byte order is taken from the BOM if present, otherwise from which 'ISA' marker is found; valid X12 content is ASCII, so the transcription is lossless. Because the file was rewritten before parsing, every offset in the report indexes the transcoded bytes, not the original file. Re-export in a single-byte encoding to remove this warning.

FATAL isa.interchange-too-short Discuss ↗ Too short to be an X12 interchange

Fewer than 109 bytes follow the 'ISA' identifier -- not enough room for a 105-byte ISA line, its segment terminator, and a 'GS' header. A real interchange (ISA / GS / ST / ... / SE / GE / IEA) is far longer, so there is nothing to recover.

ERROR isa.isa11-not-standards-id Discuss ↗ ISA11 must be 'U' on versions before 00403

On ISA12 versions before 00403, ISA11 is the Interchange Control Standards Identifier and must be 'U'. (At 00403 and later, ISA11 became the repetition separator.) This ISA11 holds something else. ISA11 is informational on these versions -- it is not used to parse anything -- so this does not block the interchange, but the value is wrong.

FATAL isa.isa16-missing Discuss ↗ ISA16 is missing

ISA16 -- the one-byte element whose value is the component separator -- is absent: after the 16th element separator there are no bytes at all, no ISA16 and no segment terminator. Without ISA16 the component separator and the segment terminator cannot be recovered.

WARNING isa.leading-bytes Discuss ↗ Bytes precede the ISA segment

One or more bytes appear before the ISA segment. A conformant X12 file begins with 'ISA' as its very first byte. Common causes are a UTF-8 byte-order mark, whitespace, or transport headers left in by the sender. x12-tidy strips them and continues; the reported bytes are what was removed.

FATAL isa.no-identifier Discuss ↗ No ISA segment in the file

The identifier 'ISA' does not appear anywhere in the file, so there is no X12 interchange to inspect. Nothing downstream can run.

ERROR isa.repetition-separator-invalid Discuss ↗ The repetition separator is not a usable delimiter

ISA11 -- the repetition separator, for ISA12 version 00403 and later -- is an alphanumeric byte or is the same byte as another delimiter. It is reported as an error here because repetition is optional; the body parser escalates it to fatal at the first segment that repeats a data element.

ERROR isa.repetition-separator-missing Discuss ↗ No repetition separator for a version that has one

ISA12 is version 00403 or later, where ISA11 is the repetition separator, but ISA11 is blank or still holds the old standards identifier 'U'. Repeated data elements cannot be parsed; downstream must treat repetition as unsupported.

FATAL isa.segment-terminator-invalid Discuss ↗ The segment terminator is a letter or digit

The byte recovered as the segment terminator -- the byte right after ISA16 -- is a letter or digit. X12 does not restrict delimiter bytes, but a letter or digit cannot be told apart from segment data, so every segment boundary in the interchange is ambiguous and x12-tidy refuses.

FATAL isa.segment-terminator-stripped Discuss ↗ No segment terminator after ISA16

The GS functional-group header follows ISA16 with no segment terminator between them. The sender chose that terminator -- X12 does not dictate it -- and it is not present in the ISA line to recover, so x12-tidy refuses rather than guess '~': a wrong terminator would break the split of every following segment.

FATAL isa.separator-count-high Discuss ↗ More than 16 element separators before GS

An ISA header carries exactly 16 element separators. A 'GS' + element separator was found, but the run of bytes up to it holds more than 16 -- so that 'GS' is not this ISA segment's header. Either there is no GS envelope and the match lies inside a later segment's data, or the element separator occurs inside ISA06 / ISA08 data (an unparseable segment). The ISA line cannot be bounded; not recoverable. Pairs with isa.separator-count-low (fewer than 16).

FATAL isa.separator-count-low Discuss ↗ Fewer than 16 element separators before GS

An ISA header carries exactly 16 element separators (ISA*ISA01*..*ISA16); that count is part of the minimum bar for calling a run an ISA line at all. The run before the 'GS' header holds fewer -- element separators were removed, or the 'GS' anchored on is a false match inside earlier data. Every candidate ISA identifier was tried; none produced a 16-separator run. This is not an ISA line and is not recoverable.

WARNING isa.trailing-junk Discuss ↗ Unexpected bytes between the segment terminator and GS

Bytes that are not line breaks sit between the ISA segment terminator and the GS header -- stray spaces, a comment, or transport framing. Not part of the interchange under any legal delimiter choice -- non-conformant, and stripped on reconstruction. (A bare CR/LF/CRLF suffix after the terminator is lawful and is not flagged.)

ERROR isa.usage-indicator-invalid Discuss ↗ ISA15 is not a recognized usage indicator

ISA15 (Usage Indicator) must be 'T' (Test), 'P' (Production), or 'I' (Information) -- all three are legitimate values, so this only fires when it is none of them. Which of the three is present is not itself a defect and is reported separately as an informational fact, not a diagnostic.

WARNING isa.version-unrecognized Discuss ↗ ISA12 is not a recognised version code

ISA12 -- the Interchange Control Version Number -- is not a 5-digit code. Whether ISA11 is a repetition separator depends on this value, so ISA11 is left opaque and not treated as a delimiter.

GS — functional-group envelope (8)

SeverityCodeFinding
FATAL gs.control-number-duplicate Discuss ↗ GS06 is reused by another functional group in this interchange

Each functional group's Group Control Number (GS06) must be unique within the interchange, so its GE can be unambiguously matched back to it.

FATAL gs.control-number-mismatch Discuss ↗ GS06 does not match GE02

The Group Control Number set in the GS segment (GS06) must equal the one echoed back in the GE segment (GE02).

FATAL gs.control-number-not-numeric Discuss ↗ GS06 is not all-numeric

GS06 (Group Control Number) is defined as numeric (type N0). A non-numeric value cannot be a valid control number, regardless of whether it happens to match GE02.

FATAL gs.count-not-numeric Discuss ↗ GE01 is not all-numeric

GE01 (Number of Transaction Sets Included) is defined as numeric. A non-numeric value cannot be a valid count.

FATAL gs.missing-ge Discuss ↗ No GE segment closes this functional group

Every GS functional group must be closed by a matching GE segment before the next GS or the interchange trailer. None was found; the group's boundary was inferred from the next such marker so that everything inside it could still be checked.

ERROR gs.responsible-agency-invalid Discuss ↗ GS07 does not name a known standards organization

GS07 (X12 data element 455, 'Responsible Agency Code') says which standards body governs the transaction sets in this functional group -- not a party to the interchange. The only values X12 defines for element 455 are 'X' (Accredited Standards Committee X12) and 'T' (Transportation Data Coordinating Committee). This GS07 is neither.

FATAL gs.transaction-set-count-mismatch Discuss ↗ GE01 does not match the number of transaction sets found

GE01 (Number of Transaction Sets Included) must equal the actual count of ST segments in the functional group.

FATAL gs.version-mismatch Discuss ↗ GS08 does not agree with the interchange's version (ISA12)

GS08 (Version/Release/Industry Identifier Code) must agree with ISA12 (Interchange Control Version Number) on the version and release. Compared with leading zeros stripped from both sides, since real-world senders commonly send GS08 as '4010' rather than the textbook zero-padded '004010'. Runs regardless of GS07.

ST — transaction-set envelope (5)

SeverityCodeFinding
FATAL st.control-number-duplicate Discuss ↗ ST02 is reused by another transaction set in this functional group

Each transaction set's Control Number (ST02) must be unique within its functional group, so its SE can be unambiguously matched back to it. Unlike GS06/control numbers elsewhere, ST02 is alphanumeric (type AN), not numeric -- uniqueness is still required even though numeric format is not.

FATAL st.control-number-mismatch Discuss ↗ ST02 does not match SE02

The Transaction Set Control Number set in the ST segment (ST02) must equal the one echoed back in the SE segment (SE02).

FATAL st.count-not-numeric Discuss ↗ SE01 is not all-numeric

SE01 (Number of Included Segments) is defined as numeric. A non-numeric value cannot be a valid count.

FATAL st.missing-se Discuss ↗ No SE segment closes this transaction set

Every ST transaction set must be closed by a matching SE segment before the next ST, the enclosing GE, or the interchange trailer. None was found; the transaction set's boundary was inferred from the next such marker so that everything inside it could still be checked.

FATAL st.segment-count-mismatch Discuss ↗ SE01 does not match the actual segment count

SE01 (Number of Included Segments) must equal the actual count of segments in the transaction set, from ST through SE inclusive.

Structure & control counts (8)

SeverityCodeFinding
FATAL structure.control-number-mismatch Discuss ↗ ISA13 does not match IEA02

The Interchange Control Number set in the ISA segment (ISA13) must equal the one echoed back in the IEA segment (IEA02). A mismatch usually indicates a corrupted or hand-edited file.

FATAL structure.control-number-not-numeric Discuss ↗ ISA13 is not all-numeric

ISA13 (Interchange Control Number) is defined as numeric (type N0). A non-numeric value cannot be a valid control number, regardless of whether it happens to match IEA02.

FATAL structure.count-not-numeric Discuss ↗ IEA01 is not all-numeric

IEA01 (Number of Included Functional Groups) is defined as numeric. A non-numeric value cannot be a valid count.

FATAL structure.foreign-content Discuss ↗ Segment outside the envelope structure

A segment sits outside any recognized structural context -- before the first functional group, between a functional group's close and the next one, after the interchange trailer, or a closing segment (SE, GE, IEA) with nothing open to close -- including a second IEA once the interchange is already closed. This covers every shape of 'a segment turned up in a place the envelope structure does not allow', including a body segment with no open transaction set to belong to.

FATAL structure.functional-group-count-mismatch Discuss ↗ IEA01 does not match the number of functional groups found

IEA01 (Number of Included Functional Groups) must equal the actual count of GS segments in the interchange.

ERROR structure.identifier-invalid Discuss ↗ A segment identifier does not begin with an uppercase letter

Every X12 segment identifier begins with an uppercase letter (X12.6); the rest is uppercase letters or digits, two or three characters (so 'N1', 'PO1', 'G62' are valid). A piece whose identifier does not begin with an uppercase letter -- lowercase, a digit, or empty -- cannot be a real segment.

FATAL structure.missing-iea Discuss ↗ No IEA segment closes the interchange

Every ISA interchange must be closed by a matching IEA segment. None was found before the end of the file. This is QA/QC's 'fatal' -- a display/trust signal, not a stop: the rest of the payload is still scanned and every other finding is still reported.

ERROR structure.segment-element-count Discuss ↗ An envelope segment has the wrong number of elements

An envelope segment carries a number of data elements the standard does not define for it: GS has 8, GE / SE / IEA have 2, and ST has 2 or 3 (ST03, the optional Implementation Convention Reference, was added in release 004020). An extra element is usually a stray delimiter or appended data; too few means a required element is missing. Reported as an error, not a refusal -- the envelope is still walkable. (ISA is always 16 elements; a wrong count there is fatal and is caught earlier, in the ISA-line phase.)