View previous topic :: View next topic |
Author |
Message |
DANNYN Beginner
Joined: 26 May 2004 Posts: 4 Topics: 3
|
Posted: Wed May 26, 2004 5:12 pm Post subject: VSAM keys |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed May 26, 2004 6:14 pm Post subject: |
|
|
dannym,
Did you look at defining an Alternate Index?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu May 27, 2004 8:56 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 27, 2004 9:39 am Post subject: |
|
|
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 |
|
|
|
|