MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VSAM Alternate Index

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Mon Apr 06, 2009 4:38 pm    Post subject: VSAM Alternate Index Reply with quote

Hi,

Our VSAM, say VSAM1 has a key length of 15. We have defined an alternate Index too of length 7. Assuming we will have 1000 combinations of the Key field for an Alternate Index, we have the Max record size defined as 15007.

ie.,

15*1000+7

I guess the Max record size allowed is 32600 ( IBM reference), in that case I can have only

(32600-7)/15 = 2172 combinations only.

What should I do if the combinations exceed 2172? Any solution so that I do this at the Job level and not touch the code?

Thanks
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Apr 06, 2009 5:24 pm    Post subject: Reply with quote

arvibala,

You got the math wrong. AFAIK the alternate index's key record can point to a maximum of 32767 records with nonunique keys. Also you can have have upto 253 AI's.

why is this topic in database?

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Tue Apr 07, 2009 1:07 am    Post subject: Reply with quote

I question the use of an alternate key in this case. Alternate keys cause an additional overhead for each added record. In my opinion you would be better off to read your vsam dataset and sort it according to your alternate key and then process it. Another alternative would be to define a more unique alternate index.
Back to top
View user's profile Send private message Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Tue Apr 07, 2009 8:54 am    Post subject: Reply with quote

kolusu,

32767 is the record Size and if the Key is 15 Char in length and Alternate index is 7 char in length, we can have only (32767-7)/15, non-unique keys for an alternate index. I have the screen shot here.
Code:

----1-- --+----2----+----3----+----4----+----5----+----6----+----7----+---
730528D 0101080060     0101080068     0101080069     0101080074     010208
807189C 1110575232     1890075232     7385675232     7485675232     748577
837398M 0885075866     2182075866     2182175866     2282075866     308207
925434A 0101075087     0115075014     0171175087     0185075087     027227

Warp5,

I get this Alternate Index from another table and I have to fetch all Unique key fields from this table using this Alternate Index. Any other way will lead to more processing time. Even if we use tables, if we run out of space we have to change the code, compile, test. To avoid all these, went for ALT Index logic and I fear a problem here too.

And thought a lot before posting this here as,
This question relates to the way of accessing Records, a DBMS concept, so kept this here. Shudnt be here? Can you suggest where to put topics on VSAM .. etc?

Thanks,
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Tue Apr 07, 2009 12:36 pm    Post subject: Reply with quote

arvibala wrote:
kolusu,

32767 is the record Size and if the Key is 15 Char in length and Alternate index is 7 char in length, we can have only (32767-7)/15, non-unique keys for an alternate index. I have the screen shot here.
Code:

----1-- --+----2----+----3----+----4----+----5----+----6----+----7----+---
730528D 0101080060     0101080068     0101080069     0101080074     010208
807189C 1110575232     1890075232     7385675232     7485675232     748577
837398M 0885075866     2182075866     2182175866     2282075866     308207
925434A 0101075087     0115075014     0171175087     0185075087     027227

Warp5,

I get this Alternate Index from another table and I have to fetch all Unique key fields from this table using this Alternate Index. Any other way will lead to more processing time. Even if we use tables, if we run out of space we have to change the code, compile, test. To avoid all these, went for ALT Index logic and I fear a problem here too.

And thought a lot before posting this here as,
This question relates to the way of accessing Records, a DBMS concept, so kept this here. Shudnt be here? Can you suggest where to put topics on VSAM .. etc?

Thanks,

Maybe the Data Management forum would have been more appropriate.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Apr 08, 2009 1:04 am    Post subject: Reply with quote

Maybe you should post what you want to do and how many records we are talking about. Often you are better off using sort and other utilities (fast and efficient) instead of trying to bend things to work.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group