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
 

 

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: 61
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: 1738
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: 61
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: 7913
Location: Bellevue, IA

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: 61
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: 7913
Location: Bellevue, IA

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 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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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