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
 
Reseting file pointer to the 1st record once EOF is reached

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dham.kamal

New User


Joined: 13 Jul 2007
Posts: 9
Location: India

PostPosted: Fri Jul 13, 2007 11:29 am    Post subject: Reseting file pointer to the 1st record once EOF is reached
Reply with quote

Hi

Am reading sequential file. I read a system date and check for a matching date in the file. If the date is not matching then i have to decrement the date by 1 and again scan the whole file for the new date. This processing needs to go on till i find the matching date in file.

Once i dont find the 1st date i need to reset the pointer to 1st record to scan it again from the start. Can you tell me any command which resets the pointer back to the first record.

Thanks for your help in advance.
Regards
Kamal
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jul 13, 2007 11:41 am    Post subject:
Reply with quote

Two commands, "CLOSE" followed by "OPEN".....
Back to top
View user's profile Send private message
dham.kamal

New User


Joined: 13 Jul 2007
Posts: 9
Location: India

PostPosted: Fri Jul 13, 2007 11:50 am    Post subject:
Reply with quote

William Thompson wrote:
Two commands, "CLOSE" followed by "OPEN".....


Williams thanks for your reply
But is there any other command to reset teh pointer.
Opening and closing a file seems to be very resource consuming.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jul 13, 2007 11:53 am    Post subject:
Reply with quote

Quote:
But is there any other command to reset teh pointer.
No, not a normal "flat" file.......
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Fri Jul 13, 2007 1:03 pm    Post subject: Re: Reseting file pointer to the 1st record once EOF is reac
Reply with quote

You don't say what you will do once you have found the appropriate record in the file, so there may be a 'better' way of doing this
eg could you sort the file in date order perhaps?

If you expand your requirements for us someone might come up with a good, resource friendly solution.
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Fri Jul 13, 2007 1:11 pm    Post subject:
Reply with quote

Hi Kamal,

Include sequence numbers at the end of each record through sort. Using the sequence number as the key, copy the records into a KSDS file. So, on reaching the EOF, move 00001 to the key, so that you can reach back to the first record.

Regards
Tanden
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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