View previous topic :: View next topic
|
Author |
Message |
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
I tried to sort a file of around 4000 records (LRECL=1800). The sort parameter is
Code: |
SORT FIELDS=(1,80,CH,A)
|
In my input file for some records, the first 80 characters are same. So the expected output was for those records, it should remain the same sequence as it is present in the input fille. But it is sorting the records using the key fields beyond the 80th position. The output came in a different order for those records.
When i added two more sort work files, it is getting correctly populated.
I like to know why it is happening as such. Is it some thing related to size of sort work files.
Thanks in advance.. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
NO....
the sort manuals are clear about it,
when sorting the output order for records with the same sort key is unpredictable
check the sort manuals for the EQUALS option/parameter |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Probably not, I have seen the relative position of sort field records change from run to run.
To preserve the sequence .........
Code: |
SORT FIELDS=(1,80,CH,A),EQUALS |
|
|
Back to top |
|
|
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
Thanks. Will using the EQUALS parameter affect the performance ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
anything that does more processing will affect performance, don' t You think so?
but the requirements are requirements... aren' t they ?
anyway ... for 4000 records
the time You spend meditating about the performance issue
will cost to Your organization more than the cpu cycles needed |
|
Back to top |
|
|
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
Ya. You are right. But just thought of looking is there any other alternatives available. Thanks enrico and expat. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
But just thought of looking is there any other alternatives available |
please explain why You were not satisfied with the answers we gave You...
it will help people who spend their time helping at no charge
to give better answers and raise the customer's satisfaction |
|
Back to top |
|
|
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
I didnt mean that i'm not satisfied. I value your response but the reason for asking me about the performance is that to find whether i can avoid any performance issue if any. |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi Once some else were also having the same kind of problem at that time Arun sugested to add a seqnum to the end and then sort add that to the fields |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Hi Once some else were also having the same kind of problem at that time Arun sugested to add a seqnum to the end and then sort add that to the fields |
wouldn' t sort provided facilities provide better performance ?
add a sequence number at INREC
sort on a longer key
reformat to strip the sequence number at OUTREC
Nahhhh! better let sort do it |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi Enrico,
U r correct according to performance point. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
S.Selvakumar,
The use of EQUALS will most likely not affect performance significantly, but the only way to know for sure is to run your specific job with and without EQUALS in effect and evaluate the performance based on your criteria. As for "alternatives" that would perform better, the answer is most likely there aren't any. |
|
Back to top |
|
|
|