Slide 1

Slide 1 text

COBOL and Computer Science Andrew Turley (@casio_juarez) Papers We Love NYC April 12, 2017

Slide 2

Slide 2 text

The paper ... “The Relationship Between COBOL and Computer Science” Ben Shneiderman Annals of the History of Computing ( Volume: 7, Issue: 4, Oct.-Dec. 1985 ) But also: “The Early History of COBOL” by Jean Sammet

Slide 3

Slide 3 text

The Relationship Between COBOL And Comp Sci Relationship Status ... Computer Science COBOL

Slide 4

Slide 4 text

The Relationship Between COBOL And Comp Sci Shneiderman presents three perspectives ● Historical ● Technical ● Social/Psychological

Slide 5

Slide 5 text

History

Slide 6

Slide 6 text

History -- April 1959 At a meeting of “computer people” at the University of Pennsylvania Computer Center there is a discussion of the need for a “machine independent common language”

Slide 7

Slide 7 text

History -- May 1959 Meeting held at the Pentagon to discuss the need for a common business language About 40 participants: ● 15 from government ● 11 users and consultants ● 15 representatives of manufacturers

Slide 8

Slide 8 text

History -- May 1959 (continued) Three committees were created to develop a programming language (executive, short-range, long-range) with members from … ● David Taylor Model Basin ● Sylvania Electric Products ● Sperry Rand ● US Steel ● DuPont ● Air Materiel Command ● NCR ● USA - Signal Corps ADPS School ● National Bureau of Standards ● Department of the Navy ● IBM ● US Air Force ● Honeywell ● RCA ● Burroughs

Slide 9

Slide 9 text

History -- June - December 1959 The short-range committee explores language options “to recommend a short-range composite approach (good for at least the next year or two)”

Slide 10

Slide 10 text

History -- June - December 1959 “It was definitely felt that the Intermediate-Range Committee would have the time and resources to develop a really good business data processing language.” -- Sammet

Slide 11

Slide 11 text

History -- June - December 1959 “It was definitely felt that the Intermediate-Range Committee would have the time and resources to develop a really good business data processing language.” -- Sammet Narrator Voice: They didn’t.

Slide 12

Slide 12 text

History -- June - December 1959 “I am certainly convinced in my own mind that had the Short-Range Committee realized at the outset that the language it created was going to be in use for such a long period of time, it would have gone about the task quite differently.” -- Sammet

Slide 13

Slide 13 text

History -- December 1960 Same program runs on two different computers. First real cross-platform language!

Slide 14

Slide 14 text

History -- August 1961 “COBOL: A Sample Problem” appears in Communications of the ACM 7 pages long: ● 2.5 pages of flow charts ● 3 pages of code ● 0 references

Slide 15

Slide 15 text

History -- May 1962 Communications of the ACM issue dedicated to COBOL ● 13 articles about COBOL ● Only 4 have references

Slide 16

Slide 16 text

Technology

Slide 17

Slide 17 text

Technology Goals:

Slide 18

Slide 18 text

Technology Goals: ● Solve business problems EMPLOYEES.DAT JOHN SMITH 13 SALLY JONES 42 ROCK MANLY 42 ... PROJECTS.DAT DEATH-RAY 13 SHARK-BOMB 42 KITTEN-TOES 78 ... PROJECT-HEADCOUNT.DAT DEATH-RAY 01 SHARK-BOMB 02 KITTEN-TOES 00 ... CREATE- PROJECT- HEADCOUNT. CBL

Slide 19

Slide 19 text

Technology Goals: ● Solve business problems ● Cross-platform (“common”) PROGRAM.CBL OUTPUT.DAT

Slide 20

Slide 20 text

Technology Goals: ● Solve business problems ● Cross-platform (“common”) ● English-like language PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA.

Slide 21

Slide 21 text

Technology Goals: ● Solve business problems ● Cross-platform (“common”) ● English-like language ● Verb-base language, “few verbs with many options rather than a large number of verbs with a few options”

Slide 22

Slide 22 text

Technology COBOL program ● Divisions (IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE) ○ Sections ■ Paragraphs ● Sentences ○ Statements

Slide 23

Slide 23 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * environment-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations

Slide 24

Slide 24 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * environment-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations IDENTIFICATION DIVISION. PROGRAM-ID. SAMPLE. AUTHOR. CASIO JUAREZ. DATE-WRITTEN. 04/06/17.

Slide 25

Slide 25 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * environment-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SAMPLE-FILE ASSIGN TO "S.DAT" ORGANIZATION IS LINE SEQUENTIAL.

Slide 26

