Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using the NOTE Macro to Return the Relative Address of a Block z/OS DFSMS Using Data Sets SC23-6855-00 |
|
The NOTE macro requests the relative address of the first logical record of the block just read or written. In a multivolume non-extended-format data set, the address is relative to the beginning of the data set on the volume currently being processed. In a striped data set, the address is always relative to the beginning of the data set. Your program later uses the address in positioning operations. For magnetic tape, the address is in the form of a 4-byte block address. If you code a TYPE=REL or do not code TYPE, NOTE returns the block address in register 1. In this case the first block in the current file on the volume is X'00000001'. If you code TYPE=ABS, NOTE returns the physical block identifier of a data block on tape in register 0. In this case the content of the physical block identifier is device-dependent and is relative to the beginning of the volume. Later you can use the block address or the block identifier as a search argument for the POINT macro. If your program issues a NOTE macro with TYPE=REL on tape, NOTE might return an invalid block address of zero. It signifies that the block was written on the previous volume and you now are positioned on a different volume. If you wish to learn the address of the last block on the previous tape, you can do the following instead of the logic above:
Note: The above technique works only on tape.
The problem does not occur on disk or if you use NOTE TYPE=ABS.
For non-extended-format data sets on direct access storage devices, the address is in the form of a 4-byte relative track record address. For extended format data sets, the address is in the form of a block locator token (BLT). The BLT is essentially the relative block number (RBN) within the current logical volume of the data set where the first block has an RBN of 1. The user sees a multistriped data set as a single logical volume; therefore, for a multistriped data set, the RBN is relative to the beginning of the data set and incorporates all stripes. For PDSEs, the address is in the form of a record locator token. The address provided by the operating system is returned in register 1. For non-extended-format data sets and partitioned data sets, NOTE returns the track balance in register 0 if the last I/O operation was a WRITE, or returns the track capacity if the NOTE follows a READ or POINT. For PDSEs, extended format data sets and HFS data sets, NOTE returns X'7FFF' in register 0. See Using the NOTE Macro to Provide Relative Position for information about using the NOTE macro to process PDSEs. |
Copyright IBM Corporation 1990, 2014
|