Chapter 1


What is a Computer Program?

Applications Programs

Customized Application Programs

Applications Package

Program Languages

Machine language

Symbolic language (like COBOL)

Compiled

Program Development Process

Determine Program Specifications

Describe the I/O

Record layout forms describe format of input and output data

Printer spacing charts describe

Spacing, layout, heading, errors

Design Program Using Program Planning Tools

Flowcharts, Pseudocode, Hierarchy charts

Code and Enter Program

Compile Program

Translates, checks for errors

Test Program

Compile errors

Run-time errors

Logic errors

Document Program

Manuals not comments, operator, programmer for example

Nature of COBOL

Business-oriented language

Standard language

English-like language

Relatively easy to understand

History of COBOL

Developed in 1959 as standard language to meet needs of business

Committee to develop language convened by Department of Defense

Included representatives from academia, business, computer manufacturers

Versions, 1968, 1974, 1985

1985 most widely used

2002+ use this in the book, plus 1985, should know older versions for work

Future of COBOL?

Use of COBOL

About 200 billion lines of COBOL source code in use

5 billion new lines added each year

Used by 42.7% of application programmers in medium to large U.S. companies

$200 million in expected revenues for 2001

Improving Program Design

Structured Programming what is it and why?

Top-Down Programming what is it and why?

Interactive vs Batch Programs

Cobol suited for developing both types of programs

Interactive programs

Accept input data from keyboard

Input data processed immediately

Output (results) displayed on screen immediately

Batch programs

Process large volumes of input at periodic intervals

Input data read in from files

Output written to files

Overview of the Four Divisions

Every COBOL program contains up to four separate divisions in the following order:

IDENTIFICATION DIVISION

ENVIRONMENT DIVISION

DATA DIVISION

PROCEDURE DIVISION

IDENTIFICATION DIVISION

Identifies program to operating system

Provides documentation about program

ENVIRONMENT DIVISION

Defines file-names

Describes devices used to store them

Not included in fully interactive programs

DATA DIVISION

Describes input and output format of data in files

Defines any constants and work areas

FILE SECTION required for batch programs that operate on files

WORKING-STORAGE SECTION for work fields or fields used in interactive programs

PROCEDURE DIVISION

Contains instructions to read input, process it and create output