Slide 26 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * environment-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations DATA DIVISION. FILE SECTION. FD SAMPLE-FILE. 01 SAMPLE-DATA. 88 END-SAMPLE-DATA VALUE HIGH-VALUES. 02 SAMPLE-NAME. 03 FIRST-NAME PIC X(8). 03 LAST-NAME PIC X(8). 02 DATE-OF-BIRTH. 03 YOB PIC 9(4). 03 MOB PIC 9(2). 03 DOB PIC 9(2). WORKING-STORAGE SECTION. 01 GENERATION PIC X(10). 01 BOOMER PIC X(10) VALUE "boomer". 01 GEN-X PIC X(10) VALUE "gen X". 01 MILLENNIAL PIC X(10) VALUE "millennial". 01 UNKNOWN PIC X(10) VALUE "???". * define record (data) structure Input Record Format (SAMPLE-DATA): |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _|_ _ _ _|_ _|_ _| | FIRST-NAME | LAST-NAME | YOB |MOB|DOB| | SAMPLE-NAME | DATE-OF-BIRTH | | SAMPLE-DATA |

Slide 27

Slide 27 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * environment-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X ELSE SET GENERATION TO UNKNOWN. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. Input Record Format (SAMPLE-DATA): |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _|_ _ _ _|_ _|_ _| | FIRST-NAME | LAST-NAME | YOB |MOB|DOB| John Smith 19500210 Stacy Jones 19781015 Kendra Manning 19840323

Slide 28

Slide 28 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X ELSE SET GENERATION TO UNKNOWN. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. Paragraphs Significant whitespace

Slide 29

Slide 29 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X ELSE SET GENERATION TO UNKNOWN. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM

Slide 30

Slide 30 text

Technology IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X ELSE SET GENERATION TO UNKNOWN. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE.

Slide 31

Slide 31 text

Technology At first there was only one string processing command (INSPECT) and it was pretty weak

Slide 32

Slide 32 text

Technology Every sentence could end with “AND GO TO …”

Slide 33

Slide 33 text

Technology No local variables, no real procedure calls

Slide 34

Slide 34 text

Psychology

Slide 35

Slide 35 text

Psychology Data processing was not seen as an interesting problem

Slide 36

Slide 36 text

Psychology Professors were not interested in running “trade schools”

Slide 37

Slide 37 text

Psychology English seemed “unscientific”

Slide 38

Slide 38 text

Conclusions

Slide 39

Slide 39 text

Conclusions COBOL ignored academic computer science (for better or worse)

Slide 40

Slide 40 text

Conclusions COBOL was widely adopted and used

Slide 41

Slide 41 text

Conclusions COBOL was a flawed language

Slide 42

Slide 42 text

Thanks! Further Reading ● “The Relationship Between COBOL and Computer Science” Ben Shneiderman ● “The Early History of COBOL” Jean Sammet ● “Learning To Program In Structured COBOL: Parts 1 & 2” Yourdon et al ● Communications of the ACM, May 1962 ● Micro Focus (microfocus.com) -- Go to a COBOL Dev Day!

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

A Brief Introduction to COBOL

Slide 46

Slide 46 text

A Brief Introduction to COBOL COmmon → write once, run anywhere! Business Oriented → record processing, extract-transform-load (ETL) Language → English-like syntax (verbs, nouns, sentences, paragraphs)

Slide 47

Slide 47 text

A Brief Introduction to COBOL -- Code IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations

Slide 48

Slide 48 text

A Brief Introduction to COBOL -- Code IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations IDENTIFICATION DIVISION. PROGRAM-ID. SAMPLE.

Slide 49

Slide 49 text

A Brief Introduction to COBOL -- Code IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SAMPLE-FILE ASSIGN TO "S.DAT" ORGANIZATION IS LINE SEQUENTIAL.

Slide 50

Slide 50 text

A Brief Introduction to COBOL -- Code IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations DATA DIVISION. FILE SECTION. FD SAMPLE-FILE. 01 SAMPLE-DATA. 88 END-SAMPLE-DATA VALUE HIGH-VALUES. 02 SAMPLE-NAME. 03 FIRST-NAME PIC X(8). 03 LAST-NAME PIC X(8). 02 DATE-OF-BIRTH. 03 YOB PIC 9(4). 03 MOB PIC 9(2). 03 DOB PIC 9(2). WORKING-STORAGE SECTION. 01 GENERATION PIC X(10). 01 BOOMER PIC X(10) VALUE "boomer". 01 GEN-X PIC X(10) VALUE "gen X". 01 MILLENNIAL PIC X(10) VALUE "millennial". 01 UNKNOWN PIC X(10) VALUE "???". * define record (data) structure Input Record Format (SAMPLE-DATA): |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _|_ _ _ _|_ _|_ _| | FIRST-NAME | LAST-NAME | YOB |MOB|DOB| | SAMPLE-NAME | DATE-OF-BIRTH | | SAMPLE-DATA |

