COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-119
MERGE
MERGE
MERGE combines two or more files into another file, ordered by the same key.
MERGE is performed by the FastSort utility, using files that are not open to the COBOL
program. MERGE opens, reads, writes, and closes these files. MERGE can return
records to an output procedure that can then write them to some file that is open to the
COBOL program.
merge-file
is a sort-merge file description (SD) name. merge-file can have variable-length
or fixed-length records. Its record description entry defines the data item or items
used as the key or keys.
key-specifier
ASCENDING
specifies ascending merge order.
DESCENDING
specifies descending merge order.
key
is a data item to be used as a merge key. If merge-file has variable-length
records, key must refer to data within the first x character positions of the
record, where x is the minimum record size for merge-file.
MERGE merge-file
COLLATING SEQUENCE phrase
USING phrase output-specifier
key-specifier
VST177.vsd
ON
ASCENDING
DESCENDING KEY
key
VST178.vsd