11.01.2013 Views

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.32 VSAM: Control interval (CI)<br />

LR1 LR2 LRn<br />

LR = Logical record<br />

RDF = Record definition field<br />

CIDF = Control interval definition field<br />

LR1<br />

100<br />

bytes<br />

LR2<br />

100<br />

bytes<br />

LR3<br />

100<br />

bytes<br />

Figure 4-42 Control interval format<br />

Control interval (CI)<br />

The control interval is a concept that is unique to VSAM. A CI is formed by one or several<br />

physical records (usually just one). It is the fundamental building block <strong>of</strong> every VSAM file. A<br />

CI is a contiguous area <strong>of</strong> direct access storage that VSAM uses to store data records and<br />

control information that describes the records. A CI is the unit <strong>of</strong> information that VSAM<br />

transfers between the storage device and the main storage during one I/O operation.<br />

Whenever a logical record is requested by an application program, the entire CI containing<br />

the logical record is read into a VSAM I/O buffer in virtual storage. The desired logical record<br />

is then transferred from the VSAM buffer to a user-defined buffer or work area (if in move<br />

mode).<br />

Based on the CI size, VSAM calculates the best size <strong>of</strong> the physical block in order to better<br />

use the 3390/3380 logical track. The CI size can be from 512 bytes to 32 KB. A CI contents<br />

depends on the cluster organization. A KSDS consists <strong>of</strong>:<br />

► Logical records stored from the beginning to the end <strong>of</strong> the CI.<br />

► Free space, for data records to be inserted into or lengthened.<br />

► Control information, which is made up <strong>of</strong> two types <strong>of</strong> fields:<br />

– One control interval definition field (CIDF) per CI. CIDF is a 4-byte field. CIDF contains<br />

information about the amount and location <strong>of</strong> free space in the CI.<br />

162 <strong>ABCs</strong> <strong>of</strong> z/<strong>OS</strong> <strong>System</strong> <strong>Programming</strong> <strong>Volume</strong> 3<br />

Control Interval Format<br />

FREE SPACE<br />

R<br />

D<br />

Fn<br />

Contigous records <strong>of</strong><br />

the same size<br />

LR4<br />

LRn 150<br />

bytes<br />

LR5<br />

100<br />

bytes<br />

FREE<br />

SPACE<br />

R<br />

D<br />

F4<br />

3 bytes<br />

R<br />

D<br />

F2<br />

R<br />

D<br />

F1<br />

Control information fields<br />

R<br />

D<br />

F3<br />

R<br />

D<br />

F2<br />

R<br />

D<br />

F1<br />

C<br />

I<br />

D<br />

F<br />

C<br />

I<br />

D<br />

F<br />

4 bytes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!