Keylink Software Solution Specialists
How to treat equal-keyed records in SyncSort UNIX
How to treat equal-keyed records in SyncSort UNIX
Posted by:Steve | Fri 23 November 2007

Here’s one to remember:

Let’s say you’re designing a sort job for SyncSort Unix, where you want to sort on 3 key fields:

     cust_id, trans_date, trans_amount

What happens when all three key fields contain the same value?

SyncSort makes extensive use of parallel-processing - splitting up the overall job into lots of little jobs that run at the same time then get reassembled for the final output. With the default settings there is no guarantee which order equal-keyed records will appear in the output file.

For many applications this is ok, but sometimes you need the record order to be maintained, for example where the downstream application contains logic like: where the records have equal keys, choose the first one from the list to process.

This is when you should specify the /STABLE option to maintain the order of equal-keyed records. But be aware that keeping track of record order incurs a small performance overhead, so don’t add this option if you don’t need to.

 

Add a Comment

Fields marked with an * are required




* Indicates a required field