COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
REWRITE for Sequential, Relative, Indexed, and Queue Files
record-name
is the record-name in a file description entry whose current contents replaces a record in the
file. The file must be open in I-O mode.
data-name
is the identifier of the item that contains the new record instead of record-name. When this
phrase is used, an implicit MOVE statement occurs to copy the data to record-name before
the rewrite operation occurs. data-name cannot specify an index-name or an index data
item. data-name cannot specify a data item allocated within the record area in which
record-name is located.
UNLOCK
permits access by other processes to a record (after the rewrite operation) that was previously
locked with a LOCK phrase.
imperative-stmt-1
is an imperative statement to be performed when an invalid-key condition is encountered by
the REWRITE operation. It is required if no USE statement is applicable for the file. If both a
USE statement and an INVALID KEY phrase are present, only the INVALID KEY phrase is used.
imperative-stmt-2
is an imperative statement to be performed when no invalid-key condition is encountered by
the REWRITE operation.
END-REWRITE
ends the scope of the REWRITE statement, causing the REWRITE to be a delimited-scope
statement. If the REWRITE statement does not end with an END-REWRITE phrase, the presence
of the INVALID KEY or the NOT INVALID KEY phrase causes the REWRITE statement to be a
conditional statement, which ends at the next period separator.
424 Procedure Division Verbs










