You can use the RESP option with any command to test whether a condition was raised during its execution. With some commands, when a condition can be raised for more than one reason, you can, if you have already specified RESP, use the RESP2 option to determine exactly why a condition occurred.
EXEC CICS WRITEQ TS FROM(abc)
QUEUE(qname)
NOSUSPEND
RESP(xxx)
RESP2(yyy)
.
.
IF xxx=DFHRESP(NOSPACE) THEN ...
The above form of DFHRESP applies to both COBOL and PL/I.
switch (xxx) {
case DFHRESP(NORMAL) : break;
case DFHRESP(INVREQ) : Invreq_Cond();
break;
default : Errors();
}
CLC xxx,DFHRESP(NOSPACE)
CLC xxx,=F'18'
As the use of RESP implies NOHANDLE, you must be careful when using RESP with the RECEIVE command, because NOHANDLE overrides the HANDLE AID command as well as the HANDLE CONDITION command, with the result that PF key responses are ignored.