Page 1 of 1

Calculate the VSAM remaining space.

Posted: Sun Feb 16, 2014 2:13 am
by Akshya Chopra
Hi,

I've one VSAM dataset. I want to know how much free space is available in that data set. How can I find that?

Re: Calculate the VSAM remaining space.

Posted: Sun Feb 16, 2014 2:59 am
by Robert Sample
Your question is inherently unclear. Do you mean usable free space or total free space? For total free space, simply run a LISTCAT and subtract the HI-U-RBA from the HI-A-RBA value. Allocated minus used will give you total free space (depending upon the CA and CA free space percentages). Note that it is entirely possible that NONE of the total free space is usable -- but it is free space. Finding usable free space is complicated since you have to look at index CI size, data CI size, key length, CI per CA, CI free space percentage, CA free space percentage, and average / maximum record length -- and for all practical purposes, if the average and maximum record lengths are far apart, the best you can do is estimate the free space (unless you use a vendor product).

Re: Calculate the VSAM remaining space.

Posted: Sun Feb 16, 2014 8:10 pm
by Akshya Chopra
Thanks for the excellent explanation Robert.

I'd like to know the usable Fee space. But how come there is a free space but not usable?

Re: Calculate the VSAM remaining space.

Posted: Sun Feb 16, 2014 11:03 pm
by Robert Sample
Examples of free space that is not usable:

1) Your fixed record length is 400 and your data component CI size is 512. You get one record per CI and the remaining hundred-odd bytes in the CI cannot be used. Or you have fixed-length 3000 byte records and you specify 18432 for your CI size with 15% free space. 15% of 18432 is 2765 bytes, so even though you specified CI free space it is not big enough for a record and hence cannot be used.

2) You have a long key (say 60 bytes) and a data CI size of 4096 (180 CI per CA on 3390 disk). The index CI size is 4096. The rough rule of thumb is that index records need about half the key length, so 30 bytes per key times 180 keys per CA gives 5,400 bytes. With an index CI size of 4096, about 44 of the data CI cannot be accessed via the index. This is "free" space in the sense that no data will be written to the data component for those CI, because the index CI size is too small to allow access.

Re: Calculate the VSAM remaining space.

Posted: Thu Feb 20, 2014 11:43 am
by Akshya Chopra
Thanks robert. Your explanation helps.