To control how EDI files are being parsed, pass in either a EdifactReaderSettings or a X12ReaderSettings object to the corresponding reader.
You can select any of the following settings:
- Encoding - this is the System.Encoding to use when writing to the output stream or file. UTF8 by default.
- ContinueOnError - this is to force the parser to continue past a ReaderException. Thiese exceptions imply that the EDI stream is corrupt and execution is terminated by default. By setting this flag to True, execution continues to recover any additional transactions or interchnages further down the stream.
- MaxSegmentLength - this is the maximum number of characters the parser can read before finding a segment terminator. When no segment terminator was found, the parser assumes the EDI stream is corrupt and terminates execution. It is also used in VDA and positional parser to specify the set length of each segment. 5000 by default for EDIFACT and X12. 128 by default for VDA.
- Separators - this is the set of separators to be used when reading the EDI document. It uses the default delimiter sets for X12 and EDIFACT when not explicitly set. The separators are being automatically overwritten by the delimiters set in ISA or UNA.
- NoEnvelope - this flag tells the parser to not expect any envelopes (ISA, UNB, etc.) and that only transactions will be read from the EDI stream.
- DiscardSplitter - Whether to skip splitting even though the template is marked for splitting ('false' by default). It's useful when you want to reuse the same template to split and no-split scenarios depending on file size.