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 can the same proc be re-used and called by many jobs?
For what purpose steplib and joblib are used ?
what is JCL?
What are the jcl procedures?
I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.
How to override loadlib?
What are hierarchy levels in jcl?
WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375
what operation is performed by job statement?
I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one
A dd statement consists of 4 fields. Name them?
Explain how can a jobs execution priority be modified?
Explain the jcl exec statement?
How can an in-stream dataset be terminated?
I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK