REWRITE statement
The
REWRITE statement replaces a record in an UPDATE file. For SEQUENTIAL UPDATE
files, the REWRITE statement specifies that the last record read
from the file is rewritten; consequently a record must be read before
it can be rewritten. For DIRECT UPDATE files, any record can be
rewritten whether or not it has first been read.
 >>-REWRITE FILE--(file-reference)--+-------------------+-------->
'-FROM--(reference)-'
>--+-------------------+--;------------------------------------><
'-KEY--(expression)-'
|
The keywords can appear in any order. The FROM option must be
specified for UPDATE files with the DIRECT attribute, or with both
the SEQUENTIAL and UNBUFFERED attributes.
A REWRITE statement that does not specify the FROM option has
the following effect:
- If the last record was read by a READ statement with the INTO
option, REWRITE without FROM has no effect on the record in the
data set.
- If the last record was read by a READ statement with the SET
option, the record is updated by whatever assignments were made
in the variable identified by the pointer variable in the SET option.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)