Page 1 of 1

Sequential File Stage - Query

Posted: Wed Mar 26, 2014 1:56 am
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.

Posted: Wed Mar 26, 2014 2:50 am
by anbu
Use "File Name Column" property

Posted: Wed Mar 26, 2014 3:36 am
by prasson_ibm
I dont think file name column property gives you file name,if it is multiple files(File pattern).

Posted: Wed Mar 26, 2014 3:38 am
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.

Posted: Wed Mar 26, 2014 3:51 am
by anbu
Set environment variable $APT_IMPORT_PATTERN_USES_FILESET = true to get exact file name

Posted: Wed Mar 26, 2014 3:52 am
by prasson_ibm
make APT_PATTERN_USAGE_FILESET=true in your job.

Posted: Wed Mar 26, 2014 6:59 am
by shank
Its Working !! .. Thank you for your expertise. :)