Slide 51

Slide 51 text

A Brief Introduction to COBOL -- Code IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. SET GENERATION TO UNKNOWN. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE.

Slide 52

Slide 52 text

A Brief Introduction to COBOL -- Historical Position Steve Russell writes the first implementation of LISP → (early? late?) 1959 Discussion of developing “a problem-oriented but machine independent common language for business problems” → UPenn April, 1959 “Recursive Functions of Symbolic Expressions And Their Computation By Machine” → CACM April, 1960 “Essentially the same COBOL program was run on [two computers]” → December 1960 “COBOL: a sample problem” → CACM August, 1961 The COBOL issue → CACM May, 1962

Slide 53

Slide 53 text

A Brief Introduction to COBOL -- Assumptions Technical ● business users want to read records from files, process them, and write new records to other files ● records have a fixed number of fixed-size fields ● files are generally stored on separate storage media (like tapes) Non-Technical ● “managers” (non-technical people) should be able to read and write code ● making a programming language similar to a “real” language will make it easier to read and write ● mathematical notation is off-putting

Slide 54

Slide 54 text

“The Relationship Between COBOL and Computer Science” Ben Shneiderman, 1985

Slide 55

Slide 55 text

The Relationship Between COBOL and Comp Sci “For a computer scientist to write sympathetically about COBOL is an act bordering on heresy.” Historical Perspective Technical Perspective Social/Psychological Perspective

Slide 56

Slide 56 text

Historical Perspective

Slide 57

Slide 57 text

Historical Perspective “academic computer scientists did not participate in the design team”

Slide 58

Slide 58 text

Historical Perspective “academic computer scientists did not participate in the design team” COBOL contributors came from: US Air Force Honeywell RCA Burroughs Corporation David Taylor Model Basin Sylvania Electric Products IBM Speary Rand Bureau of Ships US Steel Corporation DuPont Company Air Materiel Command NCR USA - Signal Corps

Slide 59

Slide 59 text

Historical Perspective “the COBOL developers apparently had little interest in the academic or scientific aspects of their work”

Slide 60

Slide 60 text

Historical Perspective “the COBOL developers apparently had little interest in the academic or scientific aspects of their work” CACM of May 1962 was dedicated to COBOL, only four papers had any references.

Slide 61

Slide 61 text

Historical Perspective “the COBOL developers apparently had little interest in the academic or scientific aspects of their work” CACM of May 1962 was dedicated to COBOL, only four papers had any references. But … “Thus, of 15 papers presented at an Office of Naval Research (ONR) symposium on automatic programming for digital computers in May 1954 [2], only two have separate acknowledgements and none refers to other papers.” -- Backus, “Programming in America in the 1950s- Some Personal Impressions”

Slide 62

Slide 62 text

Historical Perspective “the decision of the developers to not use the Backus-Naur Form notation as the metalanguage to describe COBOL”

Slide 63

Slide 63 text

Historical Perspective “the decision of the developers to not use the Backus-Naur Form notation as the metalanguage to describe COBOL” COBOL Committee invented their own specification language

Slide 64

Slide 64 text

Historical Perspective “the decision of the developers to not use the Backus-Naur Form notation as the metalanguage to describe COBOL” COBOL Committee invented their own specification language BNF first used to describe ALGOL 60 “Specification Languages for Mechanical Languages And Their Processors …” includes BNF, along with others → Gorn, ACM December, 1961

Slide 65

Slide 65 text

Historical Perspective “A fourth concern is the process of describing COBOL to the academic and industrial community”

Slide 66

Slide 66 text

Historical Perspective “A fourth concern is the process of describing COBOL to the academic and industrial community” Translation: For a long time there were no good books “emphasizing the conceptual foundations of COBOL”

Slide 67

Slide 67 text

Historical Perspective “the people who might have accepted the title of computer scientist in 1960 were not interested in the problem domain of COBOL programs”

Slide 68

Slide 68 text

Historical Perspective “the people who might have accepted the title of computer scientist in 1960 were not interested in the problem domain of COBOL programs” COBOL was good at: ● data processing

Slide 69

Slide 69 text

Historical Perspective “the people who might have accepted the title of computer scientist in 1960 were not interested in the problem domain of COBOL programs” COBOL was good at: ● data processing Computer scientists were interested in: ● numerical analysis ● physics ● engineering ● systems programming

Slide 70

Slide 70 text

Technical Perspective Successes

Slide 71

Slide 71 text

Technical Perspectives - Successes Record Structure ● aggregation of dissimilar items ● hierarchy of names for fields DATA DIVISION. FILE SECTION. FD SAMPLE-FILE. 01 SAMPLE-DATA. 88 END-SAMPLE-DATA VALUE HIGH-VALUES. 02 SAMPLE-NAME. 03 FIRST-NAME PIC X(8). 03 LAST-NAME PIC X(8). 02 DATE-OF-BIRTH. 03 YOB PIC 9(4). 03 MOB PIC 9(2). 03 DOB PIC 9(2). WORKING-STORAGE SECTION. 01 GENERATION PIC X(10). 01 BOOMER PIC X(10) VALUE "boomer". 01 GEN-X PIC X(10) VALUE "gen X". 01 MILLENNIAL PIC X(10) VALUE "millennial". 01 UNKNOWN PIC X(10) VALUE "???". * define record (data) structure Input Record Format (SAMPLE-DATA): |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _|_ _ _ _|_ _|_ _| | FIRST-NAME | LAST-NAME | YOB |MOB|DOB| | SAMPLE-NAME | DATE-OF-BIRTH | | SAMPLE-DATA |

Slide 72

Slide 72 text

Technical Perspectives - Successes “[S]eparation of data definition from procedural aspects” IDENTIFICATION DIVISION. * program name ENVIRONMENT DIVISION. * machine-dependent stuff DATA DIVISION. * define record (data) structure PROCEDURE DIVISION. * define operations

Slide 73

Slide 73 text

Technical Perspectives - Successes Diverse set of control structures ● IF-THEN-ELSE ● PERFORM

Slide 74

Slide 74 text

Technical Perspectives - Successes COPY keyword (kind of like “include”, copied content of a file into a program) ● organizational standards were easily enforced ● improved cooperation ● encouraged code reuse

Slide 75

Slide 75 text

Technical Perspectives - Successes ENVIRONMENT Division ● specify machine or compiler dependencies

Slide 76

Slide 76 text

Technical Perspectives - Successes Portability and standardization ● first truly cross-platform language

Slide 77

Slide 77 text

Technical Perspective Failures

Slide 78

Slide 78 text

Technical Perspectives - Failures No local variables ● required careful coordination of collaborators ● in 1974 CALL-USING was added, permitted parameters and runtime creation of procedure names

Slide 79

Slide 79 text

Technical Perspectives - Failures English-like languages ● supposed to be readable by managers ● “too wordy”, “somehow unscientific”

Slide 80

Slide 80 text

Technical Perspectives - Failures Poor control flow readability ● originally, IF blocks were terminated with a period (“.”), which was easily missed when reading code PROCEDURE DIVISION. BEGIN. OPEN INPUT SAMPLE-FILE. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE. PERFORM REPORT-GENERATION UNTIL END-SAMPLE-DATA. CLOSE SAMPLE-FILE. STOP RUN. REPORT-GENERATION. SET GENERATION TO UNKNOWN. IF YOB >= 1980 SET GENERATION TO MILLENNIAL ELSE IF YOB >= 1946 AND YOB < 1965 SET GENERATION TO BOOMER ELSE IF YOB >= 1965 AND YOB < 1980 SET GENERATION TO GEN-X. DISPLAY FIRST-NAME SPACE LAST-NAME SPACE GENERATION. READ SAMPLE-FILE AT END SET END-SAMPLE-DATA TO TRUE.

Slide 81

Slide 81 text

Technical Perspectives - Failures Poor string handling ● EXAMINE, TALLYING, REPLACING ● in 1974 added INSPECT, STRING, UNSTRING

Slide 82

Slide 82 text

Social/Psychological Perspective

Slide 83

Slide 83 text

Social/Psychological Perspective “fundamental differences between the computer science and business data processing communities”

Slide 84

Slide 84 text

Social/Psychological Perspective “fundamental differences between the computer science and business data processing communities” ● dismissed the complexity of the problem of data processing

Slide 85

Slide 85 text

Social/Psychological Perspective “fundamental differences between the computer science and business data processing communities” ● dismissed the complexity of the problem of data processing ● had difficulty describing data processing problems with their theories

Slide 86

Slide 86 text

Social/Psychological Perspective “fundamental differences between the computer science and business data processing communities” ● dismissed the complexity of the problem of data processing ● had difficulty describing data processing problems with their theories ● “university professors did not like dealing with current practice”