# 7.4 REWRITE Statements

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:

### Formatted

    REWRITE (extu,fmt [,iostat] [,err]) [iolist]

### Unformatted

    REWRITE (extu [,iostat] [,err]) [iolist]

extu
  Is an external unit specifier.
fmt
  Is a format specifier.
iostat
  Is an I/O status specifier.
err
  Is a transfer-of-control specifier.
iolist
  Is the I/O-list specifier.

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.

For More Information:

- On control-list parameters, see Section 7.1.1.

- On the I/O list parameter, see Section 7.1.2.

- On rules for control-list parameters, see Section 7.1.1.1.

Previous Page Next Page Table of Contents