View previous topic :: View next topic
|
Author |
Message |
esaccy Currently Banned New User
Joined: 19 Feb 2005 Posts: 22
|
|
|
|
Hi
My requirement is below
For a VSAM KSDS file of length 400 the fields are below
Field-1 Pic x(15)
FIELD-2 pIC X(30)
FIELD-3 PIC X(6)
FIELD-4 PIC X(4)
FIELD-5 pic x(7)
---
---etc
I need FIELD-3 and FIELD-5 as primary keys.Since for primary key the field should be contagious, i am taking FIELD-4 also
say
05 Ws-group
07 FIELD-3 pic x(6)
07 FIELD-4 pic x(4)
07 FIELD-5 pic x(7)
I am giving Ws-group as my key in RECORDKEY CLAUSE
Here my Question is
How can i read this VSAM file with only field-3 and field-5?
How to suppress the field-4 when reading since field-4 is not needed?
Please help |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you are not making any sense.
if the ksds vsam file exists, then a primary key already exists and you are actually asking how to define an alternate key.
if the ksds vsam file does not exist, rearrange the fields.
this REDBOOK, VSAM Demystifed may come in handy. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
How can i read this VSAM file with only field-3 and field-5? |
You cannot -- you can do a generic read on field-3, but that's as far as you can go with the key defined the way you have it.
Quote: |
How to suppress the field-4 when reading since field-4 is not needed? |
You cannot -- the values in field 4 are part of the key and must be taken into account when accessing the file.
As Dick said, either live with the file as it exists, or rearrange the fields to create one contiguous primary key. |
|
Back to top |
|
|
|