Getting File Names

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
mali_aydin
Charter Member
Charter Member
Posts: 6
Joined: Fri May 05, 2006 6:57 am

Getting File Names

Post by mali_aydin »

Hi,
While reading data from ascii files I want to get the file names at the same time

Definition of
Source : File Pattern = /export/home/dsadm/cdr/file_name*
Read Method = File Pattern

Example :

file_name1 : a,b,c,d,e,f
file_name2 : g,h,i,j,k,l
file_name3 : 1,2,3,4,5

I want to load records in "file_name1,file_name2,file_name3" files and the name of files at the same time.

Input : /export/home/dsadm/cdr/file_name*
Output : file_name1,a,b,c,d,e,f
file_name2,g,h,i,j,k,l
file_name3,1,2,3,4,5

Thanks In Advance
Best Regards
MAli
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm sure there's a property for this, but can't recall its name. Search the forum - you'll probably find it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mali_aydin
Charter Member
Charter Member
Posts: 6
Joined: Fri May 05, 2006 6:57 am

Post by mali_aydin »

Thanks for your response but I have tried lots of things on Designer and read everthing written in this forum but unfortunately could not find anything solves my request. May be ascential will create patch for this request...

Best Regards
MAli

ray.wurlod wrote:I'm sure there's a property for this, but can't recall its name. Search the forum - you'll probably find it.
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

Is this what you're looking for ...

viewtopic.php?t=96039

J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's the one. :D
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mali_aydin
Charter Member
Charter Member
Posts: 6
Joined: Fri May 05, 2006 6:57 am

Post by mali_aydin »

Hi jhmckeever,
Unfortunately it is not the one I am looking for:((

First solution advice is related to the server job, but mine job is parallel and as far as I know there is no Folder option in PX.

Second solution could not solve it neither
In second solution it says : "The parallel sequential file stage has an optional Option called "File Name Column", it is a varchar column that outputs the name of the file that the record is sourced from. Don't know if it works for file patterns but let us know how it goes. "

But unfortunately it could not solve the problem, I am getting the files in folder and I write only the prefix of file name for example /dir/cdr/file_name* . When I use the file Name Column option it gets the "/dir/cdr/file_name*" not the filename itself.

I still could not find any solution, but hope that we will find in this forum

Best Regards





jhmckeever wrote:Is this what you're looking for ...

viewtopic.php?t=96039

J.
Post Reply