Understanding CSA Application Program Interfaces (APIs)

When Open ClientConnect executes a command, it uses the SPAREA SPRC (see “SPRC”) field to send a return code that indicates the success or failure of the command. If the command is successful, the SPRC field is set to 000. If an error occurs:

  1. The SPRC field is set to a 3-digit Open ClientConnect error code. Mainframe Connect Client Option and Server Option Messages and Codes contains the Open ClientConnect error codes related to CSAs.

  2. The CSA is not allowed to issue any more commands. The CSA should perform any termination processing and then return control to Open ClientConnect.

The following COBOL II statements show an example of return code checking after issuing an OPENPIPE command:

CALL 'OPENPIPE' USING SPAREA.
 IF SPRC NOT EQUAL '000' THEN GO TO PERFORM-TERMINATE.

In addition to '000', the SPRC field can contain a valid return code of EOF, indicating End Of File on input data.