Page 1 of 1

Filename column for multiple file read

Posted: Thu Jan 24, 2013 11:14 am
by wahi80
Hi,

I have a job where I read multiple files using the File pattern approach.
I also needed to get the file name , so I used the filename column option.

My file pattern is ??.txt.

While my job read all the data in the files correctly, the name in the filename column is always ??.txt. I was expecting to get 1a.txt, 2b.txt and so on.

Is this the way it is designed to work?

Posted: Thu Jan 24, 2013 11:26 am
by prasson_ibm
In case of file pattern,datastage perform just like unix "cat" command,since all the metadata of files are same,so its read bunches of the files togather.

Posted: Thu Jan 24, 2013 11:45 am
by wahi80
But that is not my requirement, I need to map filename to each row

Posted: Thu Jan 24, 2013 12:47 pm
by chetan.c
Set this environment variable APT_IMPORT_PATTERN_USES_FILESET to true and check.

Posted: Thu Jan 24, 2013 12:50 pm
by wahi80
That works!!!

Posted: Thu Jan 24, 2013 1:56 pm
by chulett
FYI - a search here would have turned that information up.

Posted: Fri Jan 25, 2013 12:39 pm
by chetan.c
Apologies Craig.
I Should have pointed towards it.

Posted: Fri Jan 25, 2013 1:54 pm
by chulett
No worries! Just wanted to add that little tidbit. :wink: