Re: match program example
From: Peter E.C. Dashwood (dashwood_at_enternet.co.nz)
Date: 11/21/03
- Next message: Judson McClendon: "Re: Is cobol a flasher in public?"
- Previous message: docdwarf_at_panix.com: "Re: Cobol Can Do It Better?!"
- In reply to: Warren Simmons: "Re: match program example"
- Next in thread: Warren Simmons: "Re: match program example"
- Reply: Warren Simmons: "Re: match program example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 22 Nov 2003 00:43:46 +1300
Hi Warren,
nice to see you are still reading and posting.
1954 eh?
I guess you are telling me that these techniques had already been worked out
and absorbed into "standard practice" by then, at least in the USA.
When I came along 11 years later, nobody I met knew about this. We all did
kind of what Judson described...used trial and error and evaluated each
attempt, hoping to make the next one better.
The old programmer who put me on to the idea of checking control breaks from
the top down, processing from the bottom up, was a Canadian who had been
working with computers since the 1940s (initially he used to fly around
North America replacing mercury vapour tubes or something equally
esoteric...). He came out to New Zealand with his wife to retire and get a
concrete boat (which NZ pioneered the construction of). Sadly, he died
before it was completed, but I believe his wife later sailed it back to
Canada, with a delivery crew of Kiwis. This same man clued us in to the
ideas of random access and hashing algorithms and was the first man I ever
met to develop what could truly be called a "database", residing on a
Burroughs drum system. (Removablel disks were still largely in the
laboratory and didn't become widely available in New Zealand until the early
1970s).
I am staggered to hear you actually had classrooms teaching this stuff in
the mid-fifties. It just shows how far we were behind the play.
The first programming "course" I ever did was for the NCR 500 (programmed in
machine language, although they later produced an assembler called "SLIP")
and the course was: "Here's a bunch of audio tapes, Dashwood. Listen to them
in your own time. We want an invoicing program next week...". When I asked
why I couldn't attend the actual course at NCR I was informed that there was
no money available for such flim flam and if I wanted a career in computing
I better get stuck in and do the tapes...
I wonder how many people reading this recognise: "Hi... My name is Bob. I am
your instructor on the NCR 500 programming course. Now listen
carefully...."<G>
Of course we caught up eventually. By the early 70s New Zealand was the
first country to have on-line banking with IBM 7770 voice response units.
You could dial the bank and listen to the voice of a well known Radio/TV
personality tell you your balance. (We thought it was super cool...<G>). We
also had a National system for betting on horses (TAB), powered by some
already obsolete Control Data Corporation mainframes which cost $18,000,000
(a staggering sum in those days), and allowed bets to be placed up to 10
minutes before the start, for any meeting anywhere in the country, from any
TAB anywhere in the country. (I was incidentally involved in that, working
as a senior analyst for CDC at that time, and later as a pre-sales support
analyst to the top CDC Australasian Salesman.)
I'd very much like to hear of your first ventures into programing, Warren.
Care to share it with us?
Pete.
"Warren Simmons" <wsimmons5@optonline.net> wrote in message
news:3FBD8710.7090408@optonline.net...
> Well, Peter, I knew what you ment all along. This exercise is
> almost a class exercise from 1954.
>
> Warren (minus the language growth features)
>
> Peter E.C. Dashwood wrote:
> > OOPS!
> >
> > (This is why I hate posting code here...especially when it hasn't been
> > compiled and tested...)
> >
> > Something in the back of my head kept telling me to look again... at
last it
> > drowned out the part that was saying: "It's a beautiful day, let's go
> > swimming..."
> >
> > There were some glaring (when I took the trouble to look) logic errors
in
> > the code I posted and it is amended as follows:
> >
> > 01 CONTROL-BREAK-AREA.
> > 03 CBA-CURRENT.
> > 05 CBA-CURR-LEVEL-1.
> > 07 CBA-CURR-LEVEL-2.
> > 09 CBA-CURR-LEVEL-3.
> > 11 CBA-CURR-LEV-3-FIELD PIC ?(??).
> > 09 CBA-CURR-LEV-2-FIELD PIC ?(??).
> > 07 CBA-CURR-LEV-1-FIELD PIC ?(??).
> > 03 CBA-PREVIOUS.
> > 05 CBA-PREV-LEVEL-1.
> > 07 CBA-PREV-LEVEL-2.
> > 09 CBA-PREV-LEVEL-3.
> > 11 CBA-PREV-LEV-3-FIELD PIC ?(??).
> > 09 CBA-PREV-LEV-2-FIELD PIC ?(??).
> > 07 CBA-PREV-LEV-1-FIELD PIC ?(??).
> >
> >
> > produce-report.
> > OPEN INPUT WORK-FILE output printfile
> > perform get-input
> > MOVE WORK-LEV-3-FIELD TO CBA-CURR-LEV-3-FIELD
> > MOVE WORK-LEV-2-FIELD TO CBA-CURR-LEV-2-FIELD
> > MOVE WORK-LEV-1-FIELD TO CBA-CURR-LEV-1-FIELD
> > * <Depending on Application, may need initial headings for
each
> > * control level to be printed here>
> > PERFORM
> > UNTIL finished
> > MOVE CBA-CURRENT TO CBA-PREVIOUS
> > MOVE WORK-LEV-3-FIELD TO CBA-CURR-LEV-3-FIELD
> > MOVE WORK-LEV-2-FIELD TO CBA-CURR-LEV-2-FIELD
> > MOVE WORK-LEV-1-FIELD TO CBA-CURR-LEV-1-FIELD
> > IF CBA-CURRENT NOT = CBA-PREVIOUS
> > if cba-current < cba-previous
> > * <notify sequence error on input file and
abort>
> > end-if
> > if cba-curr-level-1 = cba-prev-level-1
> > if cba-curr-level-2 = cba-prev-level-2
> > * do level 3 break...
> > * <Print level 3 totals>
> > * <Roll level 3 totals to level 2>
> > * <Print new level 3 heading>
> >
> > else
> > * do level 2 break...
> > * <Print level 3 totals>
> > * <Roll level 3 totals to level 2>
> > * <Print level 2 totals>
> > * <Roll level 2 totals to level 1>
> > * <Print new level 2 and 3 headings>
> > end-if
> > else
> > * do level 1 break...
> >
> > * <Print level 3 totals>
> > * <Roll level 3 totals to level 2>
> > * <Print level 2 totals>
> > * <Roll level 2 totals to level 1>
> > * <Print level 1 totals>
> > * <Roll level 1 totals to Grand Totals>
> > * <Print new headings for all levels>
> > end-if
> > end-if
> > <process the current record>
> > perform get-input
> > end-perform
> > * <Print level 3 totals>
> > * <Roll level 3 totals to level 2>
> > * <Print level 2 totals>
> > * <Roll level 2 totals to level 1>
> > * <Print level 1 totals>
> > * <Roll level 1 totals to Grand Totals>
> > * <print Grand Totals>
> > close work-file
> > printfile
> > stop run
> > .
> > get-input.
> > read work-file
> > at end
> > set finished to TRUE
> > end-read
> > .
> >
> > I'm not claiming this is perfect, but I'm not looking at it again
either...
> >
> > At least it now processes records whether or not there was a control
break
> > <G>.
> >
> > <Presses SEND, picks up towel and car keys, departs...>
> >
> > Pete.
> >
> >
>
- Next message: Judson McClendon: "Re: Is cobol a flasher in public?"
- Previous message: docdwarf_at_panix.com: "Re: Cobol Can Do It Better?!"
- In reply to: Warren Simmons: "Re: match program example"
- Next in thread: Warren Simmons: "Re: match program example"
- Reply: Warren Simmons: "Re: match program example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|