COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-108
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.
PERFORM UP-DATE-MASTER UNTIL DONE
MOVE 0 TO M-FLAG
UNLOCKFILE IN-MASTER-FILE
...
Example 9-40. LOCKFILE Statement With TIME LIMIT Phrase (page2of2)
MERGE merge-file
COLLATING SEQUENCE phrase
USING phrase output-specifier
key-specifier
VST177.vsd
ON
ASCENDING
DESCENDING KEY
key
VST178.vsd