A source contains orders for several cities. You want to write orders to separate output files based on the city.
The following figure shows a mapping to process the orders:
In addition to a source and Source Qualifier, the mapping has the following objects:
. Sorts the source data by city.
Determines when a new city appears in a row and passes an integer to the New City port of the Transaction Control transformation. Passes 0 by default and passes 1 when the row contains a new city.
Transaction Control transformation.
Evaluates the New City value from the Expression transformation. When New City is 1, the Transaction Control transformation commits all orders in the transaction to the target. The Transaction Control transformation passes the city and order number to the flat file target. It also passes the city to the FileName column in the target.
Flat file target.
Writes a new flat file for each transaction. The Integration Service names each target with the value of FileName.
The Integration Services passes a transaction for each city to the target. For this example, the data contains the following cities and order numbers:
San Francisco, 101
San Francisco, 104
San Francisco, 105
The Integration Service generates the following output files: