Finding the return and reason code from the enclave

The following list tells where to look for the return and reason codes that are returned to the parent enclave when a child enclaves terminates:
  • EXEC CICS® LINK or EXEC CICS XCTL

    If the CICS thread was not terminated, the return code is placed in the optional RESP2 field of EXEC CICS LINK or EXEC CICS XCTL. The reason code is discarded.

  • SVC LINK to a child enclave with a main routine written in any Language Environment-conforming language

    If the process was not terminated, the return code is reported in R15. (See Managing return codes in Language Environment for more information.) The reason code is discarded.

  • C's system() function

    If the target command or program of system() cannot be started, “-1” is returned as the function value of system(). Otherwise, the return code of the child enclave is reported as the function value of system(), and the reason code is discarded. (See z/OS XL C/C++ Programming Guide for more information about the system() function.)

  • FETCH and CALL of a fetchable main

    Normally, the enclave return code and reason code are discarded when control returns to a parent enclave from a child enclave. However, in the parent enclave, you can specify the OPTIONS(ASSEMBLER RETCODE) option of the entry constant for the main procedure of the child enclave. This causes the enclave return code of the child enclave to be saved in R15 as the PL/I return code. You can then interrogate that value by using the PLIRETV built-in function in the parent enclave.