The REWRITE statement transfers data from internal storage and writes the data (translated if formatted; untranslated if unformatted) to the current record.
The current record is the last record accessed by a preceding, successful indexed (VMS only), direct access, or sequential READ statement.
A REWRITE statement can be formatted or unformatted, and takes one of the following forms:
REWRITE (extu,fmt [,iostat] [,err]) [iolist]
REWRITE (extu [,iostat] [,err]) [iolist]
The control-list parameters are extu, fmt, iostat, and err. The I/O list parameter is iolist.
Between a READ and REWRITE statement, you should not specify any other I/O statement (except INQUIRE) on that logical unit. Execution of any other I/O statement on the logical unit destroys the current- record context and causes the current record to become undefined.