How to use the RESP and RESP2 options
The argument of RESP is a user-defined fullword binary data area (long integer). On return from the command, it contains a value that corresponds to the condition that might have been raised. Normally, its value is DFHRESP(NORMAL).
Use of RESP and DFHRESP in COBOL and PL/I
The
following example shows an EXEC CICS call in COBOL that uses the RESP
option. A PL/I example is similar, but ends with a semicolon (;) rather
than END-EXEC.
EXEC CICS WRITEQ TS FROM(abc)
QUEUE(qname)
NOSUSPEND
RESP(xxx)
END-EXEC.The following code is an example
of using DFHRESP to test for the RESP value:
IF xxx=DFHRESP(NOSPACE) THEN …Use of RESP and DFHRESP in C and C++
The
following example shows an EXEC CICS call in C that uses the RESP
option, including the declaration of the RESP variable:
long response;
⋮
EXEC CICS WRITEQ TS FROM(abc)
QUEUE(qname)
NOSUSPEND
RESP(response);The following code is
an example of using DFHRESP to test for the RESP value:
if (response == DFHRESP(NOSPACE))
{
⋮
}Use of DFHRESP in assembler language
The
following code is an example of a test for the RESP value in assembler
language:
CLC xxx,DFHRESP(NOSPACE)
BE ...