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?
Calculate the VSAM remaining space.
- Akshya Chopra
- Registered Member
- Posts: 77
- Joined: Mon May 20, 2013 11:32 pm
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Calculate the VSAM remaining space.
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).
- Akshya Chopra
- Registered Member
- Posts: 77
- Joined: Mon May 20, 2013 11:32 pm
Re: Calculate the VSAM remaining space.
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?
I'd like to know the usable Fee space. But how come there is a free space but not usable?
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Calculate the VSAM remaining space.
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.
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.
- Akshya Chopra
- Registered Member
- Posts: 77
- Joined: Mon May 20, 2013 11:32 pm
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute