Open ClientConnect uses the SPRC field in the SPAREA to communicate the success or failure of a CSA command.
Always include a check in your code for the SPRC field
after issuing any CSA command.
These code fragments show how a CSA accesses the SPRC (return code) field to get this information:
CALL 'DETACH' USING SPAREA.
IF SPRC NOT = '000' MOVE 'DETACH' TO WS-STUB-NAME PERFORM 6900-STUB-CALL-ERROR THRU 6900-EXIT GO TO 0000-GET-OUT-NOW.
MOVE SPRC TO WS-STUB-SPRC. MOVE SPMSG TO WS-STUB-SPMSG.
EXEC CICS WRITEQ TS QUEUE('CSEXQUE') FROM(WS-STUB-ERROR-MSG) NOSUSPEND RESP(CICSRC) END-EXEC.