Using the REXX run-time interface

When you are using the REXX run-time interface, you can use the EYURESP and EYUREAS built-in functions to convert and test the numeric RESPONSE and REASON values returned by an API command.

As an example, consider this API command:
   var = EYUAPI('CONNECT'              ,
                'CONTEXT('WCONTEXT')'  ,
                'SCOPE('WSCOPE')'      ,
                'VERSION(0310)'      ,
                'THREAD(WTHREAD)'      ,
                'RESPONSE(WRESPONSE)'  ,
                'REASON(WREASON)')
      .
      .
To test for the RESPONSE value, you could code:
   If WRESPONSE <> EYURESP(OK) Then Signal NOCONNECT
to compare the numeric RESPONSE value returned in WRESPONSE with the numeric equivalent of OK.
Alternatively, you could code:
   If EYURESP(WRESPONSE) <> "OK" Then Signal NOCONNECT
to convert the numeric RESPONSE value to its character equivalent first.
Note: The RESPONSE and REASON options report only run-time errors. Errors in interpreting an API command are reported in either the REXX RC variable or the variable assigned to a REXX function.