Obtaining and using disabled reference (DREF) storage

A program that runs disabled for I/O or external interrupts cannot reference data-in-virtual storage unless the storage has been page-fixed or is in either a fixed or disabled reference (DREF) subpool.

All storage supported by the system is either fixed, pageable, or disabled reference (DREF). Because the system resolves page faults occurring on DREF storage synchronously, your program can reference DREF storage while it runs disabled for I/O and external interrupts. Your program, therefore, can use DREF storage in place of fixed storage if it needs to reference storage while it is disabled. An advantage of DREF storage is that it need not be backed by central storage frames until it is referenced. However, if the system cannot obtain a frame of central storage to back the DREF storage when it is referenced, the program referencing the storage is ended abnormally.

DREF storage is similar to pageable storage in the following ways:

IBM® recommends that you use pageable storage instead of DREF storage if possible. You should also consider using the PGSER macro to page-fix pageable storage as needed.

To obtain storage from a DREF subpool, use the SP parameter on either GETMAIN or STORAGE and specify subpool 203, 204, 205, 213, 214, 215, 247, or 248. These subpools are the DREF subpools.

Avoid using the load real address (LRA) instruction to get the real address of DREF storage. Do not reference DREF storage with an I/O operation or with dynamic address translation (DAT) turned off. Also, because the DREF subpools are supported only above 16 megabytes, specify LOC=31 on the GETMAIN macro or STORAGE OBTAIN macro.

You can also use the DSPSERV macro to obtain a data space of DREF storage. The z/OS MVS Programming: Extended Addressability Guide contains information on how to create a data space with DREF storage.

Abends while referencing DREF storage: If your program attempts to reference DREF storage and the system cannot obtain central storage to back it, the system will abnormally terminate your program with an abend code of X'03C'. If you plan to use DREF storage, your program should be prepared to handle such an abend. Furthermore, your program's recovery routine should refrain from referencing any DREF storage if that is what caused the abend.