Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> 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: 8117
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us