View previous topic :: View next topic |
Author |
Message |
jeet007 Beginner
Joined: 16 Sep 2005 Posts: 1 Topics: 1
|
Posted: Fri Sep 16, 2005 8:14 am Post subject: SYNCSORT for records having same value in the Sort Fields |
|
|
I need to sort a particular file on three of it's fields using SYNCSORT. Those three fields may have the same values for a set of records. In the sort result the records that have the same values in the Sort fields are not retaining the sequence as in the Input file.
If I don't use the SORTWK parameter in the JCL the order is maintained but I cannot do away with the SORTWK parameter as the input file may be quite large. |
|
Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Fri Sep 16, 2005 8:24 am Post subject: |
|
|
Jeet007,
This should be in the Utilities forum.
I don't know SYNCSORT that well, but DFSORT will handle this if you specify the EQUALS parameter, and I expect SYNCSORT will too.
Also, I think your input file has to be extremely large before you actually need SORTWK. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Sep 16, 2005 8:26 am Post subject: |
|
|
Jeet07,
Did you read the rules to post in this forum ? Please do not post questions seeking help in this forum.
Check this link for the rules of posting in this forum.
I am moving your question to Utilities forum.
You need to use OPTION EQUALS. EQUALS guarantees that the first of a series of equal-keyed records is either first-in (SORT) or from the lowest numbered SORTINnn data set(MERGE). With NOEQUALS, there is a random element to the order in which records with identical control fields will appear in the output. With or without EQUALS, MERGE preserves the order of equal-keyed records within any one data set.
Code: |
OPTION EQUALS
SORT FIELDS=(...)
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sat Sep 17, 2005 12:15 am Post subject: |
|
|
Jeet07,
Quote: |
but I cannot do away with the SORTWK parameter as the input file may be quite large.
|
This is a wrong assumption that many people have. Actually, its better to let SORT decide the amount of space required for SORTWK parameter. Use OPTION EQUALS as kolusu said. But you can remove the SORTWK DDs from your JCL.
Note: OPTION EQUALS does not work with PARASORT feature provided by syncsort. So, you must use either PGM=SORT or PGM=SYNCTOOL.
Thanks,
Phantom |
|
Back to top |
|
 |
|
|