envelope / error
EL3006
envelope.segment-count
Applies to: x12
What it catches and why it matters
SE01 does not match the recounted segments from ST through SE inclusive.
Failing example
These synthetic fragments illustrate the defect; they are not complete interchange files. Backslash escapes name bytes such as \r (CR) and \n (LF).
ST*835*0001~SE*9*0001~ (two segments, declared as nine)
How to fix it
Count every segment from ST through SE, including both. Preview edilint fix to replace SE01 with the observed count after confirming the transaction is complete.
False positives and limits
A missing terminator can merge segments and change the observed count. Fix segmentation first. A recount cannot prove that no payload was lost.
Acknowledgments and suppression
Related acknowledgment codes (apply only to the described defect): 999 code 4 (IK502): number of included segments does not match the actual count Suppress the rule with --disable EL3006, or list it under "disable" in .edilint.yml. To accept the occurrences a file already has without suppressing the rule, record them with --write-baseline and run with --baseline. Reference: https://crb2nu.github.io/edilint/rules/EL3006.html