MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how can we use 2 keys while using in VSAM?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
babun
Beginner


Joined: 03 Aug 2005
Posts: 19
Topics: 9
Location: bangalore

PostPosted: Thu Dec 15, 2005 11:18 am    Post subject: how can we use 2 keys while using in VSAM? Reply with quote

Hi folks
i have the req of using 2 keys in ksds(VSAM),,so we can use the one key like keys(7,14)which is used for 1 key,,but can we use combination of keys? if we can can u pls answer & send it to me asap pls..
babu
_________________
babu
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Thu Dec 15, 2005 4:14 pm    Post subject: Reply with quote

Look up "Alternate Key"...
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Dec 16, 2005 8:05 am    Post subject: Reply with quote

Babun.

I didn't get your request clearly. Are you trying to have a combination of two/more fields together as a Key ? or do you want two different fields (at different positions) to act as a key ?

If you are looking at question 1 - Composite key:
Group two or more fields together under a group variable and use that group variable as key field.
Code:

01  WS-VSAM-RECORD.
    05  WS-VSAM-KEY.
        10  WS-FIELD1         PIC  X(05).
        10  WS-FIELD2         PIC  X(02).
        10  WS-FIELD3         PIC  X(08).
    05  WS-VSAM-DATA.
        ......


If you want two different fields to act as a key - Then you must go for Alternate keys as suggested by Mike.

Thanks,
Phantom
Back to top
View user's profile Send private message
babun
Beginner


Joined: 03 Aug 2005
Posts: 19
Topics: 9
Location: bangalore

PostPosted: Sun Dec 18, 2005 9:57 am    Post subject: Reply with quote

Hi Phantom
my requirement is the first one...which i need exactly the same which you send
Thanks phantom
Regard's
babu
_________________
babu
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group