Hi
I have to capture the file name of the file which i am currently loading into a database and insert this file name along with the data in database.
How can this be done in datastage, i am reading fix width files.
Thanks
Capturing File name of the file being loaded
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 70
- Joined: Thu Aug 14, 2003 6:24 am
- Contact:
Re: Capturing File name of the file being loaded
You need to develop job with parameter to store file name ( assuming you know file anme before you read that). Use transformer stage to map the parmater name to field that mapped again to DB filedname. So each row will carry its file name along with data. That is the standard solution for this problem. one more assumption here is, when reading files in "sequential file" stage, you are setting "read method" as "specific files" rather than "File pattern".
Sree
Sree
amit_dwh wrote:Hi
I have to capture the file name of the file which i am currently loading into a database and insert this file name along with the data in database.
How can this be done in datastage, i am reading fix width files.
Thanks
Re: Capturing File name of the file being loaded
there is "almost" working more elegant solution here:
http://dsxchange.com/viewtopic.php?p=210536
however, it does not quite work :(
http://dsxchange.com/viewtopic.php?p=210536
however, it does not quite work :(
s_boyapati wrote:You need to develop job with parameter to store file name ( assuming you know file anme before you read that). Use transformer stage to map the parmater name to field that mapped again to DB filedname. So each row will carry its file name along with data. That is the standard solution for this problem. one more assumption here is, when reading files in "sequential file" stage, you are setting "read method" as "specific files" rather than "File pattern".
Sree
amit_dwh wrote:Hi
I have to capture the file name of the file which i am currently loading into a database and insert this file name along with the data in database.
How can this be done in datastage, i am reading fix width files.
Thanks