REWRITE Statement - Format 1
>>-REWRITE--record-name-1--+--------------------+--------------->
'-FROM--identifier-1-'
>--+-------------------------------------+---------------------->
| (1) |
'-FORMAT------+----+-+-identifier-2-+-'
'-IS-' '-literal-1----'
>--+-----------------------------------------+------------------>
| (1) |
'-NULL-KEY-MAP-------+----+--identifier-5-'
'-IS-'
>--+-------------------------------------+---------------------->
| (1) |
'-NULL-MAP-------+----+--identifier-6-'
'-IS-'
>--+------------------------------------------+----------------->
'-INVALID--+-----+--imperative-statement-1-'
'-KEY-'
>--+----------------------------------------------+------------->
'-NOT INVALID--+-----+--imperative-statement-2-'
'-KEY-'
>--+-------------+---------------------------------------------><
'-END-REWRITE-'
Notes:
MOVE identifier-1 TO record-name-1. REWRITE record-name-1.
After successful processing of the REWRITE statement, the current record is no longer available in record-name-1, but is still available in identifier-1. Both record-name-1 and identifier-1 cannot refer to the same storage area.
+-------------------------------IBM Extension--------------------------------+
The value specified in the FORMAT phrase contains the name of the record format to use for this I-O operation. The system uses this to specify or select which record format to operate on.
Identifier-2, if specified, must be an alphanumeric data item of 10 characters or less.
Literal-1, if specified, must be an uppercase character-string of 10 characters or less.
If the FORMAT phrase is not specified, the first format defined is used when accessing indexed files in Random Access Mode.
A value of all blanks is treated as though the FORMAT phrase were not specified. If the value is not valid for the file, a FILE STATUS of 9K is returned and a USE procedure is invoked, if applicable for the file.
+----------------------------End of IBM Extension----------------------------+
When an INVALID KEY condition exists, the updating operation does not take place. The data in record-name is unaffected. This phrase transfers control to the corresponding imperative-statement, as appropriate.
The INVALID KEY phrase must be specified if no applicable EXCEPTION/ERROR procedure is specified for record-name-1.
An INVALID KEY condition exists when:
The INVALID KEY phrase must be specified for files in which an applicable USE procedure is not specified.
See "Invalid Key Condition" under Common Processing Facilities for more information.
For sequentially accessed indexed files on device type DISK, this phrase is processed when the value contained in the RECORD KEY of the record to be replaced does not equal the RECORD KEY data item of the last retrieved record from the file.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.