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
What is the function of a dd statement?
Explain the function of the dd dcb keyword?
My Question is 1. How to cound no. of records in JCL. Please explain with an example. 2. How to execute only odd steps in JCL? I know EDIT TYPE = Inculde, Step Name = 1,3,5 and COND code for all even step. Anyone knows other than this.
how to do automated restart when a job abends?
how do you access an uncataloged dataset in a jcl?
How to submit jcl through a cobol program?
What do you understand by jcl?
Can I send output of job to my remote device careerride123?
Explain the function of //cntl statement?
what is DD statement is used in JCL?
The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
Explain in DD statement what is the use of DCB parameter?
what EXEC statement is and what is the syntax of EXEC statement used in JCL?
by using cond parameter maximum 8 cond can be coded in single cond means ?explain
What is the maximum length of a single line of jcl?