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: 7997
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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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