IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Should the Primary Key always be the 1st field in KSDS ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sowmya Ramachandra

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Tue Feb 10, 2009 12:59 am
Reply with quote

Hi,

Can anyone let me know whether we can have the primary key of KSDS is any position or the start position of the field should always be 1 ?

Actually my requirement is fetch a record based on key which can have duplicates. Hence I am planning to make that as an Alternate key and make the other feild are the Primary key. I want to avoid an additional sort step change the position of 1st feild.

Regards,
Sowmya
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 10, 2009 1:15 am
Reply with quote

Primary key of a KSDS does not have to start in the first byte.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 10, 2009 1:19 am
Reply with quote

Sowmya Ramachandra wrote:
Can anyone let me know whether we can have the primary key of KSDS is any position or the start position of the field should always be 1 ?
No, why would you think it needs to be?
Quote:
Actually my requirement is fetch a record based on key which can have duplicates. Hence I am planning to make that as an Alternate key and make the other feild are the Primary key. I want to avoid an additional sort step change the position of 1st feild.
Normal loads require the primary key to be in sequence, but a program updating/inserting could handle the non-sequential primary key......
Back to top
View user's profile Send private message
Sowmya Ramachandra

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Tue Feb 10, 2009 1:27 am
Reply with quote

I could see most of the times the Primary key was starting from 1st byte icon_smile.gif .. anyways thanks for your response
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Feb 10, 2009 1:32 am
Reply with quote

Hello,

Quote:
I could see most of the times the Primary key was starting from 1st byte
Yup, this is for the sake of people rather than the computer icon_wink.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top