Page 1 of 1

Join two sequential files in to one file

Posted: Tue May 13, 2008 2:33 pm
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.

Posted: Tue May 13, 2008 4:39 pm
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?

Posted: Tue May 13, 2008 7:39 pm
by kommven
Be more specific

Posted: Tue May 13, 2008 7:43 pm
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.

Posted: Tue May 13, 2008 7:45 pm
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.

Posted: Tue May 13, 2008 8:08 pm
by Minhajuddin
You can use the Funnel stage in Parallel jobs to achieve this.

Posted: Wed May 14, 2008 2:27 am
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.

Posted: Wed May 14, 2008 10:19 pm
by Minhajuddin
Try changing the type to Continuous Funnel. This may give you the desired output.

Posted: Thu May 15, 2008 1:15 pm
by kommven

Posted: Thu May 15, 2008 1:16 pm
by Hope
That doesn't work too :(

Posted: Thu May 15, 2008 3:24 pm
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.