CICS® does not distinguish between SPI and API commands in the flow of control after it processes a command. You should read the material on this subject in the CICS Application Programming Guide if you are not familiar with it, because the information that follows is only a summary.
A program that issues a CICS command regains control at the point following the command if any of the following are true:
If an exception occurs for which a HANDLE CONDITION command is active, control goes to the point specified in the HANDLE command. Otherwise, CICS takes its default action for the exception. Except where specifically noted, this action is an abend. The abend codes associated with each exception condition are listed in Appendix B. EXEC interface block (EIB) response and function codes.
CICS sets a primary and sometimes a secondary response code when it completes a command, and provides options for you to inspect them. The primary code returned by the RESP option is the general result--either NORMAL, meaning that the command executed successfully, or the name of an exception condition such as NOTAUTH (not authorized) or INVREQ (invalid request). The secondary code, returned by RESP2, provides a finer level of detail.
RESP values are similar to CVDAs in that there is a limited set of values, each of which is named, and CICS translates the value name to its numeric equivalent. Appendix B. EXEC interface block (EIB) response and function codes lists the correspondence, but you should use the value names in your code to keep it version- and platform-independent.
For example, here is code from a program that initializes for an application. It opens and enables a file, and then checks to ensure that the operation was successful before continuing:
EXEC CICS SET FILE ('TAXFILE ') OPEN ENABLED
RESP(RC) END-EXEC.
IF RC = DFHVALUE(NORMAL) PERFORM MAIN-RTN
ELSE IF RC = DFHVALUE(NOTAUTH)
PERFORM SECURITY-WARNING
ELSE PERFORM ERR-RTN.
Many exception conditions can have multiple causes. If you need to know the exact cause, you use the RESP2 option, which you can specify whenever you have specified RESP. For example, if you wanted to distinguish a failure because the file was remote from other failures in the example above, you could add the RESP2 option to the SET FILE statement:
EXEC CICS SET FILE ('TAXFILE ') OPEN ENABLED
RESP(RC) RESP2(RC2) END-EXEC
and then test explicitly for a remote file:
IF RC2 = 1 . . .
RESP2 values are numeric and predefined by CICS, like RESP values, but they are not named; you use the numeric values, as shown in the example. They are unique for a specific command, and the RESP2 value implies the RESP value, so that you do not need to test both. They are not unique across commands, however, as RESP values are. Both are fullword binary values, defined in the same way as a CVDA in the same language:
COBOL PIC S9(8) COMP
C/370 long int
PL/I FIXED BIN(31)
Assembler F
[[ Contents Previous Page | Next Page Index ]]