Accessing above 16-megabyte UCBs

To conserve below 16-megabyte common virtual storage, you can define a device's UCB above 16 megabytes. You specify whether a UCB can exist above 16 megabytes in the hardware configuration definition (HCD) device definition. For application programs that require 24-bit addresses, the system enables above 16 megabyte UCBs to be accessed in below 16 megabyte private, virtual storage.

During allocation, the system automatically creates a below 16 megabyte view into the actual above 16 megabyte UCB. The view is known as a captured UCB. It enables an application to access the UCB in the private storage of its address space. The system automatically captures an above 16 megabyte UCB at allocation and releases the UCB at deallocation. With dynamic allocation, you can choose not to capture a UCB if affected applications can handle above 16 megabyte UCBs.

If you are not using standard IBM® services, for example, you are building your own data extent block (DEB), you might need to control capturing of an above 16 megabyte UCB explicitly. For example, a program might allocate a device in one address space but perform I/O in another address space. A captured UCB created during allocation in the first address space is not accessible in the second address space. The program could explicitly capture the UCB in the second address space. You use the IOSCAPU macro to explicitly capture and release UCBs.

Although it is not recommended, you can use the CAPTCOM parameter on the IOSCAPU macro to capture a UCB in common rather than private storage. Capturing in common storage enables a UCB pointer in a common control block to be accessed in any address space. For this reason, the system automatically captures the UCBs for devices with the SYS1.LINKLIB, SYS1.SVCLIB, or logrec data sets in common rather than in private storage. To enable support for JES2 spool data sets, the UCBs for these devices are also captured in common storage. Therefore, if your common storage is constrained, the UCBs for these devices should remain below 16 megabyte UCBs.

Programs can also use the IOSCAPU macro to determine a captured UCB's actual UCB address. The IOSCAPF macro also provides a method of receiving an actual UCB address and handles parameter passing in general purpose registers (GPRs). IOSCAPF does not provide parameter validation or recovery.

With the UCBLOOK and UCBSCAN ADDRESS macros, you can use the LOC parameter to indicate whether you want to receive above 16 megabyte UCB addresses. The default is to receive only below 16 megabyte UCBs.

Macros that receive a UCB address accept the address of a below 16 megabyte UCB, above 16 megabyte UCB, or captured UCB. The UCBLOOK and UCBSCAN ADDRESS macros, which return UCB addresses, only return actual UCB addresses, not captured UCB addresses. The IOSUPFA and IOSUPFR macros also only return an actual, not captured, UCB address. Other macros that return addresses of UCB segments, such as the IOSCMXA, IOSCMXR, and IOSDCXR macros return the address of an actual UCB segment given an actual UCB address and the address of a captured UCB segment given a captured UCB address.