Explain about Internal Sort

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to do automated restart when a job abend?

791


Which dd parameters are required?

690


How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

717


by using cond parameter maximum 8 cond can be coded in single cond means ?explain

973


What parameters can be used to limit the number of records written to a sysout dataset?

748






why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.

1949


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

669


What is jcl in mainframe, and how many types of jcl statements are there for a job?

631


What is multithreading in jcl?

940


what is the purpose of coding class parameter in job statement?

721


How can a stopped job be started again?

708


a dd statement has 2 types of parameters. Name them?

645


Explain about ISPF/TSO Commands

1309


Explain the jcl exec statement?

647


I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

701