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: 8055
Location: East Dubuque, Illinois, 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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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