Sort Data in File

In COBOL, How to sort data in a file without using the sort command?

Questions by ravtej556

Showing Answers 1 - 2 of 2 Answers

Move all the records to array table.
then compare with each other,then swap that two records.
like IF ARRAY(I) > ARRAY(J)
MOVE I TO WS-DATA
MOVE J TO I
MOVE WS-DATA TO J
ELSE
COMPUT I = I + 1
PERFOEM SAME PARA UPTO FS = 10

  Was this answer useful?  Yes

mannurusrinivasulareddy

  • Oct 5th, 2011
 

Ws-rec is an occurs clause variable name.

Code
  1.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions