z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Entry-Sequenced Data Sets

z/OS DFSMS Using Data Sets
SC23-6855-00

An entry-sequenced data set is comparable to a sequential (non-VSAM) data set. It contains records that can be either spanned or nonspanned. As Figure 1 shows, records are sequenced by the order of their entry in the data set, rather than by a key field in the logical record.
Figure 1. Entry-Sequenced Data Set

Records are added only 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 value of the RBA for the second and subsequent records depends on whether the file is spanned and on the control interval size chosen for the file, either manually or automatically. In general, it is not possible to predict the RBA of each record, except for the case of fixed-length records and a known control interval size. For a more detailed description of the internal format of VSAM files, see VSAM Data Formats.

You build an alternate index to keep track of these RBAs. Although an entry-sequenced data set does not contain an index component, alternate indexes are permitted. See Defining Alternate Indexes. Figure 2 shows the record lengths and corresponding RBAs for the data set shown in Figure 1.

Figure 2. Example of RBAs of an entry-sequenced data set
Example of RBAs of an entry-sequenced data set

Table 1 lists the operations and types of access for processing entry-sequenced data sets.

Table 1. Entry-sequenced data set processing
Operation Sequential Access Direct Access
Loading the data set Yes No
Adding records Space after the last record is used for adding records No
Retrieving records Yes (returned in entry sequence) Yes (by RBA)
Updating records Yes, but you cannot change the record length Yes (by RBA), but you cannot change the record length
Deleting records Records cannot be deleted, but you can reuse its space for a record of the same length Records cannot be deleted, but you can reuse its space for a record of the same length

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014