Writing recovery routines

So far, this chapter has discussed general recovery concepts, including how to decide what type of recovery you need, and how to provide that recovery. But you have to write the recovery routines that you provide. To do so, you must understand all of the following items:
  • What a recovery routine is supposed to do.

    So far we talked about how recovery routines can either retry or percolate. But, they do a lot more than that. We also talked about recovery routines correcting or repairing errors, but we have not said how exactly they go about doing that.

  • How the recovery routine communicates with the mainline routine, the retry routine, and the system.
    The means of communication available to a recovery routine are:
    • A user parameter area, built by the mainline routine and passed to the recovery routine.
    • A data area called the system diagnostic work area (SDWA), which is provided by the system. The recovery routine communicates with the system, with other recovery routines, and with the retry routine through the SDWA. The recovery routine uses the SETRP macro to update information in the SDWA.
    • Registers, when no SDWA is provided.
  • The special considerations you must make when writing an ESTAE-type recovery routine.

    One important consideration is the presence of an SDWA. The case where an SDWA is not provided is rare; nevertheless, when you design an ESTAE-type recovery routine, you must allow for the possibility of not receiving an SDWA.

    Special considerations for ESTAE-type recovery routines also include RB considerations, linkage stack considerations, and outstanding I/Os at time of failure.

Note: When an error occurs for which the system passes control to your recovery routine, the recovery routine must be in virtual storage. It can either be an entry point in your program, or a separate routine. You are responsible for ensuring that the recovery routine is in virtual storage when needed.