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 

Batch pipes and DFSORT
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 02, 2010 11:08 am    Post subject: Reply with quote

RonB wrote:
Just out of curiosity, why did you add the EQUALS parameter to the last sort statement, and remove it from the first sort statement?


EQUALS is the DEFAULT option with SELECT operator of DFSORT. So you really don't have to code it.

RonB wrote:
But there was no such requirement to keep the EQUALS order in the third sort (input to the last step ).


I thought just in case if OP needs to retain the original order of the duplicates if any. I usually go by the notion that there WILL be duplicates when you sort and the order IS always important. If the order is not important or he doesn't have duplicates, OP can get rid of EQUALS option on CTL2 DD

For SORT operator , EQUALS is NOT default
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Thu Sep 02, 2010 12:03 pm    Post subject: Reply with quote

kolusu wrote:
EQUALS is the DEFAULT option with SELECT operator of DFSORT. So you really don't have to code it.


Does that mean that the SELECT operator somehow knows what ALL of the SORT fields are ( not just the ON(...) portion ) and causes the SORT operation to apply EQUALS across the board?
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Sep 02, 2010 12:18 pm    Post subject: Reply with quote

SELECT calls DFSORT to sort the records according to the ON fields. If you override the SORT statement used for the DFSORT call, DFSORT uses that SORT statement and applies EQUALS to all of the fields. Note that if you do override the SORT statement, it must start with the SORT statement generated by SELECT for the ON fields. SELECT also compares the sorted records, but only by the ON fields.

Code:

  SELECT FROM(INDD) TO(TMP1) ON(1,30,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
  SORT FIELDS=(1,30,CH,A,397,26,CH,D)


ICETOOL calls DFSORT with the following control statements based on the ON field:

Code:

   OPTION EQUALS
   SORT FIELDS=(1,30,CH,A)


However, the SORT statement in CTL1CNTL overrides that SORT statement, so DFSORT actually uses:

Code:

  SORT FIELDS=(1,30,CH,A,397,26,CH,D)


Note that 397,26,CH,D has been added to the SORT statement so DFSORT sorts by the 1,30,CH,A field and then by the 397,26,CH,D field. EQUALS is in effect because ICETOOL passed it to DFSORT.

After the records are sorted by 1,30,CH,A,397,26,CH,D, ICETOOL does the SELECT processing against them by comparing each pair of records using the ON field - 1,30,CH.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Thu Sep 02, 2010 12:29 pm    Post subject: Reply with quote

That 'splains it. Thanks, Frank, and Kolusu.
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Fri Sep 03, 2010 6:15 am    Post subject: Reply with quote

Hi All,

Thanks everyone for the insight into ICETOOL and DFSORT. I am still testing the solution. I will keep everyone posted about the progress.
Back to top
View user's profile Send private message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Fri Sep 10, 2010 1:22 pm    Post subject: Reply with quote

Hi All,

I have completed the testing and the fine tuning suggested by all of you have helped us save more than 50% of the elapsed time. This is indeed great. I would like to thank all of you for devoting time to this issue.

For the benefit of others, I have used the code as suggested by Kolusu/Frank.

Regards
Cobcurious
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Sep 10, 2010 2:47 pm    Post subject: Reply with quote

That's good news. Thanks for taking the time to provide feedback.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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