Q) How to load the data from a flat file into the target where the source flat file name changes daily?
Example:
I want to load the customers data into the target file on a daily
basis. The source file name is in the format customers_yyyymmdd.dat. How
to load the data where the filename varies daily?The solution to this kind of problems is using the parameters. You can specify session parameters for both the source and target flat files. Then create a parameter file and assign the flat file names to the parameters.
Specifying Parameters for File Names:
The steps involved in parameterizing the file names are:
- Creating the Parameter File
- Specifying the parameters in Session
- Specifying the parameter file name
Creating Parameter File:
> cat dynamic_file_names.param [FolderName.SessionName] $InputFileName=customers_20120101.dat $outputFileName=customers_file.dat
Specifying Parameters in Session:
Specifying Parameter File Name:
The last step is specifying the parameter file name. You can specify the parameter file name either in the session level or workflow level. To specify in the session level, go the properties tab of the session and set the property "Parameter FileName".
To specify the parameter file at workflow level, click on the "Worfklows" in toolbar and then on Edit. Now go to the properties and set the file property "Parameter FileName"
Thats it you are done with using the parameters as filenames. Now you have to take care of changing the file name in the parameter file daily.
Note: You can even specify the source and target directories as parameters.
For more Visit http://www.quontrasolutions.com/blog/category/informatica/
No comments:
Post a Comment