Funnel Clarification

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
poornima.chandramouli
Participant
Posts: 42
Joined: Wed Dec 26, 2007 1:58 am
Location: India

Funnel Clarification

Post by poornima.chandramouli »

Hi,

I've 4 inputs to a funnel stage.

Each input dataset has values like

DS1: DS2: DS3: DS4:
A1 A2 A3 A4
B1 B2 B3 B4
C1 C2 C3 C4
D1 D2 D3 D4

I want the output in the format

A1
B1
C1
D1
A2
B2
C2
D2
A3
B3
C3
D3
A4
B4
C4
D4

How to avial this functionality.

Thanks
Regards
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

If you set the funnel type to "Sequence" it should give you the desired output.
It copies all the records from the first input link, and then all the records from the second input link and so on....
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
poornima.chandramouli
Participant
Posts: 42
Joined: Wed Dec 26, 2007 1:58 am
Location: India

Post by poornima.chandramouli »

Minhajuddin wrote:If you set the funnel type to "Sequence" it should give you the desired output.
It copies all the records from the first input link, and then all the records from the second input link and so on....

My Datasets has the values like

DS1:
A1
B1
C1
D1


DS2:
A2
B2
C2
D2


DS3:
A3
B3
C3
D3


DS4:
A4
B4
C4
D4



I want the output like

A1
A2
A3
A4
B1
B2
B3
B4
C1
C2
C3
C4
D1
D2
D3
D4


But sequential funnel doesn't give these kind of results.

Awaiting for ur reply
Regards
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Any chance of telling us what results you did get?
dsean
Participant
Posts: 22
Joined: Thu Feb 09, 2006 12:52 pm

Post by dsean »

Use the Sort Funnel type and specify the first column as a Key.

Sequential Funnel combines the data sequentially from the first file , then the second file and so on.


Sean
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

A funnel will not do what you are trying to do. A funnel combines data streams with exactly same column names. Yours are not. Even if they were, a funnel would not do what you are trying to do.

Send all 4 datasets to a copy stage. On the Output tab, drag all columns from the 4 datasets into the sequence that you want.
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Use Sorted Funnel

Post by swapnilverma »

Use sort method in funnel.

or else use a sort after the funnel.

Both will give u the desired result.
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

If I am not wrong the OP at first wanted the data to be collected from each link and dump the output on the output link i.e. take the data from the first input link and dump it on the output link then do the same for the second, third and fourth links.

And then the "requirement" has changed, Now the OP wants to collect data from links in a "round-robin" fashion. Unfortunately there is no mode in the Funnel stage which allows you to do this.

If you really want this kind of collection, your solution depends on what you are trying to funnel (two sequential files, two datasets or two links from some kind of stages).

The dumbest solution would be:

Code: Select all


ip_link1=====>Transformer==========LINK_TO_FUNNEL1============>
		(Generate a key (say, col "X")
		and a constant '1' (say, col "Y"))		

ip_link2=====>Transformer==========LINK_TO_FUNNEL2============>
		(Generate a key (say, col "X")
		and a constant '2' (say, col "Y"))		
							======>Funnel====>Sort on the generated key (Column 'X')and the constant (column 'Y')
ip_link3=====>Transformer==========LINK_TO_FUNNEL3============>
		(Generate a key (say, col "X")
		and a constant '3'(say, col "Y"))		

ip_link4=====>Transformer==========LINK_TO_FUNNEL4============>
		(Generate a key (say, col "X")
		and a constant '4'(say, col "Y"))		

And instead of using Transformers you can use Column generators and the generated key should start from the same value in all the transformers.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
Post Reply