Thursday, December 8, 2011

VSAM: Info about ESDS files


Records are only added at the end of the data set. Existing records cannot be deleted. If you want to delete a record, you must flag that record as inactive. As far as VSAM is concerned, the record is not deleted. Records can be updated, but they cannot be lengthened. To change the length of a record in an entry-sequenced data set, you must store it either at the end of the data set (as a new record) or in the place of a record of the same length that you have flagged as inactive or that is no longer required.

When a record is loaded or added, VSAM indicates its relative byte address (RBA). The RBA is the offset of this logical record from the beginning of the data set. The first record in a data set has an RBA of 0; the second record has an RBA equal to the length of the first record, and so on. The RBA of a logical record depends only on the record's position in the sequence of records. The RBA is always expressed as a fullword binary integer.

Although an entry-sequenced data set does not contain an index component, alternate indexes are allowed. You can build an alternate index to keep track of these RBAs.  

If a CICS transaction writes records to an ESDS file, and that transaction abends, then the written records cannot be backed out, as VSAM does not support "delete" on the ESDS files. This is the main reason for using ESDS files as "log files" in CICS regions. 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.