AIX in KSDS VSAM.
AIX in KSDS VSAM.
Hi,
I've a doubt about AIX record size: when we create AIX we give record size as Primary index + length of AIX + 5 bytes? What is purpose of these five bytes and what the info it will stores in it?
Thanks,
I've a doubt about AIX record size: when we create AIX we give record size as Primary index + length of AIX + 5 bytes? What is purpose of these five bytes and what the info it will stores in it?
Thanks,
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: AIX in KSDS VSAM.
The 5 bytes are system information -- IBM does not tell us what is stored in those bytes; therefore it can be categorically stated that there is no reason for you to know that. If you work for IBM, and get assigned to work on VSAM, then you can find out (but you might have to sign a non-disclosure agreement before you find out).
And your formula for the AIX record size is incomplete -- you gave the record size for a UNIQUE alternate index. Alternate indexes, unlike primary keys, can have duplicate values (up to 32767 of them) and hence the alternate index record size can be VASTLY greater than the base cluster record size.
And your formula for the AIX record size is incomplete -- you gave the record size for a UNIQUE alternate index. Alternate indexes, unlike primary keys, can have duplicate values (up to 32767 of them) and hence the alternate index record size can be VASTLY greater than the base cluster record size.
Re: AIX in KSDS VSAM.
Thanks Robert.
As you indicated about the formula, I look back and see that this might be correct: RECSZ= 5 + AIXKL + (n x BCKL). Where
AIXKL is the alternate-key length. (See the KEYS parameter.)
BCKL is the base cluster's prime-key length.
n=1 when the UNIQUEKEY parameter is specified.
n is equal to the number of base cluster records that have the same alternate index key when NONUNIQUEKEY is specified.
Is that correct, please suggest.
As you indicated about the formula, I look back and see that this might be correct: RECSZ= 5 + AIXKL + (n x BCKL). Where
AIXKL is the alternate-key length. (See the KEYS parameter.)
BCKL is the base cluster's prime-key length.
n=1 when the UNIQUEKEY parameter is specified.
n is equal to the number of base cluster records that have the same alternate index key when NONUNIQUEKEY is specified.
Is that correct, please suggest.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: AIX in KSDS VSAM.
Yes. If your alternate key length is 27 bytes and your primary key length is 20 bytes and you expect up to 10,000 duplicates then 5 + 27 + 10000*20 gives 200032 as the alternate index record size.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: AIX in KSDS VSAM.
Update: after doing some research, I managed to find out what the 5 bytes are:
Byte
1 - ESDS/KSDS indicator (X'00' for ESDS, X'01' for KSDS)
2 - X'04' for ESDS (length of RBA) and length of primary key for KSDS
3-4 - Binary count of key occurrences if NONUNIQUEKEY (X'0001' to X'FFFF'), X'0001' if UNIQUEKEY
5 - Length of alternate index key
Byte
1 - ESDS/KSDS indicator (X'00' for ESDS, X'01' for KSDS)
2 - X'04' for ESDS (length of RBA) and length of primary key for KSDS
3-4 - Binary count of key occurrences if NONUNIQUEKEY (X'0001' to X'FFFF'), X'0001' if UNIQUEKEY
5 - Length of alternate index key
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