The SORT statement creates a sort file by executing input procedures or
transferring records from an input file. It sorts the records in the
sort file using one or more keys that you specify. Finally, it returns
each record from the sort file, in sorted order, to output procedures
or an output file.
Format -
SORT sortfile { ON { ASCENDING } KEY { sortkey } ... } ...
{ { DESCENDING } }
[ WITH DUPLICATES IN ORDER ]
[ COLLATING SEQUENCE IS alpha ]
{ INPUT PROCEDURE IS first-proc [ { THRU } end-proc ] }
{ [ { THROUGH } ] }
{ USING { infile } ... }
{ OUTPUT PROCEDURE IS first-proc [ { THRU } end-proc ] }
{ [ { THROUGH } ] }
{ GIVING { outfile } ... }
Additional Information:
explode
extract