CKD DASD
Count-key-data (CKD) is the mainframe disk track format in which each record has a count area, an optional key area and a data area instead of a fixed-size sector.
Each CKD track starts at an index point and a home address that identifies the track and its status, followed by record zero (R0), a track descriptor record without a key. Every later record has a count area, an optional key area and a data area, separated by gaps and protected by checking information. The count area holds the record identifier CCHHR (cylinder, head, record) and the key and data lengths. If the home address flags a track as defective, record zero holds the address of the alternate track, whose record zero points back. [2]
A 1974 manual describes an eleven-byte count area of flag, cylinder, head, record number (1 to 255), key length (1 byte), data length (2 bytes) and cyclic check. Keys run from 1 to 255 bytes, count-data records have key length 0, data can reach 65,535 bytes in theory, and record zero has key length 0 and data length 8. [3] Emulator disk images use an 8-byte count field (CC, HH, R, KL, DL) followed by key and data, with eight FFh bytes marking end of track. [4]
For the removable-pack disks in that manual, a track holds at most 13,030 data bytes and a 19-track cylinder 247,570 bytes, which needs one unkeyed record per track, because each extra record adds markers, a count area and gaps. Gap lengths differ per device, so each device has its own capacity formula. Unkeyed 200-byte records fit 28 per track, about 43% of the maximum, and 200-byte records with 8-byte keys fit 13, about 20%. [3]
Relations
- related
- Mainframe DASD, FICON
Advantages
- The key area lets a record be located by its key rather than only by its position on the track. [3]
Limitations
- Records are addressed by physical cylinder, head and record number, which ties data set layout to device geometry. [2, 3]
Citations
- Volume layout and record formats on CKD devices, z/OS 3.1 documentation
- Introduction to IBM Direct-Access Storage Devices and Organization Methods, GC20-1649-8
- cckd(4): Hercules Compressed CKD DASD image file
Further reading
Sources & caveats
- c2 is IBM z/OS 3.1 documentation; c3 is IBM manual GC20-1649-8 (February 1974), read as a scan on bitsavers.org.
- c4 is Hercules emulator documentation (2003), not a standard; no independent standard for the format was found.
- Capacity figures in c3 are for an early-1970s device generation, not current devices.
- Emulation of CKD geometry on current storage subsystems is not described by the cited documents.
- Arithmetic: 28 x 200 = 5,600 bytes (43% of 13,030); 13 x 200 = 2,600 bytes (20%).