RESP and RESP2 options

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 like 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. EXEC interface block (EIB) response and function codes lists the correspondence, but 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 = DFHRESP(NORMAL) PERFORM MAIN-RTN
ELSE IF RC = DFHRESP(NOTAUTH)
          PERFORM SECURITY-WARNING
     ELSE PERFORM ERR-RTN.
Many exception conditions can have multiple causes. If you must know the exact cause, use the RESP2 option, which you can specify whenever you have specified RESP. For example, if you want to distinguish a failure because the file was remote from other failures in the example above, you can 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 have 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 and C++      long int
PL/I           FIXED BIN(31)
Assembler      F