Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
Location: East Dubuque, Illinois, USA

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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us