The subfile index, if present, specifies the subfile to which the RESPOND statement applies. If 0 (zero) is specified, the RESPOND is invoked on all subfiles in a FILESTATE that are awaiting a response.
The RESPONDTYPE option indicates the type of the response. The type of the response must be consistent with the FILESTATE. The ACCEPTOPEN and ACCEPTCLOSE options indicate that a positive response is to be generated and issued for an open indication or close indication received from the correspondent application. The REJECTOPEN option indicate that a negative response is to be generated and issued for an open indication.
The ASSOCIATEDDATA option can be used to send associated data to the correspondent endpoint with the response. If a string expression is used, the length of the expression is calculated automatically and used for the ASSOCIATEDDATALENGTH value. Otherwise, the ASSOCIATEDDATALENGTH option indicates how many characters are to be sent as the ASSOCIATEDDATA value.
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 is not a single-precision integer it is integerized.
The RESPOND statement can be used as an arithmetic function. It returns the same values as the file attribute AVAILABLE. For a description of these values, see the File Attributes Programming Reference Manual. If the result of this statement is not interrogated by the program, the program terminates if the respond action fails.

