HOW TO: Pass data from one Mapping Task to another in Informatica Cloud (IICS)?

Spread the love

Introduction

Informatica Cloud Data Integration supports passing data from one Mapping Task to another.

The data can be passed from one Mapping task to another in Informatica Cloud Data Integration through a Task flow using parameters. The Mapping Task which passes the data should have an In-Out Parameter defined using SetVariable functions. The Mapping Task which receives the data should either have an Input parameter or an In-Out Parameter defined in the mapping to read the data passed from upstream task.

In the Advanced Taskflow, the Input/In-Out parameter of the second mapping task can be set to the value passed by first mapping task either by directly using the Input fields tab in the Data Step or by using an intermediate Assignment step.

Let us understand how to implement this process using a simple example.

Task -1 Details

Consider below mapping which loads the Employees data from Oracle Database.

38 Pass values to another task - 1

There is an In-Out Parameter “MAX_HireDate” of type date/time defined in the mapping. The value to the IO-parameter is passed from expression transformation using SetMaxVariable.

The IO-parameter stores the maximum Hire_Date value out of all the employee records read from the Oracle source table.

Task -2 Details

Consider below mapping which reads only the data of employees with maximum Hire_Date.

There is an In-Out Parameter “Date_Filter” of type date/time defined in the mapping. The value to the IO-parameter will be calculated in the Task-1 and should be passed to the Task-2.

The IO parameter values calculated in Task-1 can be passed to Task-2 IO parameter using Advanced Taskflow.

Advanced Taskflow Details

Respective Mapping tasks are built for both Task-1 and Task-2.

In the Advanced Taskflow, add Task-1 and Task-2 between start and end using Data Task step. Select the respective mapping tasks in the Data task steps as shown below.

To assign the IO parameter value from Task-1 to IO parameter value in Task-2, follow any of the below discussed methods.

Method-1: Directly assign the IO parameter using the Input fields tab in the Data Task Step

  • Select Data Task -2 and navigate to Input Fields tab.
  • Click on + icon > InOut Parameters > select the IO parameter Date_Filter.
  • Now the Date_Filter appears as a field under Input Fields tab. To assign value, Click on Edit > Select value type as Field > Click To Select Field > Select IO parameter MAX_HireDate under Task-1.
  • Save and Publish the Advanced Taskflow.

Method-2: Using an intermediate Assignment step

The Method-2 is similar to Method-1 except that we use Assignment step to read the IO parameter value from Task-1 using a temporary field and assign this temporary field value to IO parameter in Task-2.

  • Under Start create a temporary field IO_Param. The other two Temp Fields are auto populated after adding the data tasks steps.
  • Under Assignment step assign the IO parameter from Task-1 to the Temp Field IO_Param.
  • Select Data task-2 and navigate to Input Fields tab. Assign the IO_Param as value to the IO parameter Date_Filter of Task-2.

Task Run Details

The values assigned to the IO parameters MAX_HireDate and Date_Filter can be verified from the Informatica Monitor.

Task-1 Run Details:

Task-1 processed a total of 107 records. The maximum Hire Date out of all records is 04/21/2008 and is assigned to IO parameter MAX_HireDate at the end of the run.

Task-2 Run Details:

The same value calculated in Task-1 is assigned to the IO parameter Date_Filter in the Task-2. The task-2 processed only 2 records which has the maximum Hire date value read from task-1.

6 thoughts on “HOW TO: Pass data from one Mapping Task to another in Informatica Cloud (IICS)?”

  1. What if we want to keep the data tasks in parallel instead of series. I tried that way but its not picking the value from other data task, its not working. Will that work ?

    Reply

Leave a Comment

Related Posts