Page 1 of 1

How to determine CI size by key length?

Posted: Mon Apr 09, 2018 12:20 pm
by BobP
Hi,

Am not very familiar with VSAM so asking this. How to determine CI size by key length? If the file length 25 and the file length is 2000? Is it based on CA size?

Re: How to determine CI size by key length?

Posted: Mon Apr 09, 2018 1:14 pm
by nicc
file length
What does this mean? In general there are no 'files' on zOS but data sets. Data sets do not have a 'length' but records do. Try reading the VSAM Demystified red-book.

Re: How to determine CI size by key length?

Posted: Mon Apr 09, 2018 5:08 pm
by Robert Sample
Are you talking about a KSDS? In general, key size has NO relationship to CI size. CI size can only be certain values (512 to 8192 by 512, 8192 to 32760 by 2048) and you select the CI size based on the data set (not file) record length -- if your records can be 20,000 bytes long then you would want a CI size of 20K, 22K, 24K, 26K, 28K, 30K, or 32760 so you don't have to have spanned records.

For a KSDS, the key length and data component CI size determine the minimum index component CI size you need -- the index CI size needs to be large enough to hold pointers to every CI in the data component CA. If the index CI size is not long enough, some of the data component CI cannot be accessed and hence your data set will require more space.

Re: How to determine CI size by key length?

Posted: Mon Oct 01, 2018 8:53 am
by BobP
Yes, I was talking about KSDS.
In general, key size has NO relationship to CI size.
did you mean that there are case when there is a connection in between key-size and CI?
CI size can only be certain values (512 to 8192 by 512, 8192 to 32760 by 2048) and you select the CI size based on the data set (not file) record length -- if your records can be 20,000 bytes long then you would want a CI size of 20K, 22K, 24K, 26K, 28K, 30K, or 32760 so you don't have to have spanned records.
How did you bring in those numbers for CI? Is there some rule to know?

Re: How to determine CI size by key length?

Posted: Mon Oct 01, 2018 2:31 pm
by nicc
CI size can only be certain values (512 to 8192 by 512, 8192 to 32760 by 2048)
For 20,000 byte (~20k) record you would want a minimum of 20k so the increment is 2k so you get:
20K, 22K, 24K, 26K, 28K, 30K, or 32760
Undestand?

Re: How to determine CI size by key length?

Posted: Mon Oct 01, 2018 5:36 pm
by Robert Sample
did you mean that there are case when there is a connection in between key-size and CI?
Let me restate myself: I am aware of no circumstances in which data component CI size can possibly be related to key length. Data component CI size should be selected based on record (not key) length, access characteristics (sequential versus random), online versus batch, and site standards. Index component CI size should be based upon key length, data component CI size, and site standards. Index component CI's contain keys and pointers to data component CI's, in a compressed format, so the key length plays a role. The rule of thumb (which may have been updated in the last few years - I haven't checked lately) was to take half the key length plus 4 bytes and multiply the sum by the number of data CI per CA, and then pick an index CI size which is larger than the result. Index component CI size is why I qualified my previous statement -- key length plays a role in determining the CI size for the index component.

Many sites don't bother with the calculations and just pick 4096 for data component CI size and 1024 (or 4096) for index component CI size. These values usually work (except for odd KSDS datasets), but may be extremely inefficient.

Re: How to determine CI size by key length?

Posted: Mon Oct 01, 2018 6:32 pm
by Robert Sample
You might want to download and start reading http://www.redbooks.ibm.com/abstracts/s ... .html?Open which is the IBM Redbook VSAM Demystified -- an excellent learning tool for VSAM.