GeekInterview.com
Series: Subject: Topic:
Question: 180 of 232

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc?

An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.
Asked by: Interview Candidate | Asked on: Sep 29th, 2004
Showing Answers 1 - 10 of 10 Answers
praleo

Answered On : Jul 12th, 2006

External sort is performed by SORT pgm. Internal sort gives you data handling flexibility and it takes less secondary memory. For huge Volume of files it's better to use internal sort else large amount of space will be required in external sort. any comments...? 

Yes  1 User has rated as useful.
  
Login to rate this answer.
bala_alias

Answered On : May 11th, 2007

View all answers by bala_alias

External sorting is used to refer to the sorting of huge volumes of data where the available main memory is not enough to handle the data. internal sorting is used for small volumes of data..  ext sorting is mostly less efficient

  
Login to rate this answer.
neha

Answered On : Oct 4th, 2007

1. Internal sort is used in COBOL application prog while external sort is used in JCL.2. Internal sort uses workfiles while external sort uses the DFSORT mechanism.3. External sort is more complicated than internal sort.4. Internal sort is more flexible as we can alter or update data before  and after performing internal sort whereas the same doesn't hold true for external sort.Thanks Neha

Yes  2 Users have rated as useful.
  
Login to rate this answer.
lfrank

Answered On : Jan 8th, 2008

View all answers by lfrank

This has long been a question as it relates to efficiency. The answer really depends on how much data needs to be sorted. The internal sort is simply an invocation of the same SORT utility that is JCL initiated (external sort).When you run an external sort, the entire address space is dedicated to the sort process. This means that, outside the sort program itself, all of the storage is used for buffers for the sort strings.With an internal sort, less storage is available to the sort since the application program and any other elements (DB2, MQ, etc.) take up some of that storage.If the amount of data is small, the difference in available storage is insignificant. The sort will run just as fast. In fact, doing all the work in a program can be more efficient because the JCL allocation/deallocation steps are done once instead of once for the sort step and once for the program step.

  
Login to rate this answer.
mouliswar2000

Answered On : Mar 27th, 2008

View all answers by mouliswar2000

An external sort is not COBOL; it is performed through JCL and PGM=SORT.  It is understandable without any code reference.  An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing;  2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.

  
Login to rate this answer.
vukoti1229

Answered On : Jun 16th, 2008

View all answers by vukoti1229

Whenever you are going to manipulate any records befor sorting we are going for Internal sort..If we dont have anything to manipulate we will go for external sort.....

  
Login to rate this answer.
Rinkoj

Answered On : Jul 29th, 2008

View all answers by Rinkoj

COBOL sort is external sort as it requires workfile to store intermediate sort data.Syntax:SORT WORKFILE KEY IS EMP_NO USING INFILE GIVING OUTFILE.INFILE  -- Input fileWORKFILE -- Intermediate file where sort data will be storedOUTFILE  -- completely sorted file.

  
Login to rate this answer.
vengangaboy

Answered On : Dec 8th, 2008

View all answers by vengangaboy

Basically following is the difference between internal sort & external sort-The internal sorting can reside in main memory, external use secondary memory, i.e. work files.-Internal sorting is independent of time to read/write a record, external ids dependent on the same because of secondary memory usage.-Internal sorting takes input only which can be fit into its memory, i.e. it takes small input,
whereas external sorting can take as much as large input.

Yes  1 User has rated as useful.
  
Login to rate this answer.
memays

Answered On : Apr 30th, 2009

View all answers by memays

Actually, Internal and External sort execute the same program (SORT) and utilize the same workfiles.  The difference is in how the I/O is performed.  External sort utilizes it's own I/O routines, whereas Internal sort utilizes COBOL's I/O, and uses an "Exit" (E15/E35) to pass the data to/from the SORT program.

  
Login to rate this answer.
jzmoonrock56

Answered On : Aug 31st, 2011

View all answers by jzmoonrock56

The argument is that external sorts are much more efficient but in reality it doesn't matter because of the speed of todays machines.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.