View previous topic :: View next topic
|
Author |
Message |
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Close and reopen the file. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
And if it's on tape you can read backwards |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
What business process requires you "start over" at the beginning? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Beware multiple open/closes. It can turn a 10 min job into a 3 hr job. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Yep Dick, like sorting the file |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Or doing a 2-file merge instead of "searching" thru a file over and over. . .
d |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Wow, George! Why would anyone do that? Where did he ever come up with that idea? |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
TS is in no hurry since he didn't respond after starting his topic.
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 |
|
|
|