How to determine CI size by key length?

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
BobP
Registered Member
Posts: 44
Joined: Mon Jun 17, 2013 1:33 pm

How to determine CI size by key length?

Post 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?
Thanks,
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How to determine CI size by key length?

Post 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.
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to determine CI size by key length?

Post 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.
BobP
Registered Member
Posts: 44
Joined: Mon Jun 17, 2013 1:33 pm

Re: How to determine CI size by key length?

Post 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?
Thanks,
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How to determine CI size by key length?

Post 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?
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to determine CI size by key length?

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to determine CI size by key length?

Post 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.
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.”