Easytrieve RRDS File Processing

VSAM Relative Record Data Sets (RRDS) model data as numbered slots in a fixed-size table. Slot 1, slot 2, slot 47—each position holds one fixed-length record or remains empty until written. Easytrieve declares RRDS with FILE file-name RELATIVE, optionally UPDATE for rewrite and delete paths. This organization suits rate tables indexed by day-of-year, disk allocation maps, and legacy applications where the record number is the business key. Unlike KSDS, there is no separate index component keyed by employee number; the relative record number (RRN) is the address. Unlike ESDS, you can read and rewrite slot 100 without scanning slots 1–99. Beginners often confuse RELATIVE on FILE with relative byte positions in DEFINE—that is a different topic. This page teaches RRDS catalog concepts, FILE RELATIVE parameters, direct slot access, sequential browse through slots, sparse files, CREATE sizing, FILE-STATUS on empty slots, and when operations choose RRDS instead of INDEXED masters.

Progress0 of 0 lessons

RRDS on z/OS and the Easytrieve RELATIVE Keyword

IDCAMS DEFINE CLUSTER with NUMBERED YES creates RRDS. MAXRECORDS or equivalent sizing sets how many slots exist. Each slot is the same record length—variable-length RRDS is not the VSAM model. Easytrieve FILE RATES RELATIVE UPDATE FB(50 500) names the file, selects relative organization, permits update, and fixes record length at 50 bytes. Fields in the FILE section overlay every slot uniformly. JCL DD points at the RRDS cluster; DISP=SHR for read, UPDATE for rewrite jobs. The product opens with relative access methods when RELATIVE is coded; omitting RELATIVE on an RRDS DD causes organization mismatch errors similar to coding INDEXED on ESDS.

FILE Declaration Example

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FILE DAILY-RATE RELATIVE UPDATE FB(20 200) DAY-NO 1 3 N RATE-VALUE 4 5 P 2 DEFINE SLOT-NO 3 N JOB INPUT NULL NAME PROCESS-DAYS PROCESS-DAYS. PROC DO DAY = 1 TO 366 MOVE DAY TO SLOT-NO MOVE DAY TO DAY-NO READ DAILY-RATE RECORD SLOT-NO STATUS IF DAILY-RATE-PRESENCE PRINT DAY-NO RATE-VALUE END-IF END-DO END-PROC

Pseudocode illustrates direct slot access: for each calendar day 1–366, position at slot DAY and READ. Exact READ grammar for relative record numbers follows your Language Reference release—some sites use MOVE slot to a key field then READ file. Test STATUS and file-presence constants before PRINT because empty slots may not contain business data. UPDATE allows rewriting RATE-VALUE when loading the table from a maintenance program.

RRDS Versus KSDS Versus ESDS

VSAM organizations in Easytrieve
VSAM orgFILE typeHow you address a row
ESDSSEQUENTIALSequential order—next GET
KSDSINDEXEDPrimary key in record—READ key
RRDSRELATIVESlot number 1–n—direct RRN

Pick RRDS when the application already numbers entities 1 to MAX and empty slots are acceptable. Pick KSDS when keys are alphanumeric or non-dense. Pick ESDS for append-only logs. Easytrieve can reference all three in one program with separate FILE statements and distinct DD names.

Sequential Browse of RRDS

GET on RELATIVE file walks slots in ascending record number from the current position, similar to sequential browse on INDEXED. START may position at a slot before GET loops. JOB INPUT on RELATIVE with UPDATE in batch walks slots with hold semantics per FILE UPDATE rules. Use JOB INPUT NULL when you must mix direct READ of scattered slots with other files in one activity—see multiple-files tutorial. EOF on RRDS means past the highest defined slot in browse context, not necessarily every intermediate slot was filled.

WRITE, DELETE, and Sparse Tables

WRITE into slot n creates or replaces that slot's record. DELETE clears a slot per VSAM rules. Sparse files have holes: slots 1, 5, and 99 written while 2–4 are empty. Reporting jobs must not assume continuity. Some applications store an active flag in the record to distinguish never-written slots from deleted business rows. DUPLICATE is a KSDS concern; RRDS instead fights reading empty slots as valid rates or quantities.

CREATE and Sizing

