View previous topic :: View next topic
|
Author |
Message |
Kumail Fazal
New User
Joined: 29 May 2007 Posts: 12 Location: Mysore
|
|
|
|
Hi,
Is there a simple way using which we can a read a KSDS VSAM file using a partial key.
Say the key for the given VSAM file is of length 15(7+3+5) bytes but i need to search the VSAM(not sequential) using only the 7 bytes of partial key. There can be multiple records on the partial key(7 bytes) and i would just require the first record.
I think the above task can be done in numerous ways but i m looking for a very simple way.
Thanks |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Kumail,
Quote: |
i need to search the VSAM(not sequential) using only the 7 bytes of partial key. |
I doubt we have this in easytreive.
If you put your requirement clearly, someone may come with the solution. |
|
Back to top |
|
|
Kumail Fazal
New User
Joined: 29 May 2007 Posts: 12 Location: Mysore
|
|
|
|
The detail explaination for the problem is as follows
say i define a VSAM file
FILE INFILE1 VS
INFILE1-KEY 1 15 A
and then i define my PS file
FILE INFILE2
INFILE2-KEY 1 7 A
Now i read the first occurence of input file2(which is PS file) and take the first 7 bytes (which would be my key) and using it search the VSAM(partial key search) and after i have found the first occurence in the VSAM, write that record to output file.
I want a random partial search to be done on VSAM, please let me know what could be the most effective way of doing this |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Kumail,
Quote: |
Now i read the first occurence of input file2(which is PS file) and take the first 7 bytes |
Are you expecting dups in flat file?
Quote: |
please let me know what could be the most effective way of doing this |
I belive your requirement could be accomplished using utils (like sort). Do you still want to proceed with Easytreive. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Kumail Fazal wrote: |
I think the above task can be done in numerous ways but i m looking for a very simple way. |
Simple, use the POINT statement with a GE (greater than/equel to)....If I read the manual correctly, the key MUST be the same length as the VSAM key, but a simple area with the one file's 7 bytes and an additional 8 bytes of low values will work.... |
|
Back to top |
|
|
|