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
 

 

How to handle the unwanted field inside the primay key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
esaccy
Currently Banned

New User


Joined: 19 Feb 2005
Posts: 22

PostPosted: Fri Sep 17, 2010 6:27 pm    Post subject: How to handle the unwanted field inside the primay key
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 17, 2010 7:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7932
Location: Bellevue, IA

PostPosted: Fri Sep 17, 2010 8:07 pm    Post subject:
Reply with quote

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
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


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