What is the difference between internal and external sort?
What is the difference between internal and external sort?
Hello,
Can anybody tell what's the difference between internal and external sort and when to use which one?
Can anybody tell what's the difference between internal and external sort and when to use which one?
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is the difference between internal and external sor
Internal sort is invoked within a program while an external sort invokes the SORT program directly (through JCL, for example). Follow site standards as to which to use -- internal sort uses more resources (language overhead) but is used fairly often for convenience.
Re: What is the difference between internal and external sor
That means if I call the SORT from COBOL program it's "internal sort" and while in JCL PGM=SORT is "external SORT", right? Are there any difference in them that way, I mean can I call one SORT program in internal and another SORT in external? And why the name "internal/external"?
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is the difference between internal and external sor
The same SORT program is invoked for internal and external sorts -- COBOL merely links to the system SORT program when you perform an internal sort. There is slightly more overhead to internal sorts due to the language processing involved, but these days it would be unusual to see any differences unless you are doing a very small sort, or you look at the SMF data to get CPU time to the millionths of a second. The internal and external are in reference to the program -- inside the program (SORT verb) or outside (JCL SORT).
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: What is the difference between internal and external sor
COBOL has a SORT verb (and a MERGE). It is up to the implementer (IBM in this case) as to how this is implemented.
I don't know if it has been always, but it seems like forever that IBM has implemented it by using the installed SORT product, which makes a lot of sense. I suspect all COBOL implementations do it in an equivalent way (at least to the extent of not implementing compiler code to do the SORT/MERGE).
There are differences between the two as far as performance is concerned. Have a look at compiler option FASTSRT in the Enterprise COBOL manuals. Also consult you SORT documentation. There is a big difference between SORT doing I/O and COBOL doing it. There is also an overhead in transfer of control to/from SORT.
I don't know if it has been always, but it seems like forever that IBM has implemented it by using the installed SORT product, which makes a lot of sense. I suspect all COBOL implementations do it in an equivalent way (at least to the extent of not implementing compiler code to do the SORT/MERGE).
There are differences between the two as far as performance is concerned. Have a look at compiler option FASTSRT in the Enterprise COBOL manuals. Also consult you SORT documentation. There is a big difference between SORT doing I/O and COBOL doing it. There is also an overhead in transfer of control to/from SORT.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: What is the difference between internal and external sor
To add to the replies from Robert and William, yes you got this correct:
Dino wrote:That means if I call the SORT from COBOL program it's "internal sort" and while in JCL PGM=SORT is "external SORT", right?
You should note that if you call it internally or externally, the same SORT product will get invoked. It's very rare that you'll find a site where both (or more) SORT products are installed, however, the possibility of having more than one SORT can not be ruled out though - I observed this only at a site where they were migrating from one SORT product to another and kept the one SORT product in a different library to cross check the changes.Are there any difference in them that way, I mean can I call one SORT program in internal and another SORT in external? And why the name "internal/external"?
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute