How a CICS exit routine can avoid the storm-drain effect

You can write a resource manager interface program exit routine, XRMIOUT, to avoid the storm drain effect caused by SQLCODE -904 (resource unavailable). This exit routine does not avoid the storm-drain problem caused by using INQUIRE EXITPROGRAM to avoid AEY9 abends.

About this task

Begin general-use programming interface information.Using XRMIOUT, you can intercept the return from the resource manager. The exit routine can determine whether:
  • The resource manager is Db2.
  • SQLCODE -904 is in the SQL communication area (SQLCA).

If these conditions exist, abend the transaction instead of ending the transaction normally.

To determine if Db2 is the resource manager, compare 'DSNCSQL' with the value stored at the address that is included with the UEPTRUEN parameter that is passed to XRMIOUT, as shown in the following figure.

Figure 1. Pointers to resource manager name and SQLCODE
Begin figure description. The SQLCODE is reached through accessing the application parameters, register save area, and SDNCSQL's DFHUEPAR parameter list. End figure description.

Procedure

To find the SQLCODE:

  1. Find UEPTRUEP in the DFHUEPAR parameter list that is passed to XRMIOUT. UEPTRUEP contains the address of the DFHUEPAR parameter list that is passed to DSNCSQL.
  2. Find UEPHMSA in DSNCSQL's DFHUEPAR parameter list. UEPHMSA points to the register save area that contains the application's registers.
  3. Find register 1 in the register save area. Register 1 contains the address of the application parameters.

    The DSNXRDI macro maps the application parameters that are passed by the precompiler to Db2. The mapping macro is contained in the data set library prefix.SDSNMACS.

  4. Find RDICODEP in the DSNXRDI structure. RDICODEP contains the address of the SQL communication area (SQLCA).
  5. Find the SQLCODE.
    End general-use programming interface information.