...
It’s that simple, you have now created a simple pipeline that can read data from EBCDIC files and move them data into the target. Next The next step is to configure the “Mainframe Record Reader”. In this article, we will not talk about configuring the target. (We are assuming that you are well versed there.)
...
The “Mainframe Record Reader” has four sections areas that might require setup, depending on the attributes of the how file was exported and transferred. The setup is grouped into the following four sections:
General,
Record Associations,
Record Selector, and
Experimental
General
...
In general General section, there are few important configurations that need to setup be set up correctly. If the configuration 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.
Record Format (RECFM) - Record format specifies the type of the records in the file. Records from mainframe can be either Fixed Length or Variable Length or Variable Block. Select the right configuration depending on the knowledge of the file or group of files you are processing.
(RECFM=F) Fixed Length record file files have all the records of the same size (bytes), there are EOL, as well as EOL and CTRL-M characters indicating the end of line, they . They are just a stream of bytes.
(RECFM=V) Variable Length record files have records that can be varying sizes. Typical Typically, different sizes might indicate that there are different copybooks. Each copybook could be associated with one record size.
(RECFM=VB) Variable Block record files have variable record length files, but the variable length records are grouped in blocks. Such files are easy to process in parallel.
Info |
---|
If you do not know the record format of the file, start with RECFM=V. If there is a mismatch, the processing would will fail. It is very difficult to detect whether the records within the file are variable length or fixed length as everything in file is just stream of bytes. |
Code Page - Code page defines the character encoding that associates a unique number with the set of printable and control characters. Mainframes defined different code pages for different regions. So depending on the origin or character set on the mainframe, the code page should be chosen. For example any mainframe in US will code page as cp037.
...
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.
Output Schema type - Specifies the whether the output schema that gets represented in the target is a Flat structure or Nested structure as defined in copybook. See Field names and Output Schema types section for how the fields from copybook are translated into the target schema.
How to split copybook (applicable only when Output Schema type is Nested Structure) - Depending on how you want to interpret the records within the file you can either use option to not split an individual record as different records (Do not split) or you can chose to split the the record at REDEFINE
.
Example 1: To Illustrate ‘Do Not Split’ and ‘Split on REDEFINE’ option.
Code Block |
---|
01 WS-RECORD-A 02 WS-REC-TYPE PIC X(05). 02 WS-TS-TYPE PIC X(03). 02 WS-CUST-FNAME PIC X(22). 02 WS-CUST-LNAME PIC X(16). 02 WS-FIN-AMT PIC S9(9)V99 COMP-3. 02 FILLER PIC X(30). 01 WS-RECORD-B REDEFINES WS-RECORD-A 02 WS-REC-TYPE PIC X(05). 02 WS-TS-TYPE PIC X(03). 02 WS-CUST-FNAME PIC X(22). 02 WS-CUST-LNAME PIC X(16). 02 WS-FIN-AMT PIC S9(9)V99 COMP-3. 02 WS-CUST-ADDR PIC X(15). 02 WS-CUST-CIT. PIC X(15). |
If you have selected ‘Do not split' and file has various record types, then you would want to configure Record Selector. If entire file is of a single record type, then Record Selector is not required. In the above below, If “Do not split
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.
...
types
...
.
Info |
---|
If you have specified Output Schema type as ‘Flat’ then Copybook split has no effect on the record being read. This option is important when Output Schema type is ‘Hierarchical’. |
...