Using the CICSPlex SM command-level interface to test RESPONSE and REASON

When you are using the CICSPlex® SM command-level interface, you can use the EYUVALUE built-in function to convert and test the numeric RESPONSE and REASON values returned by an API command.

As an example, consider this API command:
   EXEC CPSM CONNECT
             CONTEXT(WCONTEXT)
             SCOPE(WSCOPE)
             VERSION('0310')
             THREAD(WTHREAD)
             RESPONSE(WRESPONSE)
             REASON(WREASON)
      .
      .
To test for the RESPONSE value in each of the supported languages, you could code as follows:
COBOL or PL/I:
IF WRESPONSE NOT = EYUVALUE(OK) GO TO NOCONNECT.
C:
if (WRESPONSE ¬= EYUVALUE(OK)) { goto NOCONNECT; }
Assembler language:
CLC   WRESPONSE,EYUVALUE(OK)
BNE   NOCONNECT
which the built-in function changes to:
CLC   WRESPONSE,=F'1024'

You can use EYUVALUE in the same way to test for the REASON value, if the RESPONSE is one that returns a reason.