COBOL Unit 1
Download
Report
Transcript COBOL Unit 1
UNIT 1
Stephen S. Linkin
Houston Community College System
Graphics
Courtesy of IBM. And
Course Technologies
(Shelly and Cashman)
Copywrite ©
Houston Community College System 2007
8/28/2007
1
Advantages of COBOL
Disadvantages of COBOL
8/28/2007
2
Stream input/output vs. record input/output
Blocking Records
8/28/2007
3
Step 1 - Understand the problem
Step 2 - Design the program
Step 3 - Code the program
Step 4 - Test the program
Step 5 - Document the program
8/28/2007
4
Top-down design/top-down programming
Divisions of a COBOL program
◦
◦
◦
◦
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
DATA DIVISION
PROCEDURE DIVISION
ITERATION
SEQUENCE
CASE
ITERATION
SELECT
8/28/2007
5
Copywrite Houston Community College
System 2007
8/28/2007
6
Copywrite Houston Community College
System 2007
8/28/2007
7
A case study
Copywrite Houston Community College
System 2007
8/28/2007
8
Hierarchy charts
Pseudocode
Flowcharts
Copywrite Houston Community College
System 2007
8/28/2007
9
PROGRAM-ID
AUTHOR,
INSTALLATION,
DATE-WRITTEN,
and
DATE-COMPILED
Comment box
Format notation
Copywrite Houston Community College
System 2007
8/28/2007
10
SELECT statements
Copywrite Houston Community College
System 2007
8/28/2007
11
FILE SECTION
FD level indicator
◦ Level numbers
Picture clauses
WORKING-STORAGE
SECTION
SWITCHES
ACCUMULATORS
Work area fields
Copywrite Houston Community College
System 2007
8/28/2007
12
MAIN-PROGRAM
Initialization
Process-file
Process-record
Heading routine
Wrap-up
Copywrite Houston Community College
System 2007
8/28/2007
13
Designing the Inventory Vendor Report
◦
◦
◦
◦
◦
Inventory Vendor Report
Hierarchy chart
Program flowchart
Inventory File record layout
Inventory Vendor Report program
Copywrite Houston Community College
System 2007
8/28/2007
14
CONFIGURATION SECTION
SPECIAL NAMES
INPUT-OUTPUT SECTION
Copywrite Houston Community College
System 2007
8/28/2007
15
Data categories
◦
◦
◦
◦
◦
Alphabetic (Text)
Alphanumeric (Mixed)
Numeric
Alphanumeric Edited
Numeric Edited
Copywrite Houston Community College
System 2007
8/28/2007
16
Floating dollar signs
Plus sign
Minus sign
Credit symbol and debit symbol
Blank, zero, and slash
BLANK WHEN ZERO clause
JUSTIFIED RIGHT clause
Scaling — P symbol
Copywrite Houston Community College
System 2007
8/28/2007
17
COBOL Field names must be unique
Qualified Names (Implied Duplication)
Copywrite Houston Community College
System 2007
8/28/2007
18
Copywrite Houston Community
College System 2007
8/28/2007
21