ie8 fix

BIt: From Chapter one: Data Processing and the IBM Mainframe

By | June 6, 2008, 12:15am PDT

Summary: COBOL reflects 1920s ways of thinking about data processing - and has critically influenced multiple generations of data processing thinkers since. T

From Chapter one: Data Processing and the IBM Mainframe

This is the 4th excerpt from the second book in the Defen series: BIT: Business Information Technology: Foundations, Infrastructure, and Culture

Note that the section this is taken from, on the evolution of the data processing culture, includes numerous illustrations and information inserts omitted here.

Roots (part two: COBOL)

With Flowmatic, the program that read the script telling the computer in what order to assemble the pre-made binary modules to produce a runnable program included the ability to transfer data values between elements, thus producing a compilation consisting of both code and data and warranting its own renaming as a compiler instead of an assembler.

Further work on Flowmatic formed the experimental basis for a 1952 paper by Dr. Hopper on compiler theory that heavily influenced a team, led by John Backus, at IBM’s Watson Scientific Laboratory, that worked between 1954 and 1957 to develop FORTRAN (Formula translation) for use in scientific work.

BASIC
Six years later Backus was at Dartmouth college where he worked with two mathematicians, John Kemeny and Kenneth Kurtz, on a 1964 Fortran variant that simplified array management and dropped most variable declarations. It was intended for use by students not pursuing programs in math or science and known as the Beginners All purpose Symbolic Instruction Code, or BASIC.

Subsequent progress in the development and use of Flowmatic fell somewhat off the mainstream of computing research in the period largely because most of the hardware and software research was focused on numerical processing rather than automatic data processing. Thus most of the software research focused on languages like Fortran and most of the hardware research focused on developing and managing larger memory sub-systems and faster floating point processors.

When Remington Rand bought the Flowmatic project with its acquisition of the Eckert-Mauchly Computer Corporation, its executives inherited the UNIVAC line and with it a focus on dealing with naval logistics and related problems. As a result, Rand funded additional research on compilers and the problems associated with storing and manipulating characters, rather than numbers.

By 1957, the year in which IBM released the first disk drive, Flowmatic had developed to the point of commercial release, causing an immediate demand for its standardization among other commercial computer manufacturers eager to take advantage of the new tool. Because Flowmatic’s development at Unisys had been funded as an unclassified project by the U.S. Navy it was theoretically in the public domain and various companies, including IBM, used this as part of their basis for laying claim to it.

That pressure resulted in a 1959 Conference on Data System Languages (CODASYL) at which IBM representative Bob Bemer and others succeeded in having the consensus version of Flowmatic made widely available and renamed Common Business Oriented Language, or COBOL.

As a programming language COBOL inherited all of its key characteristics from Flowmatic and the card deck management problem it addressed. Thus COBOL’s designation as the primary language for commercial data processing directly perpetuated those ideas and later heavily influenced how people saw and managed commercial system design. This effect transcended both hardware and software since people thought in terms of COBOL and built both hardware and applications accordingly.

Since Flowmatic’s fundamental design reflected the problem its designers were dealing with - handling naval logistics with the mechanical tabulators available to them- it focused on automating program flow in a step-wise process built around first sorting, and then tabulating, punch cards.

Thus the fundamental operations in COBOL are to attach a file or device, read from the file or device into memory, do something with the data now in memory, and write out the result.

Notice the co-evolution here: the assumptions made about programming in COBOL came from the 1940s Flowmatic effort to automate 1920s card batch management, and the structure of the resulting language then influenced generations of hardware and software designers and managers.

Among other effects, this meant that COBOL programs would tend to be much more I/O than CPU limited and implicitly created a need for temporary, “near memory,” storage for data being held pending completion of an I/O operation - thus defining the architecture for today’s most expensive mainframes.

COBOL was first codified in 1959; five years later, in 1964, IBM released the matching System 360 computer family and completely revolutionized the systems industry. Thus the 360 reflected in hardware the fundamental COBOL operations which, themselves, derived from the card sorting requirements of pre-digital data processing. Even then IBM was still hedging its bet on commercial data processing so the 360 was designed to be an “all round” processor which could be configured to excel at either scientific or commercial processing depending on customer needs, while maintaining backward instruction set compatibility with two previous, and mutually incompatible, IBM computer products:

A COBOL PRIMER -part 1
In 1985 a competent COBOL programmer was expected to produce about 15 lines of tested code per day.

Every COBOL program must have four hard divisions:

  1. An identification division
  2. An environment division
  3. A data division
  4. A procedure division

The examples used below come from the headers for those divisions in a COBOL66 program that ran just over 340,000 lines in nine major program pieces - each with these four main divisions. It was used to process Canadian health care claims and cost over $20,000,000 to develop in the early seventies.

