IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to read a VSAM file using a partial key in easytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kumail Fazal

New User


Joined: 29 May 2007
Posts: 12
Location: Mysore

PostPosted: Thu Nov 08, 2007 3:51 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 4:16 pm
Reply with quote

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
View user's profile Send private message
Kumail Fazal

New User


Joined: 29 May 2007
Posts: 12
Location: Mysore

PostPosted: Thu Nov 08, 2007 5:18 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Nov 09, 2007 8:14 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Nov 09, 2007 3:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 5
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top