GETBUF—Obtain a buffer (BDAM, BISAM, BPAM, and BSAM)

The GETBUF macro causes the control program to obtain a buffer from the buffer pool assigned to the specified data control block and to return the address of the buffer in a designated register. The BUFCB field of the data control block must contain the address of the buffer pool control block when the GETBUF macro is issued. The system returns control to the instruction following the GETBUF macro. Use the FREEBUF macro to return the buffer obtained to the buffer pool. GETBUF does not support buffers above the line.

The GETBUF macro may be issued in 24- or 31-bit addressing mode. When issued in 31-bit addressing mode, all addresses must be valid 31-bit addresses.

The format of the GETBUF macro is:

dcb address—RX-Type Address, (2-12), or (1)
specifies the address of the data control block containing the buffer pool control block address. When issued in 31-bit addressing mode, the input DCB address must be a clean 31-bit address.
register—(2-12)
specifies one of the registers 2 through 12 in which the system places the address of the buffer obtained from the buffer pool. If no buffer is available, the contents of the designated register are set to 0.