The Identification Division specifies at least the program name and identifies the project manager or primary author for the code.

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. PCLMPROC1.
000300 AUTHOR. PAUL MURPHY.
000400 *

The environment division contains the file names and other local information that are later associated with the program in the JCL batch control for it. This may include the id for the computer it is intended to run on and typically has both configuration and I/O sections.

000500 ENVIRONMENT DIVISION.
000501 SOURCE-COMPUTER IBM-XXXXXX-3081.
000550 OBJECT-COMPUTER IBM-XXXXXX-3084Q.
000600 INPUT-OUTPUT SECTION.
000700 FILE-CONTROL.
000800 SELECT CLAIMS-01-FILE ASSIGN to “IN1″.
000900 SELECT CLAIMS-11-FILE ASSIGN to “OUT1″.
001000 *

Specifying the computer to be used at run-time may seem odd today, but in the OS/360 environment machines were custom installed and individual machines often differed significantly in terms of internals like default instruction sets or externals like the choice of EBCDIC print trains or device naming.

Many compilers therefore had “cross compile” capabilities in which a compile job run on one 360 architecture machine produced code that incorporated device names and other external JCL information of relevance only to the target run-time machine - another 360 architecture unit.

The data division defines the variables to be used and the space needed for each (defined separately in the Working Storage sub-section); and,

001100 DATA DIVISION.
001200 FILE SECTION.
001300 FD CLAIMS-01-FILE
001400 DATA RECORD IS RAW-CLAIM.
001500 01 RAW-CLAIM-HDR.
001600 03 REC-CODE-IN PIC X(3).
001700 03 DATA-CENTRE-NUM.
001800 05 DATA-CENTRE-UNINUM PIC 9(7).
001900 05 DATA-CENTRE-SEQNUM PIC 9(7).
002000 05 DATA-CENTRE-BATNUM PIC 9(7).
002100 03 PAYEE-NUM PIC X(5).
002200 03 PRACTITIONER-NUM PIC X(5).
002200 03 PRACTITIONER-NAME.
002300 05 PR-FIRST-NAME PIC X(12).
002400 05 PR-SECOND-INITIAL PIC X(1).
002500 05 PR-SURNAME PIC X(18).


010000 PROCEDURE DIVISION.
011000 0100 START-PROGRAM.
012000 OPEN INPUT CLAIMS-01-FILE,
012000 READ CLAIMS-01-FILE,

…which first connects files and claims memory

022000 MOVE ZEROS TO EOB-FLAG.
022001 SET BASE-RECORD-TMP TO NULL.
022000 MOVE SPACES TO PRACT-NAME-TMP.

… then initializes variables

101017 IF PRACTITIONER-ID-TMP = `1′
101018 MOVE `EOB’ TO EOB-FLAG
101019 PERFORM PROCESS-AT-END-OF-BLOCK.

…and finally does something with them

… before eventually clearing memory and stopping

xxxxxxx STOP RUN.
xxxxxxx END PROGRAM.
xxxxxxx END PROGRAM.

The key lesson to learn about COBOL? Long, boring, strings of tabulating machine setup and operations.

Some notes:

  1. These excerpts don’t include footnotes and most illustrations have been dropped as simply too hard to insert correctly. (The wordpress html “editor” as used here enables a limited html subset and is implemented to force frustrations like the CPM line delimiters from MS-DOS).
  2. The feedback I’m looking for is what you guys do best: call me on mistakes, add thoughts/corrections on stuff I’ve missed or gotten wrong, and generally help make the thing better.

    Notice that getting the facts right is particularly important for BIT - and that the length of the thing plus the complexity of the terminology and ideas introduced suggest that any explanatory anecdotes anyone may want to contribute could be valuable.

  3. When I make changes suggested in the comments, I make those changes only in the original, not in the excerpts reproduced here.

Kick off your day with ZDNet's daily e-mail newsletter. It's the freshest tech news and opinion, served hot. Get it.

Topics

Paul Murphy (a pseudonym) is an IT consultant specializing in Unix and related technologies.

Disclosure

Paul Murphy

I do not work for, or otherwise receive anything from, any of the companies I write about. I have some money in a number of funds that bet on the markets, including the technology market, but have no direct control over how these funds are administered or what investments are made. I use Sun and Apple technology both at home and at work.

Biography

Paul Murphy

Originally a Math/Physics graduate who couldn't cut it in his own field, Paul Murphy (a pseudonym) became an IT consultant specializing in Unix and related technologies after a stint working for a DARPA contractor programming in Fortran and APL. Since then he's worked in both systems management and consulting for a range of employers including KPMG, the government of Alberta, and his own firm. In those roles he's "been there and done that" for just about every aspect of systems management and operation.

10
Comments

Join the conversation!

Just In

