The SWAMI
of VSE/VSAM

 

Space Allocation Questions and Answers
How can I predict the amount of space my file will need?

First, please read the following two Question and Answer discussions:

  1. How can I predict the number of records within a Control Interval (CI)?
  2. How can I predict the number of CIs within a Control Area (CA)?

With that background, we can make an accurate estimate of the amount of disk space that VSAM will use when loading a file.

Next, calculate the number of CIs that will need to be loaded to contain the logical records in your file:

 
NumCIs = Ceil(NumLogRecs / RecsInCI)
 
Where:
NumCIs      == Number of CIs initially loaded
Ceil        == function that returns the integer value rounded up
NumLogRecs  == Number of Logical Records to be loaded
RecsInCI    == Number of Logical Records loaded into a CI
 

To determine the number of Logical Records to be loaded into a CI, see this discussion.

Now we know how many CIs will need to be loaded with records. To calculate the number of CAs that will need to be loaded to contain the CIs for your file:

 
NumCAs = Ceil(NumCIs / LoadCIsInCA)
 
Where:
NumCAs      == Number of CAs initially loaded
Ceil        == function that returns the integer value rounded up
NumCIs      == Number of CIs initially loaded
LoadCIsInCA == Number of CIs to be loaded in each CA
 

To determine the number of CIs to be loaded in each CA, see this discussion.

You can check the LISTCAT output after loading a file to determine if your calculations were correct:

Validate the following fields:

  • Data Component ALLOCATION: HI-USED-RBA
  • Data Component ATTRIBUTES: CISIZE
  • Data Component ATTRIBUTES: CI/CA

Multiply the CI values (CISIZE and CI/CA) to determine the CA SIZE in bytes

Divide the ALLOCATION HI-USED-RBA by the CA SIZE calculated above to determine the number of CAs initially loaded.

If this is not what you estimated, check to ensure that the following values are as intended:

Data Component ATTRIBUTES: AVGLRECL
This value is only meaningful if you specified space allocation (SPACE-TYPE) in RECORDS.
Data Component ATTRIBUTES: CISIZE
This should be as you specified, unless VSAM was limited because you specified BUFSPACE too small. If this occurred, change your DEFINE parameters for this file to omit the BUFSPACE value or specify a larger BUFSPACE value -- this is particularly useful for VSAM Base Clusters accessed via Alternate Indexes.
Data Component STATISTICS: REC-TOTAL
Were the intended number of records loaded? Often a significant difference can be found when comparing the number of records actually loaded to the design specifications.
Data Component STATISTICS: FREESPACE-%CI
This should be as you specified. It affects the number of logical records loaded per CI -- More FREESPACE means fewer logical records inserted into each CI during initial load.
Data Component STATISTICS: FREESPACE-%CA
This should be as you specified. It affects the number of CIs initially loaded per CA -- More FREESPACE means fewer CIs in each CA will have records inserted during initial load.
Data Component ALLOCATION: SPACE-TYPE
This should be as you specified -- RECORDS, BLOCKS, TRACKS or CYLINDERS. It affects the CA Size.
Data Component ALLOCATION: SPACE-PRI
This should be as you specified. It affects the CA Size and number of allocations.
Data Component ALLOCATION: SPACE-SEC
This should be as you specified. It affects the CA Size and number of allocations.
Data Component VOLUME: VOLSER
Is the volume you intended to use being used?
Data Component VOLUME: DEVTYPE
Is the device type what you intended to use?
Data Component VOLUME: PHYREC-SIZE
Is the physical record size VSAM chose as you expected? Sometimes VSAM will choose a physical record size smaller than your CI size to use track space more completely. This may be an indication that you should review the CI size you chose.
Data Component VOLUME: PHYRECS/TRK
Is the number of physical records per track as expected?
Data Component VOLUME: TRACKS/CA
If your file is of any size, this value should be equal to the number of tracks per cylinder. If this is not the case, it means your A
Data Component VOLUME: EXTENT-NUMBER
If the number of extents is large, it may be that the disk space where the file was allocated has been fragmented by other files' DEFINE and DELETE activity. Physical Space defragmentation may be desirable, or the allocation amounts defined for the file may be smaller than optimumb.

Extract of sample LISTCAT data


   CLUSTER ------- TST.FILE
         . . .
       DATA ------- TST.FILE.DATA
         . . .
         ATTRIBUTES
           KEYLEN----------------44     AVGLRECL-------------505     BUFSPACE-----------10240     CISIZE--------------4096
           RKP--------------------0     MAXLRECL-------------505     EXCPEXIT----------(NULL)     CI/CA----------------180
           SHROPTNS(2,3) NORECOVERY     SUBALLOC         NOERASE     INDEXED     NOWRITECHECK   NOIMBED         NOREPLICAT
           UNORDERED        NOREUSE     NONSPANNED    NONRECVABLE
         STATISTICS
           REC-TOTAL-------------13     SPLITS-CI--------------0     EXCPS-- ---------------28
           REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------2
           REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:
           REC-UPDATED------------0     FREESPACE-%CA----------0          88.194     08:38:01
           REC-RETRIEVED----------0     FREESPC-BYTES----------0          X'9ECD8557B1912C10'
         ALLOCATION
           SPACE-TYPE------CYLINDER
           SPACE-PRI--------------6     USECLASS-PRI-----------0     HI-ALLOC-RBA-------94208
           SPACE-SEC--------------3     USECLASS-SEC-----------0     HI-USED-RBA--------94208
         VOLUME
           VOLSER------------SIN238     PHYREC-SIZE---------4096     HI-ALLOC-RBA-------47104     EXTENT-NUMBER----------1
           DEVTYPE-------------3380     PHYRECS/TRK-----------12     HI-USED-RBA--------47104     EXTENT-TYPE--------X'00'
           VOLFLAG------------PRIME     TRACKS/CA-------------15
           LOW-KEY---------------00
           HIGH-KEY--------------3F
           HI-KEY-RBA----------5120
           EXTENTS:
           LOW-CCHH-----X'00000002'     LOW-RBA----------------0     TRACKS-----------------3
           HIGH-CCHH----X'00000004'     HIGH-RBA-----------47103
         VOLUME
           . . .
       INDEX ------ TST.FILE.INDEX
           . . .

   
 
Up to the
Q and A
Page
Up to the
Allocation
Q and A Page
E-Mail
The Swami
Go to
The Swami's
Home
 

This entire site -- including all its pages and content --
are the intellectual property of and copyright © 2002-2003 by
Dan Janda, theswami@epix.net