Read text files from a folder

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
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Read text files from a folder

Post by rajeev_prabhuat »

Hi,

I have to read multiple text files from a folder and do the processing with the data present in it, in Server jobs we have folder stage. In Parallel, do we have any stages equivalent to it. If not what is the other option for me to read each file from the folder and process data.

Regards,
Rajeev Prabhu
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Rajeev,

I don't think there is any equivalent in PX for Folder stage. How about using a shared container which contains the server job functionality. The shared container can then be used in your PX job.

--Rich

Be quick to listen, slow to speak and slow to become angry
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You've posted in the Parallel Extender forum.

The Parallel Sequential File stage does indeed have these properties.

Now you're complaining that the same properties are not there in server jobs.

It is NOT THE SAME STAGE TYPE!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rajeev_prabhuat
Participant
Posts: 136
Joined: Wed Sep 29, 2004 5:56 am
Location: Chennai
Contact:

Post by rajeev_prabhuat »

Hi Ray,

That is fine in Parallel there is no folder stage, i am not complainting that there is no folder stage in server jobs.

You mean to say that Sequential stage acts as Folder stage in Parallel Jobs.

Regards,
Rajeev Prabhu
ray.wurlod wrote:You've posted in the Parallel Extender forum.

The Parallel Sequential File stage does indeed have these properties.

Now you're complaining that the same properties are not there in server jobs.

It is NOT THE SAME STAGE TYPE!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

Do you just want the file names, or the contents of those files?

If the former, simply execute the command - perhaps as a before-stage subroutine ExecSH - then use a Sequential File stage to read from the file myfile.txt.

If the latter, and you really are in a parallel job, use the file pattern mechanism outlined earlier.

If you're in a server job you really should have posted on that forum, but you can use the Folder stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balki
Participant
Posts: 6
Joined: Fri Sep 02, 2005 2:50 am

Post by balki »

Hi,

I dont think that we can give wild cards in file pattern option. It can point to a file that contains a list of files which can be used as source provided all the files share the same metadata.

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

Post by ray.wurlod »

Welcome aboard. :D

You can, indeed, use wildcard characters. Read the on-line help.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balki
Participant
Posts: 6
Joined: Fri Sep 02, 2005 2:50 am

Post by balki »

balki wrote:Hi,

I dont think that we can give wild cards in file pattern option. It can point to a file that contains a list of files which can be used as source provided all the files share the same metadata.

Balki
Sorry about this post. Yes wild cards can be used in the file pattern.
Post Reply