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:
  • RCFROM specifies the RCFROM return code. The system compares the actual return code from each exit routine to the RCFROM return code, using the comparison designated by RCCOMPARE.
  • RCCOMPARE indicates the type of comparison the system is to make. For example, if a definer used RCCOMPARE=LT, the system would compare the actual return code to the RCFROM return code. If the actual return code is less than the RCFROM return code, the system replaces the actual return code with the value specified on RCTO.
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:
  • On the CALL request, you would specify RETINFO=HIGHEST
  • On the DEFINE request, you would specify:
    • The value 4 on RCFROM
    • The value 0 on RCTO
    • RCCOMPARE=NE

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:
  • 0 is not equal to 4, so it remains 0
  • 4 is equal to 4, so it remains 4
  • 8 is not equal to 4 so it is replaced with 0.

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.