The CYLINDERS parameter in DEFINE CLUSTER specifies how much space to allocate for a VSAM cluster (or for its data or index component) in cylinders. You give a primary quantity (initial allocation) and an optional secondary quantity (amount added each time the dataset is extended). Space is allocated in control areas (CAs); typically one CA is one cylinder (or a multiple), and each CA holds multiple control intervals. So CYLINDERS drives how much DASD the cluster uses at creation and how it grows. This page explains CYLINDERS(primary secondary), where you can specify it (cluster, DATA, INDEX), how it compares to TRACKS and RECORDS, and practical considerations such as device limits and choosing primary and secondary.
CYLINDERS(primary [secondary]) tells the system to allocate space in cylinder units. Primary is the number of cylinders allocated when the cluster is first created. When the dataset fills that space and needs more, the system requests an extension of secondary cylinders (if you specified secondary). That extension can repeat until an extent limit (e.g. 16 extents per volume on some systems) or until there is no more room on the volume. So primary is "how much to start with" and secondary is "how much to add each time we run out." If you omit secondary, some systems use a default or allow only the primary allocation (no extension). Check your IDCAMS documentation.
You can specify CYLINDERS at the cluster level (applies to the whole cluster) or in the DATA and INDEX subparameters. At the cluster level, one value applies to the entire cluster; for a KSDS the system may split the space between data and index or use defaults for the index. For a KSDS it is common to specify CYLINDERS in both DATA and INDEX so the data component gets most of the space and the index gets a smaller amount (the index is usually much smaller than the data).
| Level | Effect |
|---|---|
| Cluster level | CYLINDERS(primary secondary) after the cluster name applies to the whole cluster. For a KSDS the space is split between data and index; for ESDS/RRDS it is all for the data component. Often you specify at DATA and INDEX instead for a KSDS. |
| DATA | In the DATA(NAME(...) CYLINDERS(primary secondary)) clause. Allocates space for the data component only. Use when you want to control data and index space separately (typical for KSDS). |
| INDEX | In the INDEX(NAME(...) CYLINDERS(primary secondary)) or INDEX(NAME(...) CYL(primary secondary)) clause. Allocates space for the index component. The index is usually much smaller than the data; a few cylinders are often enough. |
Primary is the initial allocation. Choose it based on how much data you expect to load soon. If you underestimate, the dataset will extend (using secondary) and you may get many small extents, which can affect performance. If you overestimate, you waste space. Secondary is the size of each extension. A larger secondary means fewer extensions but each extension is bigger. A smaller secondary means more extensions (and possibly hitting the extent limit). A common approach is to set secondary to half of primary or to a fixed value that matches your growth rate (e.g. CYLINDERS(100 50) for data).
VSAM allows you to specify space in cylinders, tracks, or records. Cylinders are the largest unit: one cylinder is many tracks (e.g. 15 tracks on a 3390). Tracks are smaller. RECORDS(primary secondary) lets you specify an estimated number of records; the system converts to tracks or cylinders using the record size and control interval size. The following table summarizes.
| Parameter | Use |
|---|---|
| CYLINDERS(primary secondary) | Space in cylinders. One cylinder is device-dependent (e.g. 15 tracks on a 3390, each track ~56 KB). Use for large datasets; allocation is efficient and easy to reason about. |
| TRACKS(primary secondary) | Space in tracks. One track is typically 56 KB or so on a 3390. Use for smaller datasets or when you need finer granularity than cylinders. |
| RECORDS(primary secondary) | Space derived from estimated record count. The system converts to tracks/cylinders using record size and CI size. Use when you think in terms of how many records you will store. |
The number of cylinders you can allocate on one volume depends on the device type. For example, a 3390 model 3 has about 3,330 usable cylinders per volume. If you need 6,000 cylinders for the data component, you cannot get that on one 3390-3 volume. You have two main options: (1) Use multiple volumes. Specify VOLUMES in the DATA (and INDEX) clause so the cluster can use more than one volume; primary and secondary are then spread across volumes or applied per volume depending on the implementation. (2) Use a smaller primary and secondary so that each extent fits on one volume (e.g. CYLINDERS(200 200) and list enough volumes). Consult your IDCAMS and SMS documentation for exact limits and behavior.
123456789DEFINE CLUSTER ( - NAME(MY.FILE.KSDS) - INDEXED - RECORDSIZE(100 200) - KEYS(10 0) - CYLINDERS(20 10)) - DATA (NAME(MY.FILE.KSDS.DATA)) - INDEX (NAME(MY.FILE.KSDS.INDEX))
Here CYLINDERS(20 10) at the cluster level allocates 20 cylinders initially and 10 per extension for the whole cluster. The system will assign space to the data and index components. For more control, specify CYLINDERS in DATA and INDEX separately.
12345678DEFINE CLUSTER ( - NAME(MY.FILE.KSDS) - INDEXED - RECORDSIZE(100 200) - KEYS(10 0)) - DATA (NAME(MY.FILE.KSDS.DATA) CYLINDERS(100 50)) - INDEX (NAME(MY.FILE.KSDS.INDEX) CYLINDERS(2 1))
The data component gets 100 cylinders primary and 50 secondary (for a large data component). The index component gets 2 cylinders primary and 1 secondary (the index is much smaller). This is a typical pattern for a KSDS: most space for data, a few cylinders for the index.
Space you allocate with CYLINDERS is formatted into control areas (CAs). Typically one CA is one cylinder (or a fixed number of cylinders depending on the device and CI size). Each CA contains multiple control intervals (CIs). So when you say CYLINDERS(10 5), you are allocating 10 cylinders, which become 10 CAs (in the typical case), and each CA holds as many CIs as fit in one cylinder. FREESPACE(ci-percent ca-percent) then reserves a percentage of each CI and each CA for inserts. So CYLINDERS determines how many CAs you get; CISZ and device geometry determine how many CIs per CA.
Imagine you are building a shelf. CYLINDERS is like saying "give me 10 boxes to start with, and when I run out, give me 5 more boxes each time." The first number (10) is how many boxes you get right away (primary). The second number (5) is how many extra boxes you get each time you need more (secondary). The boxes are like cylinders on the disk. For a big filing cabinet (data) you ask for lots of boxes; for the small index drawer (index) you ask for just a few boxes.
1. What does the second number in CYLINDERS(10 5) mean?
2. Where can you specify CYLINDERS in DEFINE CLUSTER?
3. Why might you use TRACKS instead of CYLINDERS?