Join two sequential files in to one file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Join two sequential files in to one file

Post by Hope »

I have 2 sequential files each file has 100 records and I am writing it to a sequential file.This file will have 200 records.
Seq file 1 has records Col1 col2 col3 ........col n
10 .... .... ......
10 .... .... ......
10 .... .... ......
10 .... .... ......

Seq file2 has records Col1 col2 col3 ........col n
20 .... .... ......
20 .... .... ......
20 .... .... ......
20 .... .... ......

Now I want the output for Target as Col1 col2 col3 ........col n
10
20
10
20
10

How can I achieve this in PX.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not clear from your description. Do you want to select rows alternately from each of the two source files? Are there any other constraints that you haven't included? Are the source files guaranteed to have the same number of rows as the other?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

Be more specific
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

Yes I want to select rows alternately from each of the two source files. there are no constraints included and the source files guaranteed to have the same number of rows as the other.The two sources have same number of records.I want to collect one record from each of the file alternately like the Round robin.I know that I can achieve this in server job using the Link collector stage.But not sure how to achieve this in parallel jobs.
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

Yes I want to select rows alternately from each of the two source files. there are no constraints included and the source files guaranteed to have the same number of rows as the other.The two sources have same number of records.I want to collect one record from each of the file alternately like the Round robin.I know that I can achieve this in server job using the Link collector stage.But not sure how to achieve this in parallel jobs.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

You can use the Funnel stage in Parallel jobs to achieve this.
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>
Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

I did use the funnel stage but I dont get the records in the expected way.I get all 10's together and 20's together.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Try changing the type to Continuous Funnel. This may give you the desired output.
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>
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

Hope
Participant
Posts: 97
Joined: Sun May 13, 2007 2:51 pm
Contact:

Post by Hope »

That doesn't work too :(
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Then why is this thread in Server form?
If you have data in any sorted order, do a sort again based on the same file after funnel.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply