Example: Allocating a device

A device can be allocated to a program either through a JCL allocation or through the dynamic allocation interface. Once the device is allocated, it cannot be dynamically deleted. As long as the program keeps the device allocated, it can access the corresponding UCB without pinning. If the program needs to unallocate the device but still maintain the UCB address in its control structures for later use, it must first pin the UCB for the device through the UCBPIN macro before it unallocates the device.