READ—Read a block (offset read of keyed direct data set using BSAM)

The READ macro retrieves a block from a direct data set and places it in a designated area of storage. The data set is a direct, and its record format is unblocked variable-length spanned records. You must specify BFTEK=R in the data control block. Control might be returned to the problem program before the block is retrieved. The input operation must be tested for completion using a CHECK macro. A data event control block, shown in Status information following an input/output operation, is constructed as part of the macro expansion.

The standard form of the READ macro is written as follows (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—SF
specifies normal, sequential, forward retrieval.
dcb address—A-Type Address or (2-12)
specifies the address of the data control block for the opened direct data set to be read.
area address—A-Type Address or (2-12)
specifies the address of the area in which the block is placed.

When a spanned direct data set is created with keys, only the first segment of a record has a key; successive segments do not. When a spanned record is retrieved by the READ macro, the system places a segment in a designated area addressed by the area address. The problem program must assemble all the segments into a logical record. Because only the first segment has a key, the successive segments are read into the designated area offset by key length to ensure that the block-descriptor word and the segment-descriptor word are always in their same relative positions.