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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.35 VSAM: Processing a KSDS cluster<br />

Index<br />

Component<br />

Data<br />

Component<br />

H<br />

D<br />

R<br />

Application: GET record with key = 23<br />

7 11 14 21 26 38<br />

2 5 7<br />

8 9<br />

12 13 14<br />

15 16 19<br />

22 23 26<br />

31 35 38<br />

HDR 38 67<br />

Control<br />

Interval Control Area Control Area Control Area<br />

Figure 4-45 Processing an indexed VSAM cluster: Direct access<br />

H<br />

D<br />

R<br />

43 50 54 57 64 67<br />

39 41 43<br />

44 45 46<br />

51 53 54<br />

55 56 57<br />

58 61 62<br />

65 66 67<br />

HDR 67 95<br />

Application<br />

Processing a KSDS cluster<br />

A KSDS has an index that relates key values to the relative locations in the data set. This<br />

index is called the prime index. It has two uses:<br />

► Locate the collating position when inserting records<br />

► Locate records for retrieval<br />

When initially loading a KSDS data set, records must be presented to VSAM in key sequence.<br />

This loading can be done through the IDCAMS VSAM utility named REPRO. The index for a<br />

key-sequenced data set is built automatically by VSAM as the data set is loaded with records.<br />

When a data CI is completely loaded with logical records, free space, and control information,<br />

VSAM makes an entry in the index. The entry consists <strong>of</strong> the highest possible key in the data<br />

control interval and a pointer to the beginning <strong>of</strong> that control interval.<br />

When accessing records sequentially, VSAM refers only to the sequence set. It uses a<br />

horizontal pointer to get from one sequence set record to the next record in collating<br />

sequence.<br />

Sequence<br />

Set<br />

Request for data direct access<br />

When accessing records directly, VSAM follows vertical pointers from the highest level <strong>of</strong> the<br />

index down to the sequence set to find vertical pointers to the requested logical record.<br />

Figure 4-45 shows how VSAM searches the index when an application issues a GET for a<br />

logical record with key value 23.<br />

H<br />

D<br />

R<br />

HDR 95<br />

71 75 78 85 92 95<br />

68 69<br />

72 73 74<br />

76 77 78<br />

79 80 85<br />

86 89<br />

93 94 95<br />

Index<br />

Set<br />

Chapter 4. Storage management s<strong>of</strong>tware 167

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

Saved successfully!

Ooh no, something went wrong!