IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to check for Beginning of a file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prema Suresh

New User


Joined: 12 Jun 2008
Posts: 8
Location: Bangalore

PostPosted: Thu Mar 05, 2009 11:02 am
Reply with quote

Hi all,

I have a requirement like this. I have started reading a file from the beginning. Say i am in 10th record after some processing. Now I wish to go back and read from the beginning again. Is this possible?

Your help is appreciated!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 05, 2009 11:16 am
Reply with quote

Hello,

Quote:
Now I wish to go back and read from the beginning again.
You probably dont want to go back and read the beginning all over again.

Please describe your process and which part of this process requires re-reading some or all of the input.

This is definitely not an acceptable approach for matching 2 files.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Mar 05, 2009 1:20 pm
Reply with quote

Morning Sir !

But if you really want to do this, for whatever reason, just close the file and open it ones more and start reading
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 05, 2009 8:56 pm
Reply with quote

Hello,

Suggest you do NOT close/open the file until the requirement is better understood. . .

FWIW - the last several times someone asked how to do this, they intended to "start back at the beginning" so they could match 2 files. Probably the worst possible way to implement such a requirement.
Back to top
View user's profile Send private message
Debabrata Pruseth

New User


Joined: 11 Dec 2008
Posts: 59
Location: Pune , India

PostPosted: Fri Mar 06, 2009 3:32 pm
Reply with quote

I remember i had a similar requirement . To avoid multible start browse and going forward and going backwards , what i did was put all the required variables of each record in a array . Then used this array for processing . But array is only effective for small amount of data and other constraints are there which can be cleared once Prema gives the full requirements.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 06, 2009 4:49 pm
Reply with quote

Hi,

I've to vote-in for Dick ... icon_smile.gif
Quote:
Suggest you do NOT close/open the file until the requirement is better understood. . .
What is posted so far by OP may be a way to achieve what s/he wants but not the optimum way for sure. Once the requirement is understood ..some one will be around with a better suggestion.. icon_smile.gif
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Wed Mar 11, 2009 5:34 pm
Reply with quote

Should agree with above posts.

I think the solution would be some thing like this. Sort the file based on the field that is used for mathcing and then just use less than or greater than condition to browse through the file.

I am sorry if I misunderstood the requirement.

Can you elaborate on it if this problem is still open.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top