<port close option>
┌◄───────────────────────────────────────┐
──┴─┬─/1\─ , ── DONTWAIT ────────────────┬─┴───────────────────────────►
└─/1\─ , ──<closedisposition option>─┘
►─┬──────────────────────────────┬─────────────────────────────────────┤
└─ , ──<associateddata option>─┘
<closedisposition option>
── CLOSEDISPOSITION ── = ─┬─ ABORT ───┬────────────────────────────────┤
└─ ORDERLY ─┘
<associateddata option>
──┬─<string associateddata option>─────┬───────────────────────────────┤ └─<non-string associateddata option>─┘
<string associateddata option>
──┬───────────────────────────────────────────────────────────┬────────► └─ ASSOCIATEDDATALENGTH ── = ──<arithmetic expression>── , ─┘ ►─ ASSOCIATEDDATA ── = ──<string expression>───────────────────────────┤
<non-string associateddata option>
── ASSOCIATEDDATALENGTH ── = ──<arithmetic expression>── , ────────────►
►─ ASSOCIATEDDATA ── = ─┬─<array row>────────────┬─────────────────────┤
├─<subscripted variable>─┤
└─<pointer expression>───┘
The PORT CLOSE option is meaningful only for files for which the KIND file attribute has the value PORT.
The control option DONTWAIT is used to indicate that control should be returned to the program as soon as possible. If DONTWAIT is not specified, WAIT is assumed and control is returned when processing of the CLOSE statement is complete. Refer to the I/O Subsystem Programming Guide for more information on control options.
The CLOSEDISPOSITION = ORDERLY option and ASSOCIATEDDATA option are meaningful only for certain port file services. The CLOSEDISPOSITION = ABORT terminates a dialog immediately. A CLOSEDISPOSITION = ORDERLY steps the subfile through an orderly termination procedure that involves handshaking between the two programs. If the file is a port file and the CLOSEDISPOSITION option is not specified, the ABORT operation is assumed. With an ABORT termination, the processes must go through their own handshake procedure to ensure no data loss. The ASSOCIATEDDATA option can be used to send associated data with the subfile close. If a string expression is specified, the length is calculated automatically and used as the ASSOCIATEDDATALENGTH value. Otherwise, the ASSOCIATEDDATALENGTH option specifies how many characters are to be sent. If the ASSOCIATEDDATA value is of type HEX, the ASSOCIATEDDATALENGTH option indicates the number of HEX characters, otherwise the number of EBCDIC characters. If the ASSOCIATEDDATALENGTH value is not a single-precision integer it is integerized.

