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 

diff between internal sort and external sort

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


Joined: 17 Aug 2003
Posts: 22
Topics: 18

PostPosted: Tue Feb 03, 2004 12:11 pm    Post subject: diff between internal sort and external sort Reply with quote

What is the difference between internal sort and external sort?

Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Feb 03, 2004 1:56 pm    Post subject: Reply with quote

Buttamvs,

Internal sorts are difficult to maintain and are much slower than the external sort. You need special compile options( FASTSRT) to improve the performance of an internal sort. In an External sort you can use wide variety of features like INREC,OUTREC OUTFIL SUM ... which are not possible in an internal sort. Everytime you change the sort sequence you need to re-compile the program and in general internal sorts are considered as resource hogs.

External sort utility is highly tuned, EXCP driven and consumes very less resources. With the latest features available with DFSORT you don't even need a program.

The only advantage the internal sorts have over the external sorts is that you only have to pass the file once.

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
kok328
Beginner


Joined: 05 Nov 2003
Posts: 19
Topics: 0
Location: MI, USA

PostPosted: Fri Feb 13, 2004 11:56 am    Post subject: Reply with quote

Quote:
The only advantage the internal sorts have over the external sorts is that you only have to pass the file once.


Not exactly true if you know how to use E15 and/or E35 user exits.
Back to top
View user's profile Send private message Send e-mail AIM Address
neilxt
Beginner


Joined: 01 Mar 2004
Posts: 23
Topics: 1

PostPosted: Tue May 11, 2004 5:05 pm    Post subject: Reply with quote

Quote:

Internal sorts are difficult to maintain and are much slower than the external sort. You need special compile options( FASTSRT) to improve the performance of an internal sort. In an External sort you can use wide variety of features like INREC,OUTREC OUTFIL SUM ... which are not possible in an internal sort. Everytime you change the sort sequence you need to re-compile the program and in general internal sorts are considered as resource hogs.


I don't believe any of this to be true.

1. Cobol internal sorts use whatever the default installation sort routine is (i.e. the same as a JCL sort would use) and compile their input and output procedures as e15 and e35 exits to it. Therefore the "one pass less" difference is the only technical difference and operates in favour of the internal sort.

2. Internal sorts make it very easy sometimes to be very, very much more efficient. It is very easy when working in a single program to pick and choose which fields you want in your output and define only those in your sort file.

Program/Sort/Program implimentations require much more planning to avail yourself of this and that planning is generally neglected and the whole record passed around even if only a fraction of it is needed.

3. It is extremely rare for a sort sequence to change without affecting either the selection criteria or the output requirements so protestations that "you only have to change the Sort parameters" are meaningless. In almost all cases all three modules will have to change in carefully co-ordinated fashion and the sum of those three changes is a larger maintenance burden than the single change to the module with an internal sort.
Back to top
View user's profile Send private message Send e-mail
mok
Beginner


Joined: 16 May 2003
Posts: 12
Topics: 0
Location: paris

PostPosted: Fri May 14, 2004 6:32 am    Post subject: Reply with quote

HI all,
Quote:

In an External sort you can use wide variety of features like INREC,OUTREC OUTFIL SUM ... which are not possible in an internal sort

Of course we can use these features if the internal sort uses the USING/GIVING phrase. You just have to pass all the parameter to the JCL using (by default) the DDNAME IGZSRTCD. I use some of these features in production :
Quote:

//IGZSRTCD DD *
OPTION EQUALS
SUM FIELDS=NONE
OUTREC FIELDS=(17,08)
/*

By this way, the only thing remaining in the program is the sort key.
Quote:

sort SORTFIC on ascending key SORTFIC-KEY1 SORTFIC-KEY2
with duplicates in order
using FILEIN
giving FILEOUT
if sort-return not = 0
move sort-return to RETURN-CODE
perform BAD-RETURN-CODE
goback
end-if
Back to top
View user's profile Send private message
neilxt
Beginner


Joined: 01 Mar 2004
Posts: 23
Topics: 1

PostPosted: Fri May 14, 2004 8:36 am    Post subject: Reply with quote

Quote:

By this way, the only thing remaining in the program is the sort key.

OK, now in my defense of the internal sort I have always assumed (and AFAIK it has always been the case) that we were talking about a comparison between a program with an internal sort vs an external sort with one or 2 programs wrapped around it.

If everything you want to do is handled by the sort (and I'm not including report generation in that) then I see no advantage to internal sorts.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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