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.
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.
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.)
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.