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
 

 

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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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