When an ESDS is read with addressed direct access, records
are retrieved directly by the address relative to the beginning of
the data set (relative-byte address). For this type of access to be
useful, you must know the RBAs of the records that you want to access.
You might know the RBA if it has some relationship to the record contents
or if you have obtained it (for example, from the _RBA_ automatic
variable in a previous SAS DATA step).
To use addressed direct
access, specify the RBA= option in the INFILE statement for the VSAM
data set that is to be accessed by RBA. The RBA= option defines a
variable whose value must be set to the RBA of the logical record
or control interval to be retrieved by an INPUT statement. The address
that you specify must correspond to the beginning of a data record
(logical record or control interval). Otherwise, the request is invalid
and causes a VSAM logical error.
The following program
illustrates addressed direct access to an ESDS:
data one;
infile myesds vsam;
input;
rbanum =_rba_;
keep rbanum;
run;
data two;
set one;
infile myesds vsam rba=rbanum;
input;
...more SAS statements...