The ON ASCENDING KEY NAME clouse has always been used by the COBOL to sort data from one or more data base file. It’s simple and easy to use and runs faster than any of other languages.
For example, we had to do this:
ON ASCENDING KEY NAME
If you wanted to be able to sort the data both ways in the same program (i.e., both ascending and descending), you had to do a bit of fooling around. For example :
ON ASCENDING KEY FIELD_NAME .
USING FILE_NAME .
And we can also perform Descending order use simple line. For example:
ON DESCENDING KEY FIELD_NAME .
USING WORK_FILE_NAME .