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

Example 83 DELETE Statement
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPLOYEE-MASTER ASSIGN TO "EMPMAST"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS EMPLOYEE-NUMBER
FILE STATUS IS FILE-STAT.
...
FD EMPLOYEE-MASTER
LABEL RECORDS ARE OMITTED
...
05 EMPLOYEE-NUMBER PIC X(7).
...
PROCEDURE DIVISION.
...
DELETE-RECORD.
MOVE KEY-TO-DELETE TO EMPLOYEE-NUMBER
DELETE EMPLOYEE-MASTER RECORD
INVALID KEY PERFORM KEY-ERROR
END-DELETE
DISPLAY
DISPLAY delivers a small amount of data (such as an error message) to a terminal, a printer, or
another process.
identifier
is the identifier of any data item except an index data item.
literal
is a literal or figurative constant name.
mnemonic-name
is the device on which the process displays the data. You must define mnemonic-name in
the SPECIAL-NAMES paragraph of the Environment Division. When you omit mnemonic-name,
the process delivers the data to its output file, typically its home terminal.
NO ADVANCING
specifies that the device to which the display is directed is not reset to the next line after the
data is displayed.
The DISPLAY statement in Example 74 delivers an error message to the output file of a process
312 Procedure Division Verbs