edireader icon indicating copy to clipboard operation
edireader copied to clipboard

How do you recover from EDI input with wrong segment count in SE trailer?

Open canabrook opened this issue 5 years ago • 2 comments

Sometimes EDI transactions are generated with flawed software, producing structurally invalid EDI with the wrong segment count in the SE trailer segment. How does EDIReader support recovery from such input?

canabrook avatar Mar 31 '19 07:03 canabrook

If you are using EDIReader's Java API, you need to use the setSyntaxExceptionHandler method to provide an exception handler that decides whether or not to keep parsing after recoverable syntax errors. See the com.berryworks.edireader.demo.EDItoXML class for an example. A bad segment count in the SE segment is an example of a recoverable error.

If you are using the EDItoXML command line program, simply use the -r command line option followed by true to specify that parsing should continue after recoverable errors in the input data.

canabrook avatar Mar 31 '19 07:03 canabrook

we are using the --recovery flag ..however, the record with the issue is not outputted at all (and the message does not have any record identifier, so it is hard to find the record with the missing expected segment). The commercial EDI parse my client uses is much more forgiving - it will still output the record. Is there any other related setting/flags? - or would I need to look at changing the source code?

cwiese avatar Oct 31 '20 21:10 cwiese