Processing ASCII Binary Input File with Data Mapped by a COBOL Structure with Array

This example pipeline demonstrates how to process ASCII binary data with the data mapped by a COBOL structure with an array. Often COBOL Structures have an array that can have a maximum number of entities. To save space, this was often restricted in the data to a specific number of array entries using the structure.

First, we configure the File Reader Snap to read the data for processing. Provide the filename and leave the other settings with default values.

Next, we configure the Parser Snap with the Copybook structure file and settings required to parse the input data.

The above configuration options specify the following:
  • Copybooks: CPL010.cpy is the copybook file containing the COBOL structure to be used to process this data.
  • Copybook Split: As there is only one COBOL Structure in the copybook, no splitting of structures is required.
  • Organisation: The input file is interpreted based on the length it determines from the COBOL structure(s) provided. These are fixed length records. If a CR/LF or LF is found at the end of the record based on the length of the structures, this will be accommodated.
  • Dialect: The binary data in the input file is FMT_INTEL(LITTLE_ENDIAN).
  • Encoding: Character data in the Snap is encoded in codepage UTF-8.
The further options mean:
  • Character fields will not be enclosed in quotes.
  • Blanks will be truncated from the start and end of character fields.
  • No selection criteria are needed or provided as the input file only contains one type of record.
  • No Header, Middle, Trailer structure name is provided.

Validate the Pipeline. You can view the JSON formatted output in the preview.