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
 
Selecting a particular record from VSAM file

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

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Tue Nov 27, 2012 8:53 pm    Post subject: Selecting a particular record from VSAM file
Reply with quote

Hi ,
I have to select a particular record from a VSAM file.I used IDCAMS utility
REPRO command with FROMKEY and TOKEY parameters.but actually the key having length of 8.but my desired record having key length 6.

I want to pick only my record with key length 6.I dont need any records having keylength more than 6 and same first 6 letters as my key.

For example. I want to select only the record with key MYKEYY.
I dont want to select records with key MYKEYY1 or MYKEYY2


Please Help.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Tue Nov 27, 2012 9:04 pm    Post subject:
Reply with quote

When MYKEYY was added, with what was the key field padded?
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Tue Nov 27, 2012 9:10 pm    Post subject:
Reply with quote

In my output file it is padded with spaces. its like
Code:
"MYKEYY  "
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 27, 2012 9:20 pm    Post subject:
Reply with quote

Quote:
REPRO command with FROMKEY and TOKEY parameters.but actually the key having length of 8.but my desired record having key length 6.

I want to pick only my record with key length 6.I dont need any records having keylength more than 6 and same first 6 letters as my key.
You need to learn about VSAM files. If the key is defined as 8 bytes, the key is 8 bytes -- period. You may have a 6-byte key with 2 spaces (or low values or high values or some other collating sequence characters) on the end, but the key is still 8 bytes.

If your REPRO specifies
Code:
FROMKEY('MYKEYY  ') TOKEY('MYKEYY  ')
you will get, at most, 1 record output -- as long as you're not attempting to use an alternate index key that allow duplicates.
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Wed Nov 28, 2012 1:01 am    Post subject:
Reply with quote

Thanks for the explanation Robert.its working now when i gave within quotes.
thank you !!!!!!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: East Dubuque, Illinois, USA

PostPosted: Wed Nov 28, 2012 1:38 am    Post subject:
Reply with quote

A quick test indicates that using FROMKEY and TOKEY without quote marks to delimit the key causes REPRO to use the provided key as a generic key and thus you got extra records in your output.
Back to top
View user's profile Send private message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 30
Location: LA, California

PostPosted: Thu Nov 29, 2012 12:29 pm    Post subject:
Reply with quote

Robert

very helpful. Thanks icon_smile.gif
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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