Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Two versions of sort card for a single requirement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Two versions of sort card for a single requirement
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: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 20, 2009 1:57 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Nov 20, 2009 1:58 pm    Post subject:
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: 1703
Location: Australia

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

Hi,

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


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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Fri Nov 20, 2009 2:43 pm    Post subject: Reply to: Two versions of sort card for a single requirement
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    Post subject:
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 Moderator


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

PostPosted: Fri Nov 20, 2009 10:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us