The REWRITE statement logically replaces an existing record in a direct-access file.
When the REWRITE statement is executed, the associated direct-access file must be open in I-O mode.
The action of this statement can be inhibited at program run time by the inhibit write (INHWRT) parameter of the Override with database file (OVRDBF) CL command. When this parameter is specified, nonzero file status codes are not set for data dependent errors. Duplicate key and data conversion errors are examples of data dependent errors.
For more information on this command, see the CL and APIs section of the Programming category in the IBM® i Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/.