Search code examples
mainframevsam

How to calculate space allocated to VSAM files


I am creating a tool which will estimated space should be given to the VSAM file based on number of records, record length and block size parameters. While going through different sources on internet I got an article on IBM website about space calculation as follows but I didn't understood some information like, where does 33 come from in point 5, Also how 10% and 20% is being taken in CI and CA.

Device type. 3390
Unit of space allocation. Cylinders
Data control interval size. 1024 bytes
Physical block size (calculated by VSAM). 1024 bytes
Record size. 200 bytes
Free space definition – control interval. 20%
Free space definition – control area. 10%
Number of records to be loaded. 3000

You can calculate space for the data component as follows:

1. Number of bytes of free space (20% × 1024) = 204 (round down)
2. Number of loaded records per control interval (1024–10–204)/200 = 4.
3. Number of physical blocks per track = 33.
4. Number of control intervals per track = 33.
5. Maximum number of control intervals per control area (33 x 15) = 495.
6. Number of loaded control intervals per control area (495 - 10% x 495) = 446.
7. Number of loaded records per cylinder (4 x 446) = 1784.
8. Total space for data component (3000/1784) (rounded) = 2 cylinders.

The value (1024 – 10) is the control interval length minus 10 bytes for two RDFs and one CIDF. The 10. record size is 200 bytes. On an IBM 3380, 31 physical blocks with 1024 bytes can be stored on one track. The value (33 × 15) is the number of physical blocks per track multiplied by the number of data tracks per cylinder.

Solution

  • Free space (in percent) on CA and CI is determined by FREESPACE parameter in DEFINE CLUSTER IDCAMS command. Values in fomula above are only example. You should change it if definition of VSAM is different.

    The maximum size on track for 3390 is 56664, but you must remeber about space used for intersector gaps. More sectors - more gaps, less available space for data. 33 is maximum number of blocks on 3390 track for block size between 1019 and 1086 (you can find calculation of that and reference table on bitsavers document "IBM 3390 Direct Storage Access Reference")