Simple solution for simple problems
Mark Miller 9th Jun 2008
Human logic at its most simple and direct

I agree the instructions are simple and direct, but the way Cobol handled variables was not good, IMO. Once you get to programs that are beyond simple "hello world" stuff, dealing with variables in it gets more and more unmanageable. I know because I tried it. In my experience, variable scoping really helps with writing code that makes sense to the reader.

Also, narratives are good for narrative's sake, but for the sake of building a system I don't think narratives scale well at all. I agree they're probably good for beginning programmers, just learning about this new world of programming, but if you want to deal in the realm of real world systems, narratives don't work well unless you have some scoping involved that isolates it so its lack of scalability doesn't adversely affect your ability to scale up a software system.
0 Votes
+ -
Reading this gives me the shakes...
IT_Guy_z 6th Jun 2008
...by bringing back my days at the Chubb Institute in 1991, learning BASIC, OS JCL & COBOL. MANY hours of flow charting...WITH PENCIL & PAPER...and many more hours at a terminal trying to get what I wrote to run.

I did have the "honor" of locking up an IBM 360 mainframe one day so badly, that not even the instructor or the mainframe operator could figure out how to get it back up. They had to send everyone home for the day while they got it back on line. Oh well...I had a gift! wink

That started my career in IT, after 25 years in the airline business. Looking back now, it was a good move.

Thanks for the memories.
I don't remember the model of the mainframe but it was a Honeywell with 512K of core memory allocating 4k chunks. It probably serviced 50 - 100 terminals about 12 for students, another dozen for systems analysts and the rest scattered through the school for administration.

I was using TRS-80 as a dumb terminal using an acoustic coupler and I ran ackermann's function. The OS on that system was not configured to yield unless an I/O occurred. Well since it was simply number crunching it had no I/O and it used up all the courses time on the machine for the semester and prevented all the system jobs the school was scheduled to run from running. I kept waiting for the function to return. I didn't really understand that a single jump up in a digit could go from something that would take 10 minutes to compute to something that no modern computer even today could compute. I got sleepy and went to bed, thinking I would have the result in the morning ... my bad!
Totally clueless, when I got to class, the Prof was distressed. We only had a class account so he didn't immediately know it was me. I think I confessed.

BTW, I wasn't always in an interactive session on the dumb terminal. Sometimes I would submit a batch job, basically virtual punch cards with JCL and everything. I had to have a ruler on the screen so I knew which column I was on.

I could even do RPG II this way.
0 Votes
+ -
Been there, done that
murph_z 6th Jun 2008
1) My proudest moment: hung all four computing science Vax 750s at the same time - to the point they had to be powered down. Ooops!

2) My worst: accidently wrote an infinite loop into a program running on Sharp's APL time sharing service - at $6,000 (?)CPU/hr.. ran for several hours. (They forgave it - Thanks Ian!)

3) Weirdest: a program tape from a machine in Heidleberg (a model 370 IBM denies ever making!) loaded on an ancient 360 at the University of Saskatchewan (third tier emergency backup site) actually ran - but produced the wrong answers and caused a cluster-(something) that ran for days.
0 Votes
+ -
It was a bit tough
Roger Ramjet 6th Jun 2008
But I managed by hook and by crook to NEVER learn COBOL. I never took the class, I never took a job - because I knew. I knew that COBOL is the scarlet letter - once you know it, you will never shake it. IOW if you list COBOL on your resume, you will attract COBOL job offers (and nothing else?).

There are less CS majors graduating every year. Most colleges scrapped their mainframes years ago. Most mainframers are getting near their retirement years. Question: If companies are still enamored with mainframes, where do they find the talent to run them?

I (luckily) never learned IBM mainframes either. IU'm a MULTICS and VAX man myself . . .
0 Votes
+ -
Every COBOL program tells a story.
Anton Philidor 6th Jun 2008
Centre? COBOL reads Canadian? And some foolishly consider it not a flexible language...


Look at those active verbs: open, read, move, set, perform. The reader even knows when the hell-for-leather ride is slowing to its close: stop run, end program. And then that simultaneously emphatic and mournful close, a repetition of End program. A resolve worthy of classical music.

Computer programs are written in the vocative, so tension is hard to sustain when only an occasional If statement allows for exceptions to the commands. But tension is supplied by the programmer, whose voice in the code is obviously confident and direct and certain of his path. While in his heart he knows that failure can turn confidence to bravado and some kind of failure is almost inescapable.

Hemingway only gave the impression of trying to write COBOL. ee cummings gave the impression of a malfunctioning typewriter. Evelyn Waugh knew the value of a simple sentence structure, but COBOL has no room for the rueful or ironic or even observant of human nature.

