7.3.3.1 Formatted Indexed WRITE Statement (VMS only)

The formatted indexed WRITE statement performs the following operations:

No key parameters are required in the list of control parameters because all necessary key information is contained in the output record.

If the values specified by the I/O list and formatting do not fill a fixed-length record being written, the unused portion of the record is filled with space characters. If additional records are specified, they are inserted in the file logically according to the key values contained in each record.

When you use a formatted indexed WRITE statement to write an INTEGER key, the key is translated from internal binary form to external character form. A subsequent attempt to read the record by using an integer key may not match the key field in the record.

Example

In the following example, the formatted indexed WRITE statement writes the translated values of each of the 20 elements of the array RDATA to a new formatted record in the indexed file connected to logical unit 4. KEYVAL is the key by which the record is accessed. (This example assumes that the first 10 bytes of a record are a character key.)

      WRITE (4,100) KEYVAL, (RDATA(I),  I=1,20))
100   FORMAT (A10,20F15.7)


Previous Page Next Page Table of Contents