Merging return codes

This information describes the situation in which the CALL request uses the RETINFO=HIGHEST or RETINFO=LOWEST parameters. In this case, the DEFINE request must tell the system how to merge the return codes before it chooses which return information to return to the caller. The relevant parameters on the DEFINE request are as follows:
The best way to describe the use of these parameters is through an example. Suppose the caller wants to handle only the return code with a value of 4. You would code the following values:

These settings tell the system to compare the return code from the exit routine with the number 4. If the return code is not 4, the system changes that value to 0. When all exit routines have completed, the system looks at all return codes (some with changed values) and returns the return information for the exit routine that had the highest return code.

If three exit routines get control at that exit, and their return codes are 0, 4, and 8, the system examines each code:

In this case, the highest return code is 4; the system places return information for that exit routine in the return area.

If two exit routines return with the same value in GPR15, the system places in the return area the return information from the first exit routine that had the value.

You can also use the ATTRIB request to change settings for how the system merges return codes.