You can create a session to read multiple source files for one source instance in a mapping. For example, if your organization collects data for multiple locations that you want to process through the same mapping, you can create a file list. A file list is a file that contains the names and directories of each source file you want the Integration Service to use.
You configure the session to read a file list. When you configure a session to read a file list, the Integration Service reads rows of data from the different source files in the file list. To configure the mapping to write the source file name to each target row, add the CurrentlyProcessedFileName port to the flat file source definition. The Integration Service uses this port to return the source file name.
You add the CurrentlyProcessedFileName port to a flat file source definition in the Source Analyzer.
To add the CurrentlyProcessedFileName port:
Open the flat file source definition in the Source Analyzer.
Click the Properties tab.
Select Add CurrentlyProcessedFlatFileName Port.
The Designer adds the CurrentlyProcessedFileName port as the last column on the Columns tab. The CurrentlyProcessedFileName port is a string port with default precision of 256 characters.
Click the Columns tab to see your changes.
You may change the precision of the CurrentlyProcessedFileName port if you wish.
To remove the CurrentlyProcessedFileName port, click the Properties tab and clear the Add Currently Processed Flat File Name Port check box.