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
 
Going back to file begining

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

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Mon Nov 26, 2007 7:35 pm    Post subject: Going back to file begining
Reply with quote

Hi,
If i am reading a sequential file and assume that i am in middle of the file. If i want to go back to the first line, of the file. How can i do it?
Back to top
View user's profile Send private message

Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Nov 26, 2007 7:46 pm    Post subject:
Reply with quote

Close and reopen the file.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Mon Nov 26, 2007 8:04 pm    Post subject:
Reply with quote

And if it's on tape you can read backwards icon_wink.gif
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 Nov 26, 2007 10:39 pm    Post subject:
Reply with quote

Hello,

What business process requires you "start over" at the beginning?
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Nov 26, 2007 11:58 pm    Post subject:
Reply with quote

Hey Dick, I am assuming that file has multiple records types that bhashyam didn't realize he needed until he read past them?

That is why it is so important to understand the business process. icon_wink.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Nov 27, 2007 2:38 am    Post subject:
Reply with quote

Beware multiple open/closes. It can turn a 10 min job into a 3 hr job.
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: Tue Nov 27, 2007 3:00 am    Post subject: Reply to: Going back to file begining
Reply with quote

Yup, some of the very worst performance problems i've helped alleviate is where someone "started over" many, many times in a program.

Nearly always, there is a more effecient way to accomplish the same task.

d
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 27, 2007 3:03 am    Post subject:
Reply with quote

Yep Dick, like sorting the file icon_wink.gif
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: Tue Nov 27, 2007 3:45 am    Post subject: Reply to: Going back to file begining
Reply with quote

Or doing a 2-file merge instead of "searching" thru a file over and over. . . icon_smile.gif

d
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 27, 2007 3:58 am    Post subject:
Reply with quote

Or - how about a database - or - maybe a table? We can come up with a multitude of ideas that are based on years of experience, BUT, if we do not know the business NEED, how can we possibly give the best advice?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 27, 2007 3:36 pm    Post subject:
Reply with quote

In Austria one of my teammembers (hired) has written a balance line program and for each inputrecord closed, reopenened and read the masterfile until the identification met with the inputrecord. In test with some inputrecords it worked but with a large inputfile it ran for hours. We checked all of his other programs and found out he did this all the time. I sacked him, had the programs rewritten including a sort of the inputfile.

But we still don't know what the business case for TS is icon_cry.gif
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 27, 2007 5:18 pm    Post subject:
Reply with quote

Wow, George! Why would anyone do that? Where did he ever come up with that idea?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 27, 2007 5:32 pm    Post subject:
Reply with quote

Beats me.........not well trained and sold himself well to the HR-manager. going to play a round of golf now; cold outside but feel like a hero icon_wink.gif
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: Tue Nov 27, 2007 10:31 pm    Post subject:
Reply with quote

Hello,

Quote:
Why would anyone do that? Where did he ever come up with that idea?
If one was to search around in the forum, many examples of people who do not know how (and don't want to do the work to learn how) to code a simple 2-file match/merge (what George refers to as a "balance line program").

It is one of the most common needs in batch programs and is not taught well (if taught at all) in most programming training. Most newbies make it much harder than it needs to be - it really is quite straightforward. There is a sample-code "sticky" near the top of the cobol forum.

As George mentioned, we still do not know what TS needs to accomplish.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Nov 27, 2007 10:40 pm    Post subject:
Reply with quote

TS is in no hurry since he didn't respond after starting his topic. icon_rolleyes.gif

And there should also be an example of a balance line program I posted. Formerly developed by the teachers of Volmac (now Cap Gemini). They taught and explained it to me in 1970 and I can still dream it. Always works; first you understand the business case and then pick the right solution.
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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