You can arrange records in a particular sequence by using a SORT or MERGE statement. You can mix SORT and MERGE statements in the same COBOL program.
A program can contain any number of sort and merge operations. They can be the same operation performed many times or different operations. However, one operation must finish before another begins.
With Enterprise COBOL, your IBM licensed program for sorting and merging must be DFSORT™ or an equivalent. Where DFSORT is mentioned, you can use any equivalent sort or merge product.
COBOL programs that contain SORT or MERGE statements can reside above or below the 16-MB line.
The steps you take to sort or merge are generally as follows:
Restrictions:
related concepts
Sort and merge process
related tasks
Describing the sort or merge file
Describing the input to sorting or merging
Describing the output from sorting or merging
Requesting the sort or merge
Determining whether the sort or merge was successful
Stopping a sort or merge operation prematurely
Improving sort performance with FASTSRT
Controlling sort behavior
DFSORT Application Programming Guide
related references
CICS SORT application restrictions
SORT statement (Enterprise COBOL Language Reference)
MERGE statement (Enterprise COBOL Language Reference)