View previous topic :: View next topic
|
Author |
Message |
esaccy Currently Banned New User
Joined: 19 Feb 2005 Posts: 22
|
|
|
|
Can a VSAM file will have 2 unique keys?
My requiement
I have a KSDS file of 400 length.
I have 2 unique keys at
first key--(146,5)
Second key---(200,6)
Is it possible to define the KSDS file with these two feilds as key?
Moreover can we read a particular record with these two fields as keys. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Please refer to "Alternate Index" concept in the Manuals... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
First question - NO, only one key is allowed and it must be unique and contiguous. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
It is not clear what you are asking. The primary key for a KSDS must be contiguous so if you want to create a KSDS with an 11-byte key (5 bytes starting at 146, 6 bytes starting at 200), the answer is that this is not allowed. However, if you are saying that the primary key is 5 bytes starting at 146, and you want to use 6 bytes starting at 200 to merely read the KSDS, you can define those bytes as an alternate index (which can be defined to allow duplicates or to require unique keys). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Is it possible to define the KSDS file with these two feilds as key?
Moreover can we read a particular record with these two fields as keys. |
I believe the wording you chose here is causing confusion and getting different replies based on what we "understand" are the questions.
Suggest you post a few sample records (they don't have to be 200 bytes, only a few bytes will show what is needed) and how you want to implement the key(a). The show how you want to randomly read the file. |
|
Back to top |
|
|
|