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
 

 

Different behaviour of sort jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Thu Nov 05, 2009 12:54 pm    Post subject: Different behaviour of sort jcl
Reply with quote

Hi,

I tried to sort a file of around 4000 records (LRECL=1800). The sort parameter is
Code:

SORT FIELDS=(1,80,CH,A)


In my input file for some records, the first 80 characters are same. So the expected output was for those records, it should remain the same sequence as it is present in the input fille. But it is sorting the records using the key fields beyond the 80th position. The output came in a different order for those records.

When i added two more sort work files, it is getting correctly populated.

I like to know why it is happening as such. Is it some thing related to size of sort work files.

Thanks in advance..
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 05, 2009 1:05 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

NO....
the sort manuals are clear about it,
when sorting the output order for records with the same sort key is unpredictable

check the sort manuals for the EQUALS option/parameter
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: Thu Nov 05, 2009 1:07 pm    Post subject:
Reply with quote

Probably not, I have seen the relative position of sort field records change from run to run.

To preserve the sequence .........
Code:

  SORT FIELDS=(1,80,CH,A),EQUALS
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Thu Nov 05, 2009 1:10 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

Thanks. Will using the EQUALS parameter affect the performance ?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 05, 2009 1:20 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

anything that does more processing will affect performance, don' t You think so?

but the requirements are requirements... aren' t they ?

anyway ... for 4000 records
the time You spend meditating about the performance issue
will cost to Your organization more than the cpu cycles needed icon_biggrin.gif
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Thu Nov 05, 2009 1:26 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

Ya. You are right. But just thought of looking is there any other alternatives available. Thanks enrico and expat.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 05, 2009 2:11 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

Quote:
But just thought of looking is there any other alternatives available


please explain why You were not satisfied with the answers we gave You...
it will help people who spend their time helping at no charge
to give better answers and raise the customer's satisfaction icon_evil.gif
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Thu Nov 05, 2009 2:41 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

Hi,

I didnt mean that i'm not satisfied. I value your response but the reason for asking me about the performance is that to find whether i can avoid any performance issue if any.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Thu Nov 05, 2009 3:18 pm    Post subject:
Reply with quote

Hi Once some else were also having the same kind of problem at that time Arun sugested to add a seqnum to the end and then sort add that to the fields
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 05, 2009 3:33 pm    Post subject: Reply to: Different behaviour of sort jcl
Reply with quote

Quote:
Hi Once some else were also having the same kind of problem at that time Arun sugested to add a seqnum to the end and then sort add that to the fields


wouldn' t sort provided facilities provide better performance ?

add a sequence number at INREC
sort on a longer key
reformat to strip the sequence number at OUTREC

Nahhhh! icon_biggrin.gif better let sort do it
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Thu Nov 05, 2009 3:35 pm    Post subject:
Reply with quote

Hi Enrico,
U r correct according to performance point.
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: Thu Nov 05, 2009 11:33 pm    Post subject:
Reply with quote

S.Selvakumar,

The use of EQUALS will most likely not affect performance significantly, but the only way to know for sure is to run your specific job with and without EQUALS in effect and evaluate the performance based on your criteria. As for "alternatives" that would perform better, the answer is most likely there aren't any.
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
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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