Write Subfile Specification

<write subfile specification>

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

<file-valued task attribute name>

── TASKFILE ───────────────────────────────────────────────────────────┤

If the file to be written is a port file (a file for which the KIND attribute is equal to PORT), any form of write, other than a binary write, can be used. Refer to “Binary Write” 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 write operation and the type of write operation to be performed.

If a 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 write operation. For a WRITE statement, if the subfile index is zero, a broadcast write is performed. If the subfile index is nonzero, then a write to the specified subfile is performed. The result variable, if specified, is assigned the resultant value of the LASTSUBFILE attribute.

For more information on the LASTSUBFILE file attribute, refer to the File Attributes Programming Reference Manual.

If DONTWAIT is specified and no buffer is available, the program is not suspended.

The URGENT clause is meaningful only when the Transmission Control Protocol/Internet Protocol (TCP/IP) is being used. This clause sets the urgent indication associated with the data. For more information on TCP/IP, refer to the TCP/IP Distributed Systems Service Operations Guide.

If the URGENT clause is used for port subfiles that have the SERVICE attribute set to BNANATIVESERVICE, then the BADWRITEOPTION (43) write error is returned in field [26:10] of the write result and the STATE attribute. The error bit [0:1] is set also in the write result and the STATE attribute.

The MOREDATA specification is valid only for port files. The MOREDATA specification is used to indicate that only part of a message is being written by the WRITE statement. There is no restriction on the size of the partial message that can be passed in a buffer except that the maximum data length cannot be greater than 64K characters.

<core-to-core part>

<core-to-core file part>

<core-to-core blocking part>

Refer to READ Statement for a discussion of these constructs.