Page 1 of 1

Sequence - incase of a duplicate key

PostPosted: Wed Apr 15, 2009 8:59 pm
by swaroopag
Hi..

I would like to know how the record might get sorted if the keys on which we are sequencing are duplicates..

Im using sequence control statement while writing the records into output file.
When the key is duplicate, the records are not output in the order they appear in the input file.
They are still getting sorted based on some field, of which Im not sure..

Anyone has got any idea on this?

Appreciate your help..

Re: Sequence - incase of a duplicate key

PostPosted: Thu Apr 16, 2009 1:05 am
by dick scherrer
Hello,

Typically, when records are sorted, the only guaranteed sequence is the sort key(s).

If you want the sorted output to be in the same order as the input within the sorted key, you need to devine an additonal field to use as a sequence number or you need to make sure the sort option EQUALS is set.

Ask whoever supports your sort product how to set EQUALS if you do not want to use a sequence number.