COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-227
SORT
SORT
SORT orders a set of records according to one or more keys. The records can either
be in a file or an input procedure can send them to SORT, one at a time. SORT can
either write the sorted records to a file or it can send them to an output procedure, one
at a time. SORT calls the FastSort utility.
sd-name
is the file name given in a sort-merge file description (SD) entry.
key-specifier
specifies one or more of the items described in the record descriptions of sd-
name.
key
is used to sort the records in ascending or descending order. The first key is
compared first, the second next, and so on. Two records equal in all sort keys
are sorted by their original order in the file.
SORT sd-name key-specifier
COLLATING SEQUENCE phrase
DUPLICATES phrase
input-specifier-1
input-specifier-2
output-specifier-1
output-specifier-2
VST213.vsd
ON
ASCENDING
DESCENDING KEY
key
VST214.vsd