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

Example 141 USE AFTER EXCEPTION Statement
...
PROCEDURE DIVISION.
DECLARATIVES.
MASTER-FILES SECTION.
USE AFTER EXCEPTION PROCEDURE ON MASTER-1 MASTER-2.
MASTER-ERROR-ROUTINE.
IF FILE-STATUS....
...
DETAIL-FILE SECTION.
USE AFTER EXCEPTION PROCEDURE ON DETAIL-IN.
DETAIL-ERROR-ROUTINE.
...
END DECLARATIVES.
MAIN-SECTION SECTION.
BEGIN-PROGRAM.
...
WRITE
WRITE delivers a record to its associated file.
WRITE for Sequential Files
record-name
is a logical record described in the File Section of the Data Division. The record-name can
be qualified by the name of the file with which the record is associated. The data written is the
current contents of record-name.
from-name
is the identifier of a data area whose contents are to be moved to the record specified by
record-name before the WRITE occurs. from-name must specify a data area other than
that specified by record-name. It also cannot specify an index data item.
WRITE 487