The following figure illustrates the bit vector for sets and subsets.
Understanding Set and Subset Bit Vectors
One bit exists in the bit vector for each record in the data set. Each bit has an implicit positional relationship with one data set record. For instance, bit 47 of word 0 corresponds to record 0, bit 46 corresponds to record 1, and so on. A bit has the value 1 if the corresponding data set record belongs to the set or subset; it has the value 0 if the corresponding record is deleted or does not belong to the set or subset.
Bit Vector Restrictions
The following restrictions apply to bit vectors:
-
Bit vectors can refer only to standard data sets with fixed-format records.
-
Bit vectors must be disjoint.
-
FIND AT and FIND KEY operations are not allowed.
-
Key data is not allowed.
-
Bit vectors cannot refer to sectioned data sets.
The restrictions on bit vectors are for the following reasons:
-
Disk space utilization depends upon the ratio of included to excluded data set records. However, since 48 entries are contained in each word, disk space utilization is seldom a problem.
-
Set or subset modification is normally extremely fast. The address of the data set record is used to compute a block, word, and bit address in the bit vector. The resulting block is read, and the appropriate bit is set or reset as necessary. However, accessing a bit beyond the current end of file causes the file to be extended. The extension includes blocks containing binary zeros up to and including the block the new bit is to reside in. Therefore, access is most efficient when entries are added in the current range of the file.
-
FIND NEXT and FIND PRIOR operations access the file sequentially. Many zero entries have to be skipped if there are relatively few data set records belonging to the set or subset. However, many bits are examined for each physical read.