Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Can we RESET the file pointer in VSAM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM
Author Message
neeharika

New User


Joined: 23 May 2008
Posts: 8
Location: Hyderabad

PostPosted: Mon Oct 06, 2008 1:00 pm    Post subject: Can we RESET the file pointer in VSAM
Reply with quote

Hi,

I have to update some records in the flat file with the values in VSAM File.
VSAM file key is defined on 6 fields But I can provide only first 4 fields(Short key) at the time of access from my Flat file.
So Iam doing a START with GTEQ option and doing a READ NEXT. I have to update the records in the Flat file only if there is one record in the VSAM file for the Short key.
My problem here is..There are multiple records in the flat file with the same short key..So when iam accessing VSAM for the first record in flat file it is pointing to the correct record on the VSAM. But when I want to access the same record again later for 2nd record in the Flat file..Iam unable to do so as the START is not pointing to the correct record now. Can I RESET the file pointer every time after accessing the VSAM file?
Back to top
View user's profile Send private message
References
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1634
Location: germany

PostPosted: Mon Oct 06, 2008 1:05 pm    Post subject:
Reply with quote

yes,

sounds as if this is a simple match-update; that means you only advance your vsam when your trigger (qsam) is greater than current vsam.
Back to top
View user's profile Send private message
neeharika

New User


Joined: 23 May 2008
Posts: 8
Location: Hyderabad

PostPosted: Mon Oct 06, 2008 1:11 pm    Post subject: Reply to: Can we RESET the file pointer in VSAM
Reply with quote

Hi,

Iam advancing VSAM if there is a match..But there is a situation like I need to point the same record in VSAM again as there can be duplicates in my Flat file..So can I reset the File pointer after every update and before accessing the VSAM again..
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8724
Location: 221 B Baker St

PostPosted: Mon Oct 06, 2008 1:56 pm    Post subject:
Reply with quote

Hello,

You need to re-read thr previous reply
Quote:
that means you only advance your vsam when your trigger (qsam) is greater than current vsam

Quote:
Iam advancing VSAM if there is a match
Don't do that. Do what was suggested. There is no need to reset/re-read.
Back to top
View user's profile Send private message
neeharika

New User


Joined: 23 May 2008
Posts: 8
Location: Hyderabad

PostPosted: Mon Oct 06, 2008 2:08 pm    Post subject: Reply to: Can we RESET the file pointer in VSAM
Reply with quote

Hi Dick,

Thanks..But I need to ensure that there is only one record for the provided short key( 4 fields) in the VSAM file. So after pointing to the desired record iam reading until the short key change inorder to get the count. Only if there is one record iam doing changes to Flat file.
But as there are duplicates in my Flat file I may require the same VSAM record again. So Please suggest me how can I achieve this.
Back to top
View user's profile Send private message
Robert Sample

Senior Member


Joined: 06 Jun 2008
Posts: 937
Location: Atlanta, GA

PostPosted: Mon Oct 06, 2008 4:37 pm    Post subject:
Reply with quote

As long as you're just reading the VSAM file, why not use a second DD name, SELECT, and FD for the VSAM file -- and use the full key to read the second file once you've found the right short key record?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1634
Location: germany

PostPosted: Mon Oct 06, 2008 4:41 pm    Post subject:
Reply with quote

why are you not noticing that the current 'short-key' is the same as the previous,
which means you already have your info for the qsam update,
thus saving additional unneeded I/O?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM All times are GMT + 6 Hours
Page 1 of 1