• Aucun résultat trouvé

CONTROL INTERVALS

Dans le document Program Product (Page 22-25)

Relative Relative Relative Relative Control

Record 3 Record 5 Record 6 Record 9

Informa-tion

Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 Slot 8 Slot 9

Figure 3. The First Control Interval within a Relative Record Data Set

CONTROL INTERVALS

Records in a relative record data set are grouped together in control intervals. Each control interval contains the same number of slots; the size is the record length specified when defining the data set. The number of slots in a control interval is determined by the control interval size and the record length.

Because the slot can contain data or be empty, a data record can be inserted, deleted, or moved without affecting the position of other data records in the relative record data set. Records can be retrieved sequentially or directly, based on its relative byte address (RBA).

Additional information about processing relative record data sets appears under "Processing VSAM Data Sets" on page 15.

VSAM stores the records of each type of data set in a a control interval. A control interval is a continuous area of auxiliary storage that VSAM uses to store data records and the control information that describes the records. The control interval is the unit of information VSAM transfers between virtual and auxiliary storage. The size may vary from one data set to another, but, for a given data set, the size of each control

interval is fixed, either by VSAM or by you, within limits acceptable to VSAM. VSAM chooses the size based on the type of direct access storage device used to store the data set, the size of your data records, and the smallest amount of virtual storage space your processing program provides for VSAM's I/O buffers.

The information recorded on a track is divided into physical records that are limited by the capacity of a track. The physical-record sizes that VSAM uses begin at 512 bytes and increases by powers of 2 up to 4096 bytes: 512, 1024, 2048,

4096. Control interval size is limited by the requirements that it be a whole number of physical records (1, 2, 3, ..• , up to 64, or a maximum size of 32 768 bytes). If it is greater than 8192 bytes, it must be a multiple of 2048. A data set whose control intervals correspond with the tracks of one device might have more or less than one control interval per track if it were stored on a different device. Figure 4 illustrates the

independence of control intervals from physical records.

When you define a data set and specify track allocation or

specify record allocation requiring less than one cylinder, VSAM uses track allocation.

Control Interval Control Interval Control Interval

Physical Records

Track 1 Track 2 Track 3

Control I nterva I Control Interval Control In terval

I I I I I I

Track 1 Track 2 Track 3 Track 4

Figure 4. Control Intervals Are Independent of Physical Record Size

A volume may contain areas for VSAM's use and areas for use by other access methods or the operating system. A storage area defined in the volume table of contents for VSAM's exclusive use

is called a data space. Each data space on a volume has one or more DSCBs and a unique name.

A data set is stored in a data space or data spaces on one or more volumes on direct access devices of the same type. When you define a data set, you can allocate enough space so some is left at the end of the data set for additions. For new data sets, the amount requested must be available, or DEFINE will terminate. Otherwise, when additional space is needed, VSAM automaticallY extends the data set by the amount of space

indicated in the definition of the data set in the catalog. It can be extended beyond its original size up to 123 extents, or to a maximum size of 232 (approximately 4 290 000 000) bytes.

A data set is made up of control intervals. A group of control intervals makes up a control area. A control area is the unit of a data set that VSAM preformats for data integrity as records are added to the data set. In a key-sequenced data set, control areas are also used for distributing free space throughout the data set as a percentage of control intervals in a control area and for placing portions of the index next to the data set.

The number of control intervals in a control area is fixed by VSAM, with a minimum of two. If 50 were the number chosen, for example, the first 50 control intervals would be the first control area; the next 50 would be the second control area, and so on. Whenever the space for a data set is extended, it is extended by a whole number of control areas. For a

key-sequenced data set, the size of a control area is determined

by the space allocation request, user-specified or default index and data control interval size, and available buffer space.

RECORDS STORED IN A CONTROL INTERVAL

The records of a key-sequenced or entry-sequenced data set may be fixed or variable in length; the records of a relative record data set are always fixed in length. VSAM treats them all in the same way. It puts control information at the end of a control interval to describe the data records stored in the control interval. The combination of a data record and its control information, though they are not physically adjacent, is called a stored record. When adjacent records are the same length, they share control information. Figure 5 shows how data records and control information are stored in a control

interval. The data records are stored at the beginning of a control interval, and control information at the end. For

further information on control interval, see "Chapter 6. Options for Advanced Applications" on page 81.

Control Interval

Data Data Data Data Data Data Control

Record Record Record Record Record Record Information

Figure 5. Placement of Data Records and Control Information in a Control Interval

When you define a data set, you should specify enough buffer space so the control intervals in the data set are large enough for the largest stored record.

Key-sequenced and entry-sequenced data set records whose lengths exceed control interval size may cross, or span, one or more control interval boundaries. Such records are called spanned records. A spanned record always begins on a control interval boundary and fills one or more control intervals within a single control area. As shown in Figure 6 on page 11, the control interval that contains the last segment of a spanned record can contain unused space. This free space can be used only to extend the spanned record; it cannot contain all or part of any other record. You must specify your intent to use spanned records when you define the data set.

.... ~ __ - - - Control Area - - - /

Control Interval (CI)

Unused Space

Unused Space

Figure 6. Control Intervals That Contain Spanned Records

A data record is addressed not by its location in terms of the physical attributes of the storage device (such as the number of tracks per cylinder), but by its displacement, in bytes, from the beginning of the data set, called its relative byte address (RBA). The RBA does not depend on how many extents belong to the data set or whether they are in different data spaces or on different volumes. For relative byte addressing, VSAM considers the control intervals in the data set to be contiguous, as

though the data set were stored in virtual storage beginning at address

o.

For example, the first record in a data set has RBA

o.

The second record has an RBA equal to the length of the first record, and so on. The bytes required for intervening control information and free space are included in the RBA value.

Dans le document Program Product (Page 22-25)