Skip to main content

Cobol Copybook Parser

The Directory and Wildcard properties of the associated File Reader must specify the path to and names of the data files. 

The output type is JSONNodeEvent.

Cobol Copybook Parser properties

property

type

default value

notes

Copybook Dialect

String

Mainframe

Select the value that matches the system on which the files were created: BigEndian, Fujitsu, Intel, Mainframe, MicroFocus, or OpenCobol

Copybook File Format

enum

USE_STANDARD_COLUMNS

Supported values:

  • FREE_FORMAT

  • USE_COLS_6_TO_80

  • USE_LONG_LINE

  • USE_STANDARD_COLUMNS

  • USE_SUPPLIED_COLUMNS

Copybook File Name

String

The fully qualified name of the .cpy file that describes the contents of the data files.

Copybook Split

enum

Level01

How the records in data file are mapped to records in the copybook. Supported values:

  • HighestRepeating: multiple records are defined not at the 01 level; the appropriate value must be specified for Record Selector

  • Level01: Multiple records are defined at the 01 level;; the appropriate value must be specified for Record Selector

  • None: a single record is defined, starting at 01 level

  • Redefine: Cobol redefines are used in the copybook

  • TopLevel: a single record is defined, not at 01 level

Data File Font

String

UTF8

The character set of the data files.

Data File Organization

enum

UnicodeText

Supported values:

  • UnicodeText: for newline-delmited records in UTF8

  • Text: for newline-delimited records in ASCII

  • UnicodeFixedLength

  • FixedLength (ASCII)

  • Variable, VariableDump, VariableOpen: the size of each record is defined in the copy book with no record delimiters

Data Handling Scheme

enum

ProcessRecordAsEvent

With the default value, ProcessRecordAsEvent, each record will be output as a separate event. Set to ProcessFileAsEvent to have all records in each file output as a single event.

Group Policy

For documentation of this feature, Contact Striim support.

Process Copybook File As

SingleEvent

Set to MultipleEvent to enable Group Policy.

Record Selector

String

When the Copybook Split value is Level01 or HighestRepeating options, specify a set of mappings of record and field value to record type.

Skip Indent

Integer

0

If the contents of the data files are indented, specify the number of characters to skip on each line before reading data.

Cobol Copybook Parser example

CREATE SOURCE ReadCobol USING FileReader
(
  directory:'docs/CobolCopybookParser',
  WildCard:'ACCTSD',
  positionByEOF:false
)
PARSE USING CobolCopybookParser (
  copybookFileName : 'docs/CobolCopybookParser/ACCTS.cpy',
  dataFileOrganization: 'Text'
)
OUTPUT TO CobolParserStream;

For a complete example including TQL file, copybook, and data, download CobolCopybookParser.zip from https://github.com/striim/doc-downloads.

If you encounter any errors or other issues using this parser, please Contact Striim support.