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
 
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: 8280
Location: Dubuque, Iowa, USA

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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm

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