Relative byte addresses
Relative byte addresses (RBAs) enable you to access ESDS files
directly. The RBAs are either 4 or 8 byte fields, depending on the
usage, and their values are computed by VSAM. The 4 byte RBA can only
be used when accessing within the first 4GB of a VSAM data set. The
8 byte RBA can be used to access beyond 4GB in an extended addressable
VSAM data set.
Notes:
- KSDS can also use RBAs. However, because the RBA of a KSDS record can change if an insert, delete or update operation is performed elsewhere in the file, it is not recommended.
- You can call
flocate()
with RBA values in an RRDS cluster, butflocate()
with RBA values does not work across control intervals. Therefore, using RBAs with RRDS clusters is not recommended. The RRDS access method does not support RBAs. z/OS® XL C/C++ supports the use of RBAs in an RRDS cluster by translating the RBA value to an RRN. It does this by dividing the RBA value by the LRECL. - Alternate indexes do not allow positioning by RBA.
The RBA value is stored in the C structure __amrc
,
which is defined in the C <stdio.h>
header
file. The __amrc->__RBA
field is defined as an
unsigned int, and therefore will contain only a 4-byte RBA value.
The __amrc->__XRBA
field is 8 bytes (unsigned
long long
in AMODE 31 applications, and unsigned
long
in AMODE 64 applications),
and therefore can hold the RBA for all locations within an extended
addressable VSAM data set.
You can access the field __amrc->
__RBA
,
as shown in< xref refid="gvs1">. This example code (CCNGVS1)
can be converted to use __amrc->__XRBA
with just
a few modifications. For more information about the __amrc
structure,
refer to Debugging I/O programs.