How do I add a record to a existing VSAM RRDS file?

Document ID : KB000026805
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction: 

Adding records to VSAM RRDS file

 

Question: 

How do I add a record to an existing VSAM RRDS file?

 

Environment:  

Easytrieve all supported releases and environments

 

Answer: 

To add records to VSAM RRDS file:

  1. Define a KEY as a 4 byte binary field
  2. Use the POINT and PUT functions.

Example:

DEFINE REC-CNT S  4  B  VALUE xxx - (xxx is 1 greater than the current number of records on file)

POINT RRDSFILE GE REC-CNT STATUS  (check status)

PUT RRDSFILE

STATUS (check status)

REC-CNT = REC-CNT + 1 (loop back to point and put for next record)