How can we calculate the total used space?

Virtual Storage Access method - ESDS, KSDS, RRDS & LDS. Basic direct access method, Basic sequential -, Queued sequential -, Basic partitioned -, Indexed sequential -, Object - access method.
Post Reply
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

How can we calculate the total used space?

Post by Neeraj N »

Hi,

How can we calculate the total used space, in bytes, of a data-set? The DASD Type is 3390. I've looked at some online references but I'm not sure if got all them correctly.

Thanks,
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How can we calculate the total used space?

Post by Robert Sample »

Your question has some uncertainty in it -- when you say "total used space", do you mean the space actually used in the data set by data, or do you mean the total allocated space for the data set -- whether or not some of that space has data? Also, do you want a precise byte total or will an estimate be close enough? You also did not indicate whether you are looking at a sequential or VSAM data set -- the calculations are different.

For a sequential data set, there are three relevant pieces of information: the block size, the tracks allocated, and the tracks used. ISPF 3.4 can provide you with all three of these. 3390 track geometry is 56,664 bytes per track, 15 tracks per cylinder, and the number of cylinders for a volume depends upon the type of volume (common are mod 3 with 3335 cylinders and mod 9 with 10,050 cylinders but others are possible). However, not all 56,664 bytes can be used so merely multiplying tracks by 56664 will give you a rough estimate but that value can be quite far off (for example: an unblocked 80-byte data set can only hold 78 records per 3390 track which means over 50,000 bytes per track are not used or allocated).

Assuming the data set is blocked to half tracks (Google gx26-4577 to get the 3390 chart of how many blocks fit in a track for the various block sizes), take the block size times 2 times the number of allocated (or used) tracks to compute the allocated (or used) space in bytes. Note that some of the blocks may not be filled, so the actual bytes allocated (used) could be slightly lower, but rarely will that be more than 1 or 2% of the space.

If you want a precise answer for used bytes, write a program in the language of your choice to read each record and accumulate the record length (which is a fixed value for FB data sets but requires knowing how to retrieve if using VB data sets).

For VSAM, the HI-A-RBA and HI-U-RBA values in a LISTCAT provide you with the allocated and used bytes. Since VSAM data sets may have free space, the sequential data set calculations CANNOT be reliably used for VSAM. Plus you have to consider whether or not to add up the index data set space if using a KSDS.
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

Re: How can we calculate the total used space?

Post by Neeraj N »

Thanks Robert. Your post makes me understand that how less I know.

I'm sorry of not telling it before - I need the information for sequential data-set. I read your post carefully and did not understand this line
common are mod 3 with 3335 cylinders and mod 9 with 10,050 cylinders but others are possible
What is is 'mod' here?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How can we calculate the total used space?

Post by Robert Sample »

"mod" as used in my post just means "type". If you do research, you may find 3390-3, 3390-9, 3390-27, or 3390 mod 3 (9 or 27) -- they are defining the type of 3390. Mod 3 holds about 3 GB (2.8 actually), mod 9 about 9 GB (8.4 actually) and so forth.
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

Re: How can we calculate the total used space?

Post by Neeraj N »

Thank you Robert. I searched on the terms you suggested and it was a great learning.

Thanks,
Neeraj
Post Reply

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

Register

Sign in

Return to “SMS & VSAM and BDAM, BSAM, QSAM, BPAM, ISAM, OAM.”