View previous topic :: View next topic |
Author |
Message |
babun Beginner
Joined: 03 Aug 2005 Posts: 19 Topics: 9 Location: bangalore
|
Posted: Thu Dec 15, 2005 11:18 am Post subject: how can we use 2 keys while using in VSAM? |
|
|
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 |
|
 |
MikeBaker Beginner
Joined: 04 May 2004 Posts: 96 Topics: 9
|
Posted: Thu Dec 15, 2005 4:14 pm Post subject: |
|
|
Look up "Alternate Key"... |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Fri Dec 16, 2005 8:05 am Post subject: |
|
|
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 |
|
 |
babun Beginner
Joined: 03 Aug 2005 Posts: 19 Topics: 9 Location: bangalore
|
Posted: Sun Dec 18, 2005 9:57 am Post subject: |
|
|
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 |
|
 |
|
|