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

i want to avoid the positional parameter how to code it ?

3 Answers   TCS,


How do you handle empty files in a JCL ?

3 Answers   Wipro, Xansa,


Can we use DISP=SHR in output file in JCL

0 Answers  


What do you know about jcl?

0 Answers  


JCL Example: // //RUNJCL JOB CLASS=5,MSGCLASS=6,NOTIFY=&SYSUID //STEP01 EXEC PGM=IEFBR14 // .. .. If this JCL will run or it'll throw the ERROR?

4 Answers   HCL,






Is there any command to check wether the ps file is in sorted order?

4 Answers  


In Job, there are 10 steps. If I want to execute the first 6 steps and don't want to execute from 7th to 10th step. What is the solution for this ?

7 Answers  


Is acct parameter mandatory?

0 Answers  


Is CPU time (TIME parameter) assigned to a JOB and JOBSTEP BOTH, by default ?

6 Answers   IBM,


How to search strings in multiple dataset with conditions 'string1 & string2'?

1 Answers   IBM,


how do you access an uncataloged dataset in a jcl?

0 Answers   IBM,


how many max steps can we use in a job? pls answer to my question

9 Answers   TCS,


Categories