Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • General,

  • Record Associations,

  • Record Selector, and

  • Experimental

General

...

In the General section, there are few important configurations that need to be set up correctly. If the configurations do not match the attributes of the file being processed, processing will fail. It can generally be hard to debug due to the nature of input file.

...

Copybook - Specifies the COBOL copybook that contains the structure of the data files. Copybook , contains only the fields and datatypes used in the COBOL file. The plugin can directly import COBOL copybooks (.cpy files) as definitions for generating the target schema. The schema definition is based on analyzing the entire copybook including REDEFINES and OCCURS. The schema can be simple or complex. Various different types of copybooks are currently supported.

...

  • “Do not split” will consider the entire copybook as a single record. Any sub-records defined in the copybook also become sub-records in the target system.

    • For the copybook in example above, a single record named ‘Root’ is created and within it are the two records ‘WS-RECORD-A’ and ‘WS-RECORD-B’. The file has both the records, and when extract either WS-RECORD-A is present or WS-RECORD-B is present. Automatically, both the sub-records are made Nullable.

    • When “Do not split” is configured, there is often need to separate records based on some selection criteria. E.g. In cases, were you have a single EBCDIC file that contains multiple records defined by multiple copybooks. The copybook you are configuring the pipeline with will have to select only the records that match the structure of the copybook configured. In that case, you have to configure ‘Record Selector’

    • In the example above, it’s highly recommended to not use ‘Do not Split’ option, but to go with ‘Split on REDEFINE’ option.

  • “Split on REDEFINE” will split the copybook at every REDEFINE (top level) into separate records.

    • In case, you have selected ‘Split on REDEFINE’, you should configure Record Association. This will allow different records that are split at REDEFINE to be associated with record types.

Record Associations

Record

...

When to split Copybook ?

There are various scenarios association provides a way to associate records based on the value of the a field in the record. For example if WS-REC-TYPE is 00001 then WS-RECORD-A should be populated and when WS-REC-TYPE is 00002 then WS-RECORD-B should be populated. This section allows us to define those associations easily. In order to do so, you can use one field in the record (note that field should be present in all the records) who’s value determines the record to picked. For the above example, this section of plugin is configured as follows:

  • Field Name is WS-REC-TYPE

  • Conditions (value of field and record name)

    • Key = 00001, Value = WS-RECORD-A

    • Key = 00002, Value = WS-RECORD-B

Info

Mainframe Record Reader only supports one field who’s value can be used to decide what record it is associated with.

Record Selector

Record selector allows filtering COBOL records from the file being read. COBOL field names generally have dashes(-), to make it easy to specify expressions, field associations are necessary. The field mappings provides association between COBOL field names with titled names used in the expression. Expressions can be for processing only records one is interested in. Rest of the records will be discarded, or sent to error depending on configuration. In case of REDEFINES, please use the redefined COBOL field name. For the above example, this section of plugin is configured as follows:

  • Note: Copybook Split has to be set to “Do not split”

  • Field Name Associations

    • Key = WS-REC-TYPE, Value = WsRecType

    • Key = WS-TS-TYPE, Value = WsTsType

    • Expression : (WsRecType == “00001” && WsTsType == “ACD”)

Field name and Output Schema types

...