Sort before a Sequential file

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
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Sort before a Sequential file

Post by RAJARP »

Hi all,
I have got a simple job to review and want to confirm a thing.

Code: Select all

Source 2
 | 
 JOIN-->SORT-->sequential file
 |                                       
Source1
My Understanding:
As the sequential file is not going to maintain the sorting, the 'SORT' stage in front of the seq.file is not required.

Please confirm whether my understanding is correct.

P.S:And also I am very sure that there are no duplicates in either of the sources, so the sort stage is not used to remove duplicates.

Thanks in advance,

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

Post by ray.wurlod »

If you specify a sort/merge collector on the Sequential File stage input link, it will preserve sorted order.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

Hi Ray,

Thanks .

Code: Select all

Source 2 
 | 
 JOIN---->sequential file 
 |                                        
Source1 
Please find that I removed the SORT stage from my earlier design.
Even in this way , we can preserve the sorted order by specifying a sort/merge collector on the Sequential File stage input link,right?


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

Post by ray.wurlod »

Try it. Find out.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

I know that's a lame question anyways... :) My apologies

There is no need of sort stage in front of the sequentail file.All it needs is specifying a sort/merge collector on the Sequential File stage input link.It will preserve the Sort.I tried this as well

Thanks,
Raja R P
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

I think it's a fine question. Considering that the Join stage requires sorted inputs, I don't think you would need a Sort stage following Join stage to begin with, unless you need to resort based on some other key.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply