Explain about Internal Sort



Explain about Internal Sort..

Answer / dimpy19

SORT work-file ON ASCENDING KEY rec-key1
[ON DESCENDING KEY rec-key2]
USING input-file GIVING output-file.


Input file - is the file which we have to sort either in ascending or descending order.

Work file - is used to hold records while the sort process is in progress.
Input file records are transferred to the work file for the sorting process.
This file should be defined in the File-Section under SD entry.

Output file - is the file which we get after the sorting process.
It is the final output of the Sort verb.


SORT performs the following operations -

1. Opens work-file in I-O mode, input-file in the INPUT mode and output-file in the OUTPUT mode.
2. Transfers the records present in the input-file to the work-file.
3. Sorts the SORT-FILE in ascending/descending sequence by rec-key.
4. Transfers the sorted records from the work-file to the output-file.
5. Closes the input-file and the output-file and deletes the work-file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

Explain the function of dd name parameter with a 2 part structure; audit.report?

0 Answers  


what is the purpose of SYSOUT parameter in the DD statement?

1 Answers  


How many extents are possible for a sequential file ? For a VSAM file ?

3 Answers  


If your job fails at particular step then what would be the return code for next steps

3 Answers   ADP,


hi guys what r the diff types of procs in jcl? bye ramya

4 Answers   ACS, Keane India Ltd,






Hi, all suppose i have 5 steps (S1,S2,S3,S4,S5) what will happen if cond is true or false (which of the other steps get executed)? 1) //s3 exec pgm=abc,cond=(0,le) 2) //s3 exec pgm=abc,cond=(0,le,step2) 3) In the jobcord RESTART=step3,cond=(0,le) 4) can i code COND=TRUE in jobcard, if yes what will happen?

3 Answers   TCS, Tech Mahindra,


What is a COND parameter in JCL?

10 Answers   TCS,


What are three parameters you can specify on Job statement as well as on exec stmt ?

1 Answers  


Is there a limit of 3273 DD statements for a JCL or for every EXEC step in a JCL?

2 Answers  


My JCL contains four steps //STP1 A(+1), DISP = NEW //STP2 A(+2), DISP = NEW //STP3 A(+3), DISP = NEW //STP4 A(+1), DISP = OLD STP3 was abended and I want restart my JCL from STP3 onwards & what are the precaution I want to take & what are the changes I need to make. Pls let me know.

4 Answers   CTS,


what is XSUM in some fields= none, xsum ??

7 Answers   Xansa,


i have 1000 records in input file and i want to sort it and the first 200 records to be placed in output file. how to do that??

14 Answers   L&T,


Categories