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):
[label] |
READ |
decb name |
---|
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.