how to read all files from one directory ?

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
kaushal.kumar@igate.com
Participant
Posts: 77
Joined: Tue Apr 14, 2009 4:03 am

how to read all files from one directory ?

Post by kaushal.kumar@igate.com »

Hi,
Do we have any stage in DS parallel job,which can read all file from one directory ( example load ). My requirement is to read all files from directory ,files are fix width length files .I have to pick all files using one job then in intermediate stage i have one refrance table ( which has field defination of all files)by using which i have to bind the data with field name and put it into different table.

I want to know do we have any satge in Ds in parallel job which can read multiple files from same directory in single job (* number of files may changed in next run).

Please help me :?
[/img]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sequential File stage.

Method 1: File Pattern of *

Method 2: Filter command of something like type *

Method 3: Filter command to run script that outputs contents of all files in directory onto stdout.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kaushal.kumar@igate.com
Participant
Posts: 77
Joined: Tue Apr 14, 2009 4:03 am

Post by kaushal.kumar@igate.com »

ray.wurlod wrote:Sequential File stage.

Method 1: File Pattern of *

Method 2: Filter command of something like type *

Method 3: Filter command to run script that outputs contents of all fil ...
Thanks,
in Sequential File stage. Method 1: File Pattern of * Method ..---- if i will go for this metod can we get file name as one column and all records in another column.

Please advice
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes you can get the stage to populate a column with the File Name (and another with the line number). How it reads (parses) the files is up to you and the metadata (table definition or schema file) that you provide.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply