Once the retry routine gets control, it continues with mainline processing, and can free resources, deactivate recovery routines, and so on. As stated earlier, the retry routine is really an extension of the mainline routine, and its purpose is to re-establish the mainline environment.
For ESTAE-type recovery routines that specify FRESDWA=YES on SETRP, the system frees the SDWA before entering the retry routine. For ESTAE-type recovery routines that specify RETREGS=YES, the system restores the registers from the SDWA.
For ESTAE-type recovery routines that specify FRESDWA=NO on SETRP, the system does not free the SDWA, and the retry routine can access it. In that case, the retry routine also has the responsibility of freeing the storage for the SDWA when it is no longer needed. The subpool number and length to use to free the storage are in the SDWA, in fields SDWASPID and SDWALNTH, respectively.
The retry routine can determine what action the recovery routine took in regard to freeing the SDWA and restoring registers by examining the contents of GPR 0:
GPR 0 Contents | Meaning |
---|---|
0 | The system provided an SDWA. The recovery routine specified RETREGS=NO and FRESDWA=NO. Registers are not restored from the SDWA, and the retry routine must free the SDWA. GPR 1 contains the address of the SDWA. |
12 (X'0C') | The system did not provide an SDWA. |
20 (X'14') | The system provided an SDWA. The recovery routine specified RETREGS=NO and FRESDWA=YES. Registers are not restored from the SDWA, and the retry routine does not have to free the SDWA. |
Value restored from SDWA (field SDWASR00) | The system provided an SDWA. The recovery routine specified RETREGS=YES, and either FRESDWA=NO or FRESDWA=YES. If the recovery routine specifies FRESDWA=NO, the recovery routine must alert the retry routine to free the SDWA. Some sort of protocol must be established between the recovery routine and the retry routine. For example, the recovery routine can set a unique value in SDWASR00 (the field that represents GPR 0 in SDWASRSV) to distinguish this case from those above where GPR 0 contains either 0, 12, or 20. The recovery routine can pass the address of the SDWA to the retry routine in a parameter area (use the parameter area pointed to by SDWAPARM) or in a register (consider using register 0). |
For complete details about register contents see Understanding the recovery environment.