View previous topic :: View next topic
|
Author |
Message |
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
When MYKEYY was added, with what was the key field padded? |
|
Back to top |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
In my output file it is padded with spaces. its like
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Thanks for the explanation Robert.its working now when i gave within quotes.
thank you !!!!!! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Vinodh S
New User
Joined: 12 Apr 2012 Posts: 28 Location: LA, California
|
|
|
|
Robert
very helpful. Thanks |
|
Back to top |
|
|
|