This article explains how to split records based on a particular column into multiple flat files using Transaction Control Transformation. Below given the Mapping and transformation Snapshots.
Mapping Snapshot
Sorter Transformation: Sorts the records based on column that used to split the file. In this example, it is JOB column.
Expression Transformation: After sorting based on JOB column. The first job column will be marked as '1' and rest marked as '0'. This helps the Transaction control to decide where to commit. It also calculates the file name for the group.
Transaction Control Transformation: It continue the transaction when the flag is 0 and commits the transaction before on 1.
Target Definition: Add the file name using the "Add Filename column to this table" button in the taget definition.
Download Workflow
Hope this helped you and thanks for reading this article !
0 comments:
Post a Comment