Pass filename with records while reading multiple files

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Kumar1234
Participant
Posts: 14
Joined: Mon Feb 04, 2008 5:59 am

Pass filename with records while reading multiple files

Post by Kumar1234 »

I am reading multiple xml files using file pattern (*.xml) and loading into a teradata table. I have a requirement to pass the filename along with the records. I need to do this on server job as the current design already exist and this is an addition.
I searched the forum, but did not find any favorable solution.

Kindly Help....
Thanks...Kumar
BrunoD
Participant
Posts: 3
Joined: Wed Mar 21, 2012 7:24 pm
Location: São Paulo

Post by BrunoD »

Hi,
Did you get any solution? I have a similar scenario.
Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How similar? For anything other than exactly the same you should start your own post.

If you are processing XML files in a Server job you should be using a Folder stage and that can automatically pass in the name of the file along with the file contents.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kumar1234
Participant
Posts: 14
Joined: Mon Feb 04, 2008 5:59 am

Post by Kumar1234 »

sorry I forget to reply to this post. When you read the XML in XML-Input stage you can add FileName column with VARCHAR 255 in output along with other attributes and it will automatically populate the filename to your output.
Thanks...Kumar
Post Reply