Sequential File Stage - Query

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
shank
Participant
Posts: 18
Joined: Wed Mar 25, 2009 3:11 am

Sequential File Stage - Query

Post by shank »

I have 3 Input files having same layout.

Customer_AAAA.txt
Customer_BBBB.txt
Customer_CCCC.txt

I am using Sequential file stage to read them(File Pattern as Read Type - Customer_*.txt)

The input File has 5 Columns.

I need to load that to a table which has 6 Columns.

The extra column in the Table is SOURCE_FILE_NAME which should have the value of the File name from which the data has come.

Any way we can do this in Datastage ?
Thanks for your time in viewing this post and reply in advance.
Regards,
Shank
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Use "File Name Column" property
You are the creator of your destiny - Swami Vivekananda
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

I dont think file name column property gives you file name,if it is multiple files(File pattern).
shank
Participant
Posts: 18
Joined: Wed Mar 25, 2009 3:11 am

Post by shank »

Hi, Thanks for the reply.

Using that Property gives the Output column with the Wild card format.
It is not giving the exact file name from where the record is sourced.
Regards,
Shank
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Set environment variable $APT_IMPORT_PATTERN_USES_FILESET = true to get exact file name
You are the creator of your destiny - Swami Vivekananda
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

make APT_PATTERN_USAGE_FILESET=true in your job.
shank
Participant
Posts: 18
Joined: Wed Mar 25, 2009 3:11 am

Post by shank »

Its Working !! .. Thank you for your expertise. :)
Regards,
Shank
Post Reply