text
1
2
3
FILE NEWTAB RELATIVE CREATE FB(100 1000) TAB-ROW 1 3 N TAB-DATA 4 96 A

CREATE builds a new relative file when the program runs. Catalog MAXRECORDS must accommodate highest slot you will WRITE. Undersized clusters fail when you WRITE slot 50000 but only 1000 slots exist. Operations often pre-allocate RRDS in IDCAMS; Easytrieve CREATE suits smaller tables. RESET behavior matches FILE CREATE rules for VSAM REUSE on mainframe batch.

Fixed Length Requirement

RRDS requires fixed record length. Use FB on FILE with explicit length matching IDCAMS RECORDSIZE. VB and VBS are for sequential organizations, not RRDS slots. WORKAREA and BUFNO still apply for tuning but do not change slot geometry. Field definitions must fit within the fixed LRECL—overflow fields truncate or fail compile depending on checks.

FILE-STATUS on Relative I/O

STATUS on READ, GET, WRITE populates FILE-STATUS. Empty slot reads may return specific VSAM codes documented for your release—trap them before arithmetic on RATE-VALUE. NOTFOUND and EOF constants apply in IF procedures. Indexed and relative file functions chapter lists helpers parallel to KSDS processing. Logging failing slot numbers on SYSPRINT accelerates table load debugging.

Legacy VS F and RELATIVE

Legacy FILE VS (F ...) meant fixed-length VSAM in older manuals; RELATIVE is the modern FILE type for RRDS. Migrated sources may still compile VS forms; new development should standardize on RELATIVE UPDATE CREATE keywords for clarity in code reviews.

Common RRDS Mistakes

  • FILE INDEXED on RRDS cluster DD.
  • Variable VB record format on RELATIVE FILE.
  • Treating empty slot as zero rate without status test.
  • Slot number 0—RRDS slots start at 1 in VSAM convention.
  • MAXRECORDS too small for highest WRITE slot.
  • Confusing RELATIVE FILE type with relative field positions in DEFINE.

Testing RRDS Programs

  1. LISTCAT cluster—confirm NUMBERED organization.
  2. WRITE known slots; READ back each; verify fields.
  3. READ empty slot; confirm error or flag path, not garbage math.
  4. Browse with GET from slot 1; count slots with active flag.
  5. Match FB length to IDCAMS RECORDSIZE exactly.

Explain It Like I'm Five

An RRDS is a row of numbered mailboxes. Mailbox 1, mailbox 2, up to the last box. Each box is the same size. You open box 17 directly when you know the number—you do not walk from box 1 every time. Some boxes are empty until you put a letter in. Easytrieve RELATIVE on FILE tells the computer you are using numbered boxes, not a single long line (ESDS) or a name catalog (KSDS).

Exercises

  1. Declare RELATIVE UPDATE table with 20-byte fixed records.
  2. Write pseudocode to READ slots 1–31 for a monthly calendar table.
  3. Explain sparse RRDS to a beginner with an example of slots 1 and 5 only.
  4. Compare when your shop would pick RRDS versus INDEXED for a rate file.
  5. List FILE-STATUS tests needed before using slot data in a total.

Quiz

Test Your Knowledge

1. VSAM RRDS in Easytrieve uses FILE type:

  • RELATIVE
  • INDEXED only
  • SQL
  • PRINTER

2. RRDS records are identified primarily by:

  • Relative record number (slot position)
  • Alphabetic primary key only
  • SQL rowid
  • JCL jobname

3. An empty RRDS slot may read as:

  • Low-values or undefined per VSAM rules; test status
  • Always EOF entire file
  • Printer skip
  • MACRO error

4. RELATIVE differs from INDEXED because:

  • No separate key index—position is the key
  • Only supports SQL
  • Cannot use WRITE
  • Requires GDG JCL

5. FILE UPDATE on RELATIVE allows:

  • Rewrite and delete in numbered slots when authorized
  • Only SYSPRINT
  • Only INSTREAM tables
  • Skipping Library
Published
Read time17 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 FILE RELATIVE RRDS processingSources: Broadcom Easytrieve 11.6 Language Reference FILE RELATIVE, File Processing ModesApplies to: Easytrieve RRDS and RELATIVE VSAM processing