COBOL/400 Language Help
- Description
- When the Format 1 REWRITE statement is processed, the system logically
replaces a record retrieved by a READ statement. The last input/output
statement for this file must have been a successfully processed READ statement
without the NO LOCK phrase.
The operation of the REWRITE statement varies depending on the file
organization and access mode:
- For sequential files and sequential access mode, the record retrieved by
the last successfully processed READ statement is replaced.
- For indexed files and sequential access mode, the record specified by the
value contained in the prime RECORD KEY is replaced. When the REWRITE
statement is executed, this value must equal the value of the prime record key
data item in the last record read from this file.
- For indexed files and random or dynamic access mode, the record specified
by the value contained in the prime RECORD KEY is replaced.
- For relative files and sequential access mode, the record retrieved by the
last successfully processed READ statement is replaced.
- For relative files and random or dynamic access mode, the record specified
by the value in the RELATIVE KEY data item is replaced.
->->--REWRITE record-name-1---*-------------------*----------->
*-FROM identifier-1-*
->----*--------------------------------*--------------------->
*-FORMAT-*----*-*-identifier-2-*-*
*-IS-* *-literal-1----*
->---*-----------------------------------------*------------->
*-INVALID-*-----*--imperative-statement-1-*
*-KEY-*
->---*--------------------------------------------*---------->
*-NOT INVALID-*-----*-imperative-statement-2-*
*-KEY-*
->---*-------------*-----------------------------------------><-
*-END-REWRITE-*
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.