READ—Read a block of records (BISAM interface to VSAM)

The READ macro retrieves an unblocked record, or a block containing a specified logical record, from a data set. The block is placed in a designated area of storage, and the address of the logical record is placed in the data event control block. The data event control block is constructed as part of the macro expansion and is described in Status information following an input/output operation.

Control might be returned to the problem program before the block is retrieved. The input operation must be tested for completion using a WAIT or CHECK macro.

The READ macro for BISAM interface to VSAM must be issued in 24-bit mode.

Recommendation: The system no longer supports indexed sequential data sets. Convert the data set to a key sequenced data set (KSDS) and use the ISAM interface of VSAM or convert your program to use VSAM.

The standard form of the READ macro is written as follows for BISAM (the list and execute forms are shown following the descriptions of the standard form):

decb name—symbol
specifies the name that is assigned to the data event control block (DECB) that is created as part of the macro expansion.
type—{K|KU}
is coded as shown to specify the type of read operation:
K
specifies normal retrieval.
KU
specifies that the record retrieved is updated and returned to the data set. The system saves the device address to be returned.

When an indexed sequential data set is being updated with a READ KU macro and a WRITE K macro, both the READ and WRITE macros must refer to the same data event control block. This update operation can be performed by using a list-form instruction to create the list (data event control block) and by using the execute form of the READ and WRITE macros to refer to the same list.

dcb address—A-Type Address or (2-12)
specifies the address of the data control block for the opened data set to be read.
area address—A-Type Address, (2-12), or 'S'
specifies the address of the area in which the data block is placed. The first 16 bytes of this area are used by the system and do not contain information from the data block. The area address must specify a different area than the key address. Dynamic buffering is specified by coding 'S' instead of anaddress. The address of the acquired storage area is returned in the data event control block.Indexed sequential buffer and work area requirements are described in z/OS DFSMS Using Data Sets.
length—symbol, decimal digit, absexp, (2-12), or 'S'
specifies the number of bytes to be read up to a maximum of 32760. If 'S' is coded instead of a length, the number of bytes to be read is taken from the count field of the record. For blocked records, 'S' must be coded.
key address—A-Type Address or (2-12)
specifies the address of the area in the problem program containing the key of a logical record in the block to be retrieved. When the input operation is complete, the storage address of the logical record is placed in the data event control block. The key address must specify a different area than the area address.