Volume Table of Contents
In the IBM mainframe storage architecture, Volume Table of Contents, or VTOC, is a data structure that provides a way of locating the data sets that reside on a particular disk volume. It is the functional equivalent of both the master boot record or GUID Partition Table on a desktop PC, and the root directory of a mass storage device (floppy, jump drive, hard disk, etc.) on a PC or minicomputer, e.g. / on Unix or Linux, C:\ on MS-DOS or Microsoft Windows. It lists the names of each data set on the volume as well as size, location, and permissions. Additionally, it contains an entry for every area of contiguous free space on the volume. The third record on the first track of the first cylinder of any volume of DASD (i.e. disk pack) is known as the volume label and must contain a pointer to the location of the VTOC. A VTOC is added to a disk when it is initialized using the Device Support Facilities utility program, ICKDSF. VTOC was originally designed for removable disk packs.
To locate a data set, a program will generally interrogate a z/OS catalog to find the volume where the data set resides. Having found the correct volume, the VTOC is searched to find out where on the disk the data set is stored.
The VTOC consists of a sequence of 140-byte records known as Data Set Control Blocks, or DSCBs. There are ten types of DSCB.
|DSCB format type||Purpose||Notes|
|1||Data set primary||Describes first three extents of a data set|
|2||ISAM data set||Describes ISAM data sets|
|3||Data set extension||Describes data set extents after the third|
|4||VTOC||Describes volume attributes|
|5||Free space||26 extents on non-index volumes|
|6||Shared Cylinder Allocation||In OS/360, Format 6 DSCB is used for "Shared Cylinder Allocation", which enabled multiple datasets to be interleaved across a range of cylinders (such that, for example, the first half of each cylinder was allocated for data set A, and the second half for data set B). This was intended as a performance optimisation to reduce disk head movement when two or more datasets were expected to be used simultaneously. In current releases of z/OS, shared cylinder allocation format 6 DSCB is no longer supported.|
|7||Free space||Extension of Format 4 DSCB|
|8||Data set primary||EAV[note 1] version of Format 1 DSCB|
|9||Data set extension||EAV extension of Format 3 DSCB|
The VTOC must reside within the first 64K tracks on the volume, and The first DSCB in the VTOC is always a format 4 DSCB which describes the VTOC itself and attributes of the disk volume on which this VTOC resides. The second DSCB is always a format 5 DSCB which describes free space within the VTOC. Normally, the rest of the VTOC will contain format 0 DSCBs, which are empty entries, and format 1 or format 3 DSCBs, which describe the "extents" of data sets, giving their start address and end address of up to 16 such "extents" on disk. The initial part of a data set is described by a format 1 DSCB. If necessary, format 3 DSCBs are used to describe further "extents" of the data set. When a data set is deleted, its format 1 DSCB is overwritten to become a format 0 DSCB, and the format 3 DSCB, if one exists, is similarly deleted.
Originally, a VTOC search was a sequential scan of the DSCBs, stopping when the correct format 1 DSCB was found or the end of the VTOC was reached. As disk volumes became larger, VTOC search became a bottleneck and so a VTOC index was added.
Format 1 DSCB
|0||44||Dataset name, left-adjusted and space-filled
this is the DSCB record key.
|44||1||Format identifier, '1' for Format-1 DSCB (character)|
|45||6||Volume serial number of first DASD volume fot this dataset (alphanumeric)|
|51||2||Volume sequence number of this volume for multi-volume datasets (binary)|
|53||3||Dataset creation date (binary) one byte for year of century and two bytes for day-of-year|
|56||3||Dataset expiration date (same format as creation date)
99365 indicates that this dataset will never expire.
|59||1||Number of extents for this dataset (binary)|
|60||1||If this dataset is a partitioned dataset this is the number of bytes used in the last directory block. (binary)|
|61||1||Unused, listed as "reserved" by IBM.|
|62||13||Code identifying the operating system that created this dataset. (character)|
|75||7||Unused, listed as "reserved" by IBM.|
|82||2||Code indicating "dataset organization" (sequential, indexed, etc.) (bitfield)|
|84||1||Code indicating the "record format" of this dataset (fixed, variable, etc.) (bitfield)|
|85||1||"Option code", other options specified when the dataset was created (bitfield)|
|86||2||Block size (fixed size, or maximum size for files of variable-length records) (binary)|
|88||2||Record length (fixed size or maximum length for variable length records) (binary)|
|90||1||Key length if this file has recorded record keys. (binary)|
|91||2||Position of the key (if any) in the record relative to zero. (binary)|
|93||1||Indicator bits, for example indicating that the dataset is password-protected. (bitfield)|
|94||4||Dataset allocation parameters, indicating, for example that space for this dataset is to be allocated in blocks, cylinders, etc. (bitfield)|
|95||3||Secondary allocation quantity: Amount of blocks, cylinders, etc. to be allocated if additional space is required. (binary)
For example, if the dataset is created with the DD card specification
|98||3||Disk address of last block written in the dataset.|
|101||2||Number of bytes remaining on last track following last block indicated above. (binary)|
|103||2||Unused, listed as "reserved" by IBM.|
|105||10||Description of first or only extent.
Type of extent (one byte, bitfield),
extent sequence number (one byte, binary),
extent starting cylinder and track (four bytes, binary),
extent ending cylinder and track (four bytes, binary).
|115||10||Description of possible second extent, same format as above.|
|125||10||Description of possible third extent, same format as above.|
|135||5||Pointer to Format-2 (index) DSCB in VTOC in format cylinder/head/record if this is indexed dataset.
Pointer to Format-3 (extension) DSCB if this dataset has more than three extents.
- Extended Address Volume, a volume with more than 65,520 cylinders.
- IBM Corporation, IBM System/360 Operating System: System Control Blocks, C28-6628-3, November 1968, page 143; IBM Corporation, IBM System/360 Operating System: Utilities, GC28-6586-11, June 1970, page 114
- The VTOC has a dataset name as the VTOC is, indeed, a dataset; the VTOC's dataset name is (44) X'04' characters, which, in later instances of the OS, has become a protected name, one which may not be specified by the programmer.
- Each "extent" is described by a starting CCHH and an ending CCHH, relative to the beginning of the disk, which is CCHH=x'00000000'.
- IBM Corporation (April 1973). IBM System/360 Operating System: System Control Blocks (PDF). pp. 170–173. Retrieved August 1, 2016.