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
 

 

Defining duplicate keys in vsam file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Thu Feb 01, 2007 12:24 am    Post subject: Defining duplicate keys in vsam file
Reply with quote

hi,
can i have a key with duplicate values. if yes then how can i define it.
also...say following is my data structure...

01 data-rec.
05 A pic s9(9).
05 B pic s9(9).
05 C pic x(2).
05 D pic x9(3).
05 E pic x9(1).

now, my questions?
1. can i define key as combination of fields from A thru E. if yes how.
2. can i again define each of the fields from A thru E as an alternate key, even after defining the combination as primary.
3. can i just define alternate keys without defining primary keys.(i dont think so)
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: Thu Feb 01, 2007 1:25 am    Post subject:
Reply with quote

Hello,

1 - yes - VSAM doesn't use field name, just length/displacement in the definition.

2 - yes

3 - no, not to my knowledge. . .

Look up DEFINE ALTERNATEINDEX in the IDCAMS manual for your secondary keys.
Back to top
View user's profile Send private message
vamskrish
Warnings : 1

New User


Joined: 31 Jan 2007
Posts: 27
Location: virginia

PostPosted: Thu Feb 01, 2007 1:34 am    Post subject: hi
Reply with quote

for question 2, how do i mention that in the program in input-output section. record key is ------ ?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Feb 01, 2007 4:21 am    Post subject:
Reply with quote

So many questions.

#3, You can have alternate keys without defining a primary key.

As far as #1 go, like Dick hinted at, not as any "combination of fields from A thru E", they must be contiguous and in order.

#2a, You aren't really going to make read the manual for you, are you? IIRC, inside the COBOL program, the view of keyed VSAM dataset is just that, a keyed VSAM dataset. What you point to with your DD statement is all the program sees and the fact that it points to an AIX means nothing, AMS uses "smoke and mirrors" to provide access as needed.
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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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