Module 2: VSAM Concepts
RRDS- Relative Record Data Sets
- Data records in RRDS organized into the pre-formatted fixed length slots. One record occupies a slot.
- RRDS have only data component
- VSAM determines the number of slots by:- Size of Control Interval and Length of a Record.
- Records are accessed by their position in the file relative to the first record. The relative position of each slot is called as Relative Record Number (RRN).
- Thus, each slot has a unique RRN. These slots are sequenced by ascending RRN. RRN of any slots cannot be changed.
- RRDS records can be access randomly by RRN, or sequentially.
- RRDS dataset doesn’t support alternate index
- RRDS allows storing of only fixed length records
- RRDS records can be deleted or updated. In case of deletion, the empty slot after record deletion can be used for subsequent insertion.
- RRDS records are device-independent
- RRDS does not allows spanned records
- For RRDS datasets, we must code NUMBERED inside the DEFINE CLUSTER command. This will be explained further in upcoming article here
- Like other files, RRDS can be used in COBOL. For this, we can specify the name of the file in JCL and we can use it inside COBOL program for processing. To use RRDS file in COBOL program, specify file organization as RELATIVE and access mode can be specified as SEQUENTIAL, RANDOM or DYNAMIC
Internal organization of RRDS
- RRDS consists of fixed size slot as shown above. The empty slots can be used for subsequent insertion. Records in RRDS is accessible using RRN
- In RRDS, RDF shows whether slot is occupied or empty.
- RRDS can be accessed sequentially or randomly by passing RRN as a key. VSAM calculates RBA and accesses the appropriate record or slot.