The Server Option for CICS provides a generic abend handling module, SYOSABND, which can be found in the Server Option LOADLIB. To use the newly supplied abend handler module, do the following:
In the CICS RDO definitions, set the TWASIZE of the RPC transaction to be at least 5 bytes.
In the RPC application program, put the TDSPROC handle in the first 4 bytes of the TWA, and put a character Y in the 5th byte.
In the RPC application program, issue a CICS HANDLE ABEND command for the SYOSABND program.
The following is a COBOL excerpt from a user RPC routine that calls the new CICS abend handling module, SYOSABND.
WORKING-STORAGE SECTION. *Pointer field for TWA 01 WS-TWAPTR POINTER. *field to store the TWA length**** 01 WS-TWASIZE PIC 9(4) COMP. LINKAGE SECTION. *Area to store a pointer to the OSC TDSPROC and the Indicator. *The TDS PROC is usually named "GWL-PROC" and is the first *parameter in the OSC call such as TDACCEPT. 01 LK-TWAREA. 05 LK-GWLPROCPTR POINTER. 05 LK-SWITCH PIC X(1). PROCEDURE DIVISION. EXEC CICS ASSIGN TWALENG(WS-TWASIZE) NOHANDLE END-EXEC. *Make sure the TWA is large enough, has to be at least 5 bytes. If not, *we have a problem. IF WS-TWASIZE NOT EQUAL 5 THEN GO TO RETURN1. EXEC CICS ADDRESS TWA(WS-TWAPTR) END-EXEC. *Make sure the WS-TWAPTR contains a valid address. If not, we have a *problem. IF WS-TWAPTR EQUAL NULL THEN GO TO RETURN1. *Move the address of the GWL-PROC and set the indicator to 'Y'. SET ADDRESS OF LK-TWAREA TO WS-TWAPTR. SET LK-GWLPROCPTR TO GWL-PROC. MOVE 'Y' TO LK-SWITCH. EXEC CICS HANDLE ABEND PROGRAM('SYOSABND') END-EXEC.
The following message is returned to the client if an abend occurs:
Msg 1, Level 11, State 0: Procedure 'SYAB': SYAB ABEND CODE ASRA