IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Two versions of sort card for a single requirement


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Fri Nov 20, 2009 1:51 pm
Reply with quote

I have an input file which needs to be sorted based on 4 key fields.
field A Start Pos = 31 Len=8
field B Start Pos = 39 Len=15
field C Start Pos = 54 Len=8
field D Start Pos = 62 Len=3

I have coded the sort card as below:
Code:
SORT FIELDS=(31,8,CH,A,39,15,CH,A,54,8,CH,A,62,3,CH,A)


since the sort fields are contiguous can i code the sort card as:
Code:
SORT FIELDS=(31,34,CH,A)


If yes, will there be any change in performance?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 20, 2009 1:57 pm
Reply with quote

Why not try it for yourself and see what happens.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Nov 20, 2009 1:58 pm
Reply with quote

Hi,

you should try it out and compare the results.


Gerry
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Nov 20, 2009 2:21 pm
Reply with quote

Hi,

see this ibmmainframes.com/viewtopic.php?t=27928&highlight


Gerry
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 20, 2009 2:43 pm
Reply with quote

Frank or Kolusu will without doubt give the best answer

but a bit of creative speculation should not hurt anybody...

from a <general> algorithmic point of view for a monotone sort ( all ascending/descending keys )
You would need to build a full key concatenating all the subkeys
in this case defining one big key instead of 4 subkeys would save three <move> instruction

but (and we' ll never know about it ) the internal sort logic (undisclosed / patented)
might optimize the building of strings of records by using the subkey structure

but then somebody would have come along with the suggestion to arbitrarily separate in subkeys a long key

to conclude based on <common> logic the performance difference should be irrelevant and even not measurable

anyway let' s wait for the answer from the people who know better
-- still I would like to know if I am completely wrong or not icon_wink.gif

PS.
from a theoretical point of view the complexity of a sorting algorithm could be defined as O(f(N) + N) where
f() depends on the problem complexity itself, something like N*log(N) -- usually
the other component is N ( related only to the number of records )
in the above case, building the full key, and usually the N part is ... ignored
Back to top
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Fri Nov 20, 2009 2:44 pm
Reply with quote

THanks for the directions. got a clear explanation given by frank:
Quote:

I wouldn't expect it to make any difference for DFSORT as we combine contiguous fields internally when possible as in this case.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Nov 20, 2009 10:14 pm
Reply with quote

Quote:
I have coded the sort card as below:

SORT FIELDS=(31,8,CH,A,39,15,CH,A,54,8,CH,A,62,3,CH,A)


since the sort fields are contiguous can i code the sort card as:

SORT FIELDS=(31,34,CH,A)


Yes.

Quote:
If yes, will there be any change in performance?


Probably not. But the best way to find out is to try it yourself with your own data and judge by your own criteria for "performance".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top