View previous topic :: View next topic |
Author |
Message |
vijaylaxmisg Beginner
Joined: 29 May 2007 Posts: 8 Topics: 4
|
Posted: Tue Jul 17, 2007 5:23 am Post subject: How to define more than one columns in primary key for VSAM. |
|
|
Hi All,
I need to define a VSAM with primary key as
Account number and SSN Number,
But the data defintion is
05 Account
10 Account Number
05 SSN Details
10 SSN Number
The above definition is only as an example,
Now I want to define primary key on Account number and SSN.
How my Record key clause looks like?
Thank you,
Regards-
Viji |
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Tue Jul 17, 2007 5:30 am Post subject: |
|
|
VSAM keys must be contiguous, you will need to swap "SSN Details" with "SSN Number". |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jul 17, 2007 6:04 am Post subject: |
|
|
before I start, Columns is a DB2 term. VSAM records have fields.
how about: Code: |
05 <data descriptions - if any>
05 XXXX-RECORD-KEY.
10 ACCOUNT.
15 ACCOUNT-NUMBER PIC whatever.
10 SSN-DETAILS.
15 SSN-NUMBER PIC whaterver.
05 <other data descriptions>
|
This way you can refer to the complete key as a group item XXXX-RECORD-KEY, where XXXX is whatever to differentiate between different VSAM records.
each portions of the key as group (x-type) ACCOUNT and SSN-DETAILS, and each portion of the key as a data-element ACCOUNT-NUMBER (comp, display) and SSN-NUMBER (display, comp) Hopefully, the SSN is not maintained with editing symbols (i.e. -,/,).
as CICS Guy said, the elements of a VSAM KEY must be contiguous and ordered.
The record key clause would be XXXX-RECORD-KEY. _________________ Dick Brenholtz
American living in Varel, Germany
Last edited by dbzTHEdinosauer on Tue Jul 17, 2007 6:52 am; edited 1 time in total |
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Tue Jul 17, 2007 6:24 am Post subject: |
|
|
CICS Guy wrote: | VSAM keys must be contiguous, you will need to swap "SSN Details" with "SSN Number". | My bad....
Missed the fact that the details is a group name... |
|
Back to top |
|
 |
vijaylaxmisg Beginner
Joined: 29 May 2007 Posts: 8 Topics: 4
|
Posted: Tue Jul 17, 2007 10:03 pm Post subject: |
|
|
Thank you very Much for your reply
I jsut wanted to explore the chance of using non-contigous keys.
Thank you Ones again. |
|
Back to top |
|
 |
jajularamesh Beginner
Joined: 14 Apr 2006 Posts: 87 Topics: 33
|
Posted: Thu Jul 19, 2007 1:16 am Post subject: |
|
|
Hi vijaylaxmisg,
Change/Reformat the layout file so that the key fields are continous and then define it as a key
Regards,
Venkata Apparao Jajula |
|
Back to top |
|
 |
|
|