Instead, COBOL is a reflection of the cold clear and sharp, or at least it's read better in the reflection of the cold clear and sharp. Shows the proof.
0 Votes
+ -
More drudge than drama...
Mac Hosehead 6th Jun 2008
Particularly if the code was maintained on punched cards. I also never got used to spelling out arithmetic operations.
0 Votes
+ -
Actually COBOL reflects
murph_z 6th Jun 2008
a very simple minded machine - but hey, I'm glad you understand it's beauty and appeal.

(and Yes, (snicker) the "it's" errun
(error+pun) is intended. )
happy
0 Votes
+ -
Human logic at its most simple and direct.
Anton Philidor 9th Jun 2008
The reason for describing a COBOL program as a story: stories are how people learn because they reflect how people think. Vary from that to use a logic more appropriate to the complicated machine and you're complicating the programmers job dangerously.

That is, as you wrote, the beauty and appeal of COBOL. Elaborations are supposed to avoid the drudgery without losing the simplicity and directness.

Speaking of stories, to keep this section from appearing a tangent, I suggest you state and repeat the contrast you're setting up at least once a chapter. Otherwise, this kind of narrative flow says "Skip me" to someone awaiting the more modern and relevant.

And you would never make a point in order to gain some benefit from your erudition, of course.
0 Votes
+ -
Simple solution for simple problems
Mark Miller 9th Jun 2008
Human logic at its most simple and direct

I agree the instructions are simple and direct, but the way Cobol handled variables was not good, IMO. Once you get to programs that are beyond simple "hello world" stuff, dealing with variables in it gets more and more unmanageable. I know because I tried it. In my experience, variable scoping really helps with writing code that makes sense to the reader.

Also, narratives are good for narrative's sake, but for the sake of building a system I don't think narratives scale well at all. I agree they're probably good for beginning programmers, just learning about this new world of programming, but if you want to deal in the realm of real world systems, narratives don't work well unless you have some scoping involved that isolates it so its lack of scalability doesn't adversely affect your ability to scale up a software system.
0 Votes
+ -
Tried these once, vowed never again
Mark Miller 9th Jun 2008
When I was getting my Bachelor's in CS years ago we were required to take some technical or scientific courses that had nothing to do with CS. Since I had heard of Cobol through my CS courses I decided to take it. I also took a course in IBM JCL. Didn't like either one of them.

There are a couple JCL operations I can name to this day: IEBGENER, and COND. I remember that we used IEBGENER to copy files. COND was a weird one, but I realized later why it worked the way it did. The way COND worked was it would execute what we could call a "then" clause only if the conditional expression was false. So you had to live in "opposite-land" for a bit each time you did one of these. Fortunately I had gotten some training in Boolean math from my work in CS before I got there. I used DeMauvre's Theorem, which states that NOT (a AND b) is equal to NOT a OR NOT b. The same goes for OR. The logical operation is flipped and the NOT is "factored" into the operands. So I could still "think in the positive" (if X is true then...), and just apply this to the expression to get the COND expression I wanted.

In a compilers course I took I learned that an if-then-else statement in modern languages translates to:

IF NOT (expr) THEN BRANCH Else
(stmt-if-true)
BRANCH Afterelse
Else: (stmt-if-false)
Afterelse: (rest of code)

In other words, if the boolean expression evaluated to True, execution would just fall through to stmt-if-true. Otherwise it would go to stmt-if-false.

What COND appeared to be doing under the covers was:

IF (expr) THEN BRANCH Aftercond
(stmt-if-logically-true)
Aftercond: (rest of code)

Simple to implement, but hard to understand, at least the way it was presented to us. It probably would've been explained better as "Use COND to execute exceptions."

One part of IBM MVS that gave me some insight was its use of packages for file storage. MVS didn't use "folders" or directories. Instead it had packages, which were kind of like disk images, where you could categorize and sub-categorize files, and would be addressed a lot like directories, but with periods (".") as the delimiters. I discovered some years later that the structure of files on Macintosh disks was similar to this scheme, though the categorization structure was standardized. Typical users didn't have access to it. The OS or applications dealt with it.

I thought I would like Cobol, because the instructions were so mneumonic. Words appeared to go together in sentences and paragraphs and such, and I liked that idea. The problem was I was so used to variable scope by then that moving to Cobol felt like moving back to the BASIC I used to program in on 8-bit computers, with line numbers, and all variables being global in scope. I left that world when I graduated high school.

I liked variable scoping because it allowed me to place variables close to the relevant code. In Cobol all variables had to be declared up front towards the top of the file. Also, I could not have two record fields of the same name even if they were in different records. As far Cobol was concerned, record fields were also global variables. I had to remember what I named everything up at the top of the Cobol file. In one program I remember I had about 30 record fields divided among about 6 record types. It drove me nuts. I never wanted to touch it again.

Join the conversation!

Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]
ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

White Papers, Webcasts, & Resources
ie8 fix