How do you sort in a COBOL program? Give sort file
definition, sort statement syntax and meaning.

Answer Posted / kavya

As he told above we need to specify the sort-file in sd
entry.
But syntax is as follows,

SORT SORT-FILE ON ASCENDING/DESCENDING KEY
USING INPUT-FILE
GIVING OUTPUT-FILE.

We have to specifies the key to sort.
INPUT-FILE is the file to sorted.The sorted OUTPUT is sent
to the OUTPUT-FILE.

Is This Answer Correct ?    34 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

For rewrite, why is it mandatory that file needs to be opened?

616


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

700


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

810


How arrays can be defined in COBOL?

658


How do you differentiate between cobol and cobol-ii?

647






How you can characterize tables in cobol?

709


Whats the difference between search & search ALL?

5244


what happens if parmparameter passes zero bytes to the program

1653


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1896


What is the Purpose of POINTER Phrase in STRING command in COBOL?

711


What are the different data types in cobol?

785


What is the usage of comp fields in cobol?

649


What is comp-1 and comp-2?

755


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

1865


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

728