MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SYNCSORT for records having same value in the Sort Fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
jeet007
Beginner


Joined: 16 Sep 2005
Posts: 1
Topics: 1

PostPosted: Fri Sep 16, 2005 8:14 am    Post subject: SYNCSORT for records having same value in the Sort Fields Reply with quote

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
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Sep 16, 2005 8:24 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Sep 16, 2005 8:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Sat Sep 17, 2005 12:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group