z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Reading a Block

z/OS DFSMS Using Data Sets
SC23-6855-00

The READ macro retrieves a data block from an input data set and places it in a designated area of virtual storage. To permit overlap of the input operation with processing, the system returns control to your program before the read operation is completed. You must test the DECB created for the read operation for successful completion before the block is processed or the DECB is reused.

When you use the READ macro for BSAM to read a direct data set with spanned records and keys, and you specify BFTEK=R in your DCB, the data management routines displace record segments after the first in a record by key length. This is called offset reading. With offset reading you can expect the block descriptor word and the segment descriptor word at the same locations in your buffer or buffers, even if you read the first segment of a record (preceded in the buffer by its key), or a subsequent segment (which does not have a key).

You can specify variations of the READ macro according to the organization of the data set being processed and the type of processing to be done by the system as follows.

Sequential and Partitioned :
SF
Read the data set sequentially.
SB
Read the data set backward (magnetic tape, format-F, and format-U only). When RECFM=FBS, data sets with the last block truncated cannot be read backward.
Direct :
D
Use the direct access method.
I
Locate the block using a block identification.
K
Locate the block using a key.
F
Provide device position feedback.
X
Maintain exclusive control of the block.
R
Provide next address feedback.
U
Next address can be a capacity record or logical record, whichever occurred first.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014