Interpretting Validation Results

Post author
Stephen Sweeney

When we get results from Validation via that Error Message Context, it appears like:

Invalid EDI 837P Detected:
[NM1 at pos 34] [1065 at pos 2 with value 1] InvalidCodeValue
[CLM at pos 53] RequiredSegmentMissing
[NM1 at pos 82] [1065 at pos 2 with value 1] InvalidCodeValue

Is there any reference/guidance on interpreting these values? specifically the 'pos' - what's that number relative to exactly? 

We ultimately write it to file using the X12Writer, so were expecting a few lines of offsetting for the header etc. but it doesn't seem to line up at all in terms of line numbers (we're using fairly standard delimiters etc.)





  • Comment author

    Hello Stephen,

    The ErrorContext contains all the data, this is just an internal representation. You can iterate through the errors\codes in the ErrorContext and offset\arrange the details anyway you need.

    The pos for the segments is the numerical count position from the start of the transaction set.

    The pos for the data element is the element's position within the segment.

    The positioning follows the rules of the X12\EDIFACT acknowledgments and is used when generation functional\technical acknowledgments.


  • Comment author
    Stephen Sweeney

    Thanks for the clarification!

  • Comment author
    Jonathan Conley

    Hi Don,

    Can you clarify "The pos for the segments is the numerical count position from the start of the transaction set."

    I'm looking at an EDI file in Notepad++ and trying to find which warnings correspond with which EDI segments and am having a very hard time.  Is it literally the ascii character position in the file?  If so then the positions logged are completely out of whack with the literal character positions of the segments (such as "CLM").  If not ascii character positions in the EDI file, how are you reckoning "position" in the EDI file?



  • Comment author
    • Edited


    I hope you product evaluation is going well.

    You can find more information regarding the X12 standard (including positions), on their website here. Also, the SEF documentation might be useful to learn about the X12 standard.

    Position is the index of each segment within its transaction, and the total number of segments is the contol number in the SE segment.

    So, if you have 3 segments in a transaction, the first will be at position 1, the second at position 2, and the third at position 3. I hope this clarifies it.

    I'd appreciate if you share some actual data with information about the positions and why do you believe they are incorrect. Also, please let me know when you began your product trial for our records.

    BTW, the position matches the values in AK302 for X12 997.


Please sign in to leave a comment.