Now we can write a program to read and dump some records from our DASD volume. Because I formatted the volume there should be three data records on Cylinder zero, Track zero (R1,R2, and R3). Record 3 is the Volume Label record and will have the address of the Volume Table Of Contents (VTOC).
The Volume Record has a 4-byte key and an 80-byte data area. We are only concerned with the following data fields:
Key: CL4 'VOL1' Data: CL4 'VOL1' CL6 volser CL1 XL5 vtoc address (cchhr)
The VTOC is a special file that describes the data sets and free space on the volume. The records in the VTOC are called Data Set Control Block (DSCB) records. Each record consists of a 44-byte key and a 96-byte data area. There are six different types of DSCB records (Format 1 through Format 6).
- Format 1 DSCB – Describes a data set
- Format 2 DSCB – Describes characteristics of an ISAM data set
- Format 3 DSCB – Describes additional extents of a data set
- Format 4 DSCB – Describes the VTOC data set
- Format 5 DSCB – Describes free space
- Format 6 DSCB – Shared cylinder allocation
The first DSCB is always a Format 4. The 44-byte key contains a special string of characters x’040404….04′ which identifies it as the FMT4 DSCB. Data of interest to us include:
- DS4HPCHR – Highest Address of a Format 1 DSCB
- DS4DEVSZ – Cylinders/Device & Tracks/Cylinder
- DS4DEVTK – Device Track Length
- DS4DEVDT – Number of DSCB’s per Track
- DS4DEVDB – Number of Directory Blocks per Track
- DS4VTOCE – VTOC Exten Description
This information will allow us to read the VTOC and find other data sets located on this volume.
[Next – DISK1 Program]