Create a mapping m_Replication_Template and configure the following dynamic mapping functionality:
Read transformation that uses a parameter for the data object to read from different sources
Dynamic ports in the downstream transformations that can pass new or changed columns
Expression transformation that contains a dynamic expression to remove leading and trailing spaces in strings
Write transformation that creates target columns based on the mapping flow and uses a parameter in the target data object for the target file name
When you run the mapping, the Data Integration Service performs the following tasks:
Reads the data from the appropriate source file based on the parameter value for the source data object.
Passes the new and changed columns to the downstream transformations through dynamic ports.
Expands the dynamic expression and processes the expression function for each generated port in the dynamic port.
Creates columns in the Write transformation based on the mapping flow and writes the transformed data to the appropriate target file based on the parameter value.
The following image shows the objects in the mapping:
The mapping contains the following objects:
Read_Customer_FF
Read transformation that represents a flat file source. The flat file contains string data with leading and ending spaces.
Exp_TRIM
Expression transformation that contains a dynamic expression to remove leading and trailing spaces for ports of type string.
Exp_Output
Expression transformation that contains transformed string ports, and remaining ports from the source object.
Write_customerTrim_FF
Write transformation that represents a flat file target. The mapping writes the output to the flat file target.