Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can a VSAM KSDS file will have a 2 unique keys?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
esaccy
Currently Banned

New User


Joined: 19 Feb 2005
Posts: 22

PostPosted: Fri Sep 17, 2010 3:14 pm    Post subject: Can a VSAM KSDS file will have a 2 unique keys?
Reply with quote

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
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Sep 17, 2010 3:18 pm    Post subject:
Reply with quote

Please refer to "Alternate Index" concept in the Manuals...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 17, 2010 3:23 pm    Post subject:
Reply with quote

First question - NO, only one key is allowed and it must be unique and contiguous.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Fri Sep 17, 2010 3:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 17, 2010 7:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us