Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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: 8166
Location: East Dubuque, Illinois, USA

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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us