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
How to do automated restart when a job abend?
Which dd parameters are required?
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?
by using cond parameter maximum 8 cond can be coded in single cond means ?explain
What parameters can be used to limit the number of records written to a sysout dataset?
why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
What is jcl in mainframe, and how many types of jcl statements are there for a job?
What is multithreading in jcl?
what is the purpose of coding class parameter in job statement?
How can a stopped job be started again?
a dd statement has 2 types of parameters. Name them?
Explain about ISPF/TSO Commands
Explain the jcl exec statement?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?