Reading Multiple DataSets using File Pattern

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
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Reading Multiple DataSets using File Pattern

Post by Nagin »

Hi,
Is there a way to read multiple DataSets with similar pattern in a single stage?

For example, I have multiple datasets with same metadata and same partitioning.

TestData_1.ds
TestData_2.ds
TestData_3.ds

I would want to pick up all these datasets TestData_*.ds like we can do for flat files.

I dont see a pattern option in DataSet stage. Is there any way to achieve this?

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

Post by ray.wurlod »

No. Use separate Data Set stages and run them into a Funnel 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.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post by Nagin »

ray.wurlod wrote:No. Use separate Data Set stages and run them into a Funnel stage.
The problem I have is I wouldn't know how many DataSets will be there. They will be generated dynamically. Today I may have 10 DataSets tomorrow it could be 20.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The answer is still no.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

Nagin wrote:
ray.wurlod wrote:No. Use separate Data Set stages and run them into a Funnel stage.
The problem I have is I wouldn't know how many DataSets will be there. They will be generated dynamically. Today I may have 10 DataSets tomorrow it could be 20.
Replace the dataset with sequential file as the target stage in the job that creates the Dataset(dynamic)
RAJ
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Post by meet_deb85 »

Well, I faced the same challenge but i could do it in the following way.

You will need to have one common sequence job and a parallel for this

Parallel job
Datastet1 -------------------->>>Dataset2
Parameterize the Dataset name in the Dataset 1 and put any name of your choice in Dataset2

Sequence Job
I am mentioning only the first two stages, the rest I guess you will be able to fogure out
Stage 1 - Execute command, put this command in the stage -
orchadmin truncate #Name of the Dataset used in Dataset2 of the parallel job#

Stage 2- Execute command, put this command in the stage:-
ls #The pattern of your Datasets#

Stage 3- Start Loop
and run the loop as many times as the number of datasets you have figured out in Stage 2

Don't forget to keep append mode in the Dataset-2 of the parallel job.
Post Reply