Parsing Incomplete Records
A copybook describes a layout where a certain number of bytes is expected for each item. If Parse encounters the end of input data before all items have been fully read, it throws an exception. However, Parse offers flexibility to read incomplete data layouts.
Allow Incomplete Records
When the Allow Incomplete Records field is selected, the following conditions apply:
- If, while reading an item, Parse encounters a premature end of data, then the activity stops and returns the JSON containing all items that were read fully. This is considered a normal end of the processing (as opposed to an error condition when Allow Incomplete Records is not selected).
- Similarly, when Parse is reading an item with
OCCURS
clause, the premature end of data is considered normal even though a required number of occurrences was not read. When Allow Incomplete Records is not selected, this results in an error.
Allow Incomplete Text Items
The Allow Incomplete Text Items setting is designed for copybooks that end with a long PIC X(...) or PIC G(...) item that is not fully populated. To preserve resources, your program may choose to only deliver the beginning portion of this field that contains non-blank characters.
If Allow Incomplete Text Items is selected, Parse returns the string based on the available data even though it might be shorter than the declared item length. When Allow Incomplete Text Items is not selected, this field is discarded or the activity fails if Allow Incomplete Records is not selected.