Subfile Specification

<subfile specification>

──┬─<read subfile specification>──┬────────────────────────────────────┤
  └─<write subfile specification>─┘

<read subfile specification>

  ┌◄───────────────────── , ────────────────────┐
──┴─┬─/1\─ DONTWAIT ──────────────────────────┬─┴──────────────────────┤
    └─/1\─ SUBFILE ─┬───────────────┬─<index>─┘
                    └─<result>── : ─┘

<result>

──<arithmetic variable>────────────────────────────────────────────────┤

If the file to be read is a port file (a file for which the KIND attribute is equal to PORT), an array row read containing a subfile specification must be used. For more information, refer to “Array Row Read” later in this section.

The subfile specification is meaningful only for port files. It is used to specify the subfile to be used for the read operation and the type of read operation to be performed.

If the subfile index is used, the value of the subfile index is assigned to the LASTSUBFILE attribute of the file. It specifies the subfile to be used for the read operation. If the subfile index is zero, a nonselective read is performed. If the subfile index is nonzero, then a read from the specified subfile is performed. The result variable, if any, is assigned the resultant value of the LASTSUBFILE attribute. For more information on the LASTSUBFILE attribute, refer to the File Attributes Programming Reference Manual.

If DONTWAIT is specified in a READ statement, and if no input is available, no data is returned and the program is not suspended.