Run tests with COBOL files

Tricentis Data Integrity uses a custom data source reader to read Common Business Oriented Language (COBOL) copybook files and Extended Binary Coded Decimal Interchange Code (EBCDIC) data files. You can perform row-by-row comparisons with COBOL files or load data into the caching database.

Use the COBOL reader

Tricentis deploys the COBOL reader to your Custom Data Source Reader installation directory. It is implemented for the Row by Row Comparison and Load Data into Caching Database from Customization Module.

Supported data types

The table below shows which COBOL data types the COBOL reader supports.

Data Type

COBOL Usage Representation

Precision (p)

Scale (s)

BINARY COMP-0

PIC S9 (1) to S9(4) COMP

PIC S9 (5) to S9(9) COMP

PIC S9 (10) to S9(18) COMP

1 to 4

5 to 9

10 to 18

n/a

n/a

n/a

CHARACTER ALPHANUMERIC

PIC X(n)

n

n/a

PACKED DECIMAL

PIC S9(p)V9(s) COMP-3

p+s

s

NATIVE BINARY ZONED DECIMAL

PIC S9 (1) to S9(4)

PIC S9 (5) to S9(9)

PIC S9 (10) to S9(18)

PIC S9(p)V9(s)

1 to 4

5 to 9

10 to 18

p+s

n/a

n/a

n/a

s

Required parameters

The COBOL reader makes use of the parameters described in the table below. You must specify these parameters in your TestStep (see the example below).

Parameter name

Value

Optional

CobolDataFile

The full path to the COBOL data file.

No

CobolCopybookFile

The full path to the COBOL copybook.

The copybook contains the layout information for the COBOL data file and allow programs to interpret it.

No

CobolCodepage

The name of the COBOL codepage to use to convert the data from EBCDIC to ASCII.

The default value is IBM037.

Yes

FilterByGroup

A comma-separated list of group names from the COBOL copybook.

Only the child variables of the specified group(s) are read from the COBOL data file. Groups include normal group declarations and REDEFINES.

Yes

IgnoreFillerColumns

Copybooks can contain filler columns that act as a placeholder, for example, to create a new column or to skip an irrelevant column. The COBOL reader can ignore filler columns if you don't need them for your tests.

To do so, set this parameter to True. The default value is False.

Yes

Unique column names

By default, the COBOL reader tries to make all column names in the copybook unique. If two or more columns use the same name, it automatically adds -n to the name.

In this example, three columns in the copybook have the same name.

SomeColumn PIC X(1)

SomeColumn PIC X(1)

SomeColumn PIC X(1)

To make the column names unique, the COBOL reader automatically adds -n.

SomeColumn PIC X(1)

SomeColumn-1 PIC X(1)

SomeColumn-2 PIC X(1)

Example: Load data from EBCDIC COBOL files into the caching database

In this example you want to load data from an EBCDIC COBOL file into the caching database. You perform the following steps:

  1. To integrate your custom data source reader, you copy and paste the DLL file into the Custom Data Readers folder located at C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\Data Integrity.

  2. In Tricentis Tosca, you open the Load Data into Caching Database from Customization TestStep.

  3. As Table Name, you specify the name of the table into which Tosca DI loads the data.

  4. In the Value field of Class Attribute Name, you enter the name of your custom data source reader.

  5. You create the following Parameters:

    • CobolDataFile with the path to the COBOL data file as value.

    • CobolCopybookFile with the path to the COBOL copybook as value.

    • CobolCodepage with the name of the COBOL codepage as value. This is relevant to convert the data from EBCDIC to ASCII.

    • FilterByGroup with a group name from the COBOL copybook as value.

Load data from a COBOL file into the caching database