Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
neeharika

New User


Joined: 23 May 2008
Posts: 14
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

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

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: 14
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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: 14
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

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

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
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us