The Normalizer transformation

The Normalizer transformation is used in place of Source Qualifier transformations when you wish to read the data from the cobol copybook source. Also, a Normalizer transformation is used to convert column-wise data to row-wise data. This is similar to the transpose feature of MS Excel. You can use this feature if your source is a cobol copybook file or relational database table. The Normalizer transformation converts columns to rows and also generates an index for each converted row. A sample mapping using the Normalizer transformation is shown in the following screenshot:

The Normalizer transformation

Consider the following example, which contains the salaries of three employees for four months:

STEVE 1000 2000 3000 4000
JAMES 2000 2500 3000 3500
ANDY 4000 4000 4000 4000

When you pass the data through the Normalizer transformation, it returns the data in a row-wise form along with the index, as follows:

STEVE 1000 1
STEVE 2000 2
STEVE 3000 3
STEVE 4000 4
JAMES 2000 1
JAMES 2500 2
JAMES 3000 3
JAMES 3500 4
ANDY 4000 1
ANDY 4000 2
ANDY 4000 3
ANDY 4000 4

As you can see, the index key is incremented for each value. It also initializes the index from 1 when processing data for a new row.

Configuring the Normalizer transformation – ports

Normalizer transformation ports are different from other transformations ports. You cannot edit the ports of Normalizer transformations. To define the ports, you need to configure the Normalizer tab of a Normalizer transformation. To add the multiple occurring ports to the Normalizer transformation, double-click on the Normalizer transformation and click on Normalizer. Add the columns to the Normalizer tab. You need to add the single and multiple occurring ports in the Normalizer tab. When you have multiple occurring columns, you need to define them under the Occurs option in the Normalizer transformation, as shown in the following screenshot:

Configuring the Normalizer transformation – ports

When you add the columns in the Normalizer tab, the columns get reflected in the Ports tab based on the options definitions. In our case, we define SALARY_MONTH under occurs 4 times in the Normalizer transformation. This creates the port four times in the ports tab.

The Normalizer transformation creates a new port called generated column ID (GCID) for every multi-occurring ports you define in the Normalizer tab. In our case, it is created for SALARY_MONTHLY. This port generates the index value to be assigned to new multi-occurring values. The GCID is incremented automatically each time it processes a new record, as shown in the following screenshot:

Configuring the Normalizer transformation – ports

The attributes of the Normalizer tab are as follows:

Attribute

Description

Column name

This indicates the name of the column you wish to define.

Level

This defines the groups of columns in the data. It defines the hierarchy of the data. The group level column has a lower-level number, and it does not contain data.

Occurs

This indicates the number of times the column occurs in the data.

Datatype

This indicates the data type of the data.

Prec

This indicates the length of the column in the source data.

Scale

This indicates the number of decimal positions in the numeric data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset