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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Should the Primary Key always be the 1st field in KSDS ?
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: 7931
Location: Bellevue, IA

PostPosted: Tue Feb 10, 2009 1:15 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Tue Feb 10, 2009 1:19 am    Post subject: Re: Should the Primary Key always be the 1st field in KSDS ?
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    Post subject: Reply to: Should the Primary Key always be the 1st field in
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

Site Director


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

PostPosted: Tue Feb 10, 2009 1:32 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 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
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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