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 keys

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


Joined: 26 May 2004
Posts: 4
Topics: 3

PostPosted: Wed May 26, 2004 5:12 pm    Post subject: VSAM keys Reply with quote

I have a VSAM KSDS file that has a primary key that is no longer unique. I have another field on the record that will make this file unique. The only problem is that the new field is not contiguous with the existing primary key.

Does anyone know if there is a way to define a primary index where the index fields are not next to each other?

I appreciate any and all help!

Thanks,
Dan
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 26, 2004 6:14 pm    Post subject: Reply with quote

dannym,

Did you look at defining an Alternate Index?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Thu May 27, 2004 8:56 am    Post subject: Reply with quote

Quote:

Does anyone know if there is a way to define a primary index where the index fields are not next to each other?


This is NOT possible in VSAM. All keys must be contiguous. If you look at IDCAMS DEFINE CLUSTER you will see the key definition consists of a start position and length. That's it. If you really want your primary key to consist of the two fields you mention, you will have to change your file format so they are adjacent. If practical (and if relevant) you might want to reformat any historical data to the new format as well.


Kolusu: I'm not clear how you would use an alternate index to satisfy this requirement. Maybe you could explain?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 27, 2004 9:39 am    Post subject: Reply with quote

Mike,

I was thinking of defining the other field as an alternate index which would allow dups and store the (primarykey + the other field) as a single field.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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