*** Welcome to piglix ***

Count Key Data


Count key data (CKD) is a direct access storage device (DASD) data recording format introduced in 1964 by IBM with its IBM System/360 and still being emulated on IBM mainframes. It is a self-defining format with each data record represented by a Count Area that identifies the record and provides the number of bytes in an optional Key Area and an optional Data Area. This is in contrast to devices using fixed sector size or a separate format track.

Count key data (CKD) also refers to the set of channel commands (collectively Channel Command Words, CCWs) that are generated by an IBM mainframe for execution by a DASD subsystem employing the CKD recording format. The initial set of CKD CCW introduced in 1964 was substantially enhanced and improved into the 1990s.

The principle of CKD records is that since data record lengths can vary, they all have an associated count field which identifies the record and indicates the size of the key, if used (user-defined up to 255 bytes), and the size of the data area, if used. The count field has the identification of the record in cylinder-head-record format, the length of the key, and the length of the data. The key may be omitted or consist of a string of characters.

Each CKD record consists of a count field, an optional key field, and an optional "user" data field with error correction/detection information appended to each field and gaps separating each field. Because of the gaps and other information, the recorded space is larger than that required for just the count data, key data, or user data.

Most often, the key is omitted, the record located sequentially or by direct cylinder-head-record addressing. If it is present, the key is typically a copy of the first n bytes of the data record (for "unblocked" records, or a copy of the highest key in the block, for "blocked" records), but can be any data which will be used to find the record, usually using the Search Key Equal or Search Key High or Equal CCW. The key (and hence the record) is locatable via hardware commands. Since the introduction of IBM's System/360 in 1964, nearly all IBM large and intermediate system DASDs have used the count key data record format.

The advantages of count key data record format are:

Reduced CPU and memory prices and higher device and interface speeds have somewhat nullified the advantages of CKD, and it is retained only because IBM's flagship operating system z/OS does not support sector-oriented interfaces.


...
Wikipedia

...