7.2.2.2 Unformatted Direct Access READ Statement

The unformatted direct access READ statement reads an external record accessed under the direct mode of access; it assigns the fields of binary data contained in that record to the elements in the I/O list, in the order, from left to right, in which those elements appear in the list. The data is not translated. The amount of data assigned to each element is determined by that element's data type.

The unformatted direct access READ statement reads only one record. If that record contains more fields than there are elements in the I/O list of the statement, the unused fields are discarded; if there are more elements than fields, an error occurs.

Examples

In the first example, the READ statement reads record 10 in the file connected to logical unit 1 and assigns binary integer values to elements 1 and 8 of the array LIST.

READ (1,REC=10) LIST(1),  LIST(8)

In the second example, the READ statement reads record 58 in the file connected to logical unit 4 and assigns binary values to five elements of the array RHO.

READ (4,REC=58,IOSTAT=K,ERR=500) (RHO(N),  N=1,5)


Previous Page Next Page Table of Contents