View previous topic :: View next topic |
Author |
Message |
butta_mvs Beginner
Joined: 17 Aug 2003 Posts: 22 Topics: 18
|
Posted: Tue Feb 03, 2004 12:11 pm Post subject: diff between internal sort and external sort |
|
|
What is the difference between internal sort and external sort?
Ramesh |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Tue Feb 03, 2004 1:56 pm Post subject: |
|
|
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 |
|
|
kok328 Beginner
Joined: 05 Nov 2003 Posts: 19 Topics: 0 Location: MI, USA
|
Posted: Fri Feb 13, 2004 11:56 am Post subject: |
|
|
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 |
|
|
neilxt Beginner
Joined: 01 Mar 2004 Posts: 23 Topics: 1
|
Posted: Tue May 11, 2004 5:05 pm Post subject: |
|
|
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 |
|
|
mok Beginner
Joined: 16 May 2003 Posts: 12 Topics: 0 Location: paris
|
Posted: Fri May 14, 2004 6:32 am Post subject: |
|
|
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 |
|
|
neilxt Beginner
Joined: 01 Mar 2004 Posts: 23 Topics: 1
|
Posted: Fri May 14, 2004 8:36 am Post subject: |
|
|
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 |
|
|
|
|