VMS Help  —  FORTRAN  Statements  READ
  Transfers data from external or internal units to internal storage.

  The meanings of the symbolic abbreviations used to represent the
  parameters in the READ statement syntax are as follows:

     extu     Is the logical unit or internal file optionally
     or       prefaced by UNIT=.  UNIT= is required if unit is
     intu     not the first element in the clist.

     fmt      Specifies whether formatting is to be used for
              data editing, and if it is, the format specification
              or an asterisk (*) to indicate list-directed formatting.
              The "fmt" is optionally prefaced by FMT=, if "fmt" is
              the second parameter in the clist and the first parameter
              is a logical or internal unit specifier without the
              optional keyword UNIT=.

     nml      Is the namelist group specification for namelist I/O.
              Optionally prefaced by NML=.  NML= is required
              if namelist is not the second I/O specifier.

     rec      Is the cell number of a record to be accessed directly.
              Optionally prefaced by REC= or by an apostrophe (').

     iostat   Is the name of a variable to contain the completion
              status of the I/O operation. Optionally prefaced
              by IOSTAT=.

     err      Is the label of a statement to which control is
              transferred in the event of an error. Optionally
              prefaced by ERR=.

     end      Is the label of a statement to which control is
              transferred in the event of an end-of-file.
              Optionally prefaced by END=.

     eor      Is the label of a statement to which control is
              transferred in the event of an end-of-record.
              Optionally prefaced by EOR=.  This can only
              be specified for nonadvancing READs.

     adv      Specifies advancing (ADVANCE='YES') or nonadvancing
              input (ADVANCE='NO').  The default is 'YES'.

     size     Specifies character count (SIZE=int). It can
              only be indicated for nonadvancing READs.

     keyspec  Specifies the key of field value of a record to
              be accessed.  Optionally prefaced by KEY=, KEYEQ=,
              KEYGE=, KEYGT=, KEYNXT, KEYNXTNE, KEYLT, or KEYLE.

     keyid    Specifies the key field index that is to be searched
              for the specified key field value. Optionally in-
              cluded with keyspec and optionally prefaced by KEYID=.

     iolist   Are the names of the variables, arrays, array
              elements, or character substrings from which or
              to which data will be transferred.  Optionally
              an implied-DO list.

  The control-list parameters are "extu" (or "intu"), "fmt", "nml",
  "rec", "iostat", "err", "end", "adv", "size", "keyspec", and
  "keyid".  The I/O list parameter is "iolist".

1  –  Sequential

1.1  –  Formatted

  Translates the data from character to binary format as specified by
  format specifications.  Statement formats:

  1. READ (extu, fmt [,adv][,size][,iostat][,err][,end][,eor]) [iolist]

     Reads from a specified external unit.

  2. READ fmt [,iolist]

     Reads from FOR$READ (normally, the terminal).

1.2  –  List-directed

  List-directed sequential READ statement formats:

  1. READ(extu,*[,iostat][,err][,end])[iolist]

     Reads from a specified external unit.
     Translates the data from character to binary
     format according to the data types of the
     variables in the I/O list.

  2. READ * [,iolist]

     Reads from FOR$READ (normally, the terminal).
     Translates the data from character to binary
     format according to the data types of the
     variables in the I/O list.

1.3  –  Namelist

  Namelist sequential READ statement formats:

  1. READ (extu,nml [,iostat][,err][,end])

     Reads from a specified external unit.  Translates
     the data from character to binary format according
     to the data types of the list entities in the
     corresponding NAMELIST statement.

  2. READ nml

     Reads from FOR$READ (normally, the terminal).
     Translates the data from character to binary format
     according to the data types of the entities in the
     corresponding NAMELIST statement.

1.4  –  Unformatted

  Unformatted sequential READ statement format:

     READ (extu,[,iostat][,err][,end]) [iolist]

  Reads from a specified external unit.  Does not translate the data.

2  –  Direct

2.1  –  Formatted

  Formatted direct READ statement format:

     READ (extu,fmt,rec[,iostat][,err]) [iolist]

  Reads from a specified external unit.  Translates the data from
  character to binary format as specified by "fmt".

2.2  –  Unformatted

  Unformatted direct READ statement format:

     READ (extu,rec[,iostat][,err]) [iolist]

  Reads from a specified external unit.  Does not translate the data.

3  –  Indexed

3.1  –  Formatted

  Formatted Indexed READ statement format:

     READ (extu,fmt,keyspec[,keyid][,err][,iostat]) [iolist]

  Reads from a specified external unit.  Translates the data from
  character to binary format as specified by "fmt".

3.2  –  Unformatted

  Unformatted Indexed READ statement format:

     READ (extu,keyspec[,keyid][,err][,iostat]) [iolist]

  Reads from a specified external unit.  Does not translate the data.

4  –  Internal

  Internal READ statement format:

     READ (intu,fmt[,err][,iostat][,end]) [iolist]

  Reads from a specified character variable.  Translates the data
  from character to binary format as specified by "fmt".
Close Help