Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title
Copyright
Dedication
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Preface
Chapter 1: Introduction to COBOL
What Is COBOL?
COBOL’s Target Application Domain
COBOL’s Fitness for Its Application Domain
History of COBOL
Beginnings
COBOL Standards
The Argument for COBOL (Why COBOL?)
Dominance of COBOL in Enterprise Computing
Danger, Difficulty, and Expense of Replacing Legacy COBOL Applications
Shortage of COBOL Programmers: Crisis and Opportunity
COBOL: The Hidden Asset
Advantages of Bespoke Software
Characteristics of COBOL Applications
Characteristics of COBOL
Summary
References
Chapter 2: COBOL Foundation
COBOL Idiosyncrasies
COBOL Syntax Metalanguage
Some Notes on Syntax Diagrams
Example Metalanguage
Structure of COBOL Programs
Divisions
The Four Divisions
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
DATA DIVISION
File Section
Working-Storage Section
Data Hierarchy
PROCEDURE DIVISION
Shortest COBOL Program
COBOL Coding Rules
Name Construction
Example Programs
The COBOL Greeting Program
The DoCalc Program
The Condition Names Program
Chapter Exercise
Where to Get a COBOL Compiler
Micro Focus Visual COBOL
OpenCOBOL
Raincode COBOL
Compileonline COBOL
Fujitsu NetCOBOL
Summary
References
Chapter 3: Data Declaration in COBOL
Categories of Program Data
COBOL Literals
Data Items (Variables)
Figurative Constants
Elementary Data Items
Declaring Elementary Data Items
PICTURE Clause Symbols
PICTURE Clause Notes
Example Declarations
Assignment in COBOL
The MOVE Verb
MOVE Syntax
MOVE Rules
MOVE Combinations
MOVE Examples
Structured Data
Group Data Items
Level Numbers
Data Hierarchy
Level-Number Relationships Govern Hierarchy
Summary
Chapter 4: Procedure Division Basics
Input and Output with ACCEPT and DISPLAY
The DISPLAY Verb
The ACCEPT Verb
Example Program: ACCEPT and DISPLAY
Arithmetic in COBOL
Common Arithmetic Template
Nonconforming Arithmetic Verbs
Let’s Write a Program
Summary
Chapter 5: Control Structures: Selection
Selection
IF Statement
Condition Types
Relation Conditions
Class Conditions
Sign Conditions
Complex Conditions
Implied Subjects
Nested IFs
Delimiting Scope: END-IF vs. Period
Condition Names
Defining Condition Names
Using Condition Names Correctly
Example Program
Setting a Condition Name to True
EVALUATE
Decision Tables
EVALUATE Metalanguage
Notes
EVALUATE Examples
Summary
References
Chapter 6: Control Structures: Iteration
Paragraphs Revisited
The PERFORM Verb
Open Subroutines
Closed Subroutines
COBOL Subroutines
Why Use Open Subroutines?
PERFORM NamedBlock
How PERFORM Works
PERFORM..THRU Dangers
Using PERFORM..THRU Correctly
PERFORM..TIMES
Inline Execution
Out-of-Line Execution
PERFORM..UNTIL
Notes on PERFORM..UNTIL
How PERFORM..UNTIL Works
PERFORM..VARYING
Notes on PERFORM..VARYING
How PERFORM..VARYING Works
Summary
References
Chapter 7: Introduction to Sequential Files
What Is a File?
Terminology
Files, Records, and Fields
How Files Are Processed
Implications of Buffers
File and Record Declarations
Creating a Record
Declaring the Record Buffer in Your Program
The SELECT and ASSIGN Clause
SELECT and ASSIGN Syntax
Processing Sequential Files
The OPEN Statement
The CLOSE Statement
The READ Statement
How READ Works
The WRITE Statement
Summary
Chapter 8: Advanced Sequential Files
Files with Multiple Record Types
Problem Specification
Implications of Files with Multiple Record Types
Multiple Record Descriptions, One Record Buffer
The Type Code
Printer Sequential Files
SELECT and ASSIGN
What Is in a Report
Problem of Multiple Print Records
Solution to the Multiple Print Record Problem
WRITE Syntax Revisited
Variable-Length Records
FD Entries for Variable-Length Records
Notes on Varying-Length Records
Example Program
Summary
Chapter 9: Edited Pictures
Edited Pictures
Formatting Output
Immediate Editing
Example Program
Types of Editing
Editing Symbols
Insertion Editing
Simple-Insertion Editing
Special-Insertion Editing
Fixed-Insertion Editing
Floating Insertion
Suppression-and-Replacement Editing
Suppression-and-Replacement Examples
Example Print Lines
Immediate Editing
PICTURE String Restrictions
The PICTURE Clause Scaling Symbol
Rules
Summary
Chapter 10: Processing Sequential Files
File Organization vs. Method of Access
Sequential Organization
Ordered and Unordered Files
Control-Break Processing
Specifications that Require Control Breaks
Detecting the Control Break
Writing a Control-Break Program
Control-Break Program Template
Three-Level Control Break
An Atypical Control Break
Updating Sequential Files
Applying Transactions to an Ordered Sequential File
The File-Update Problem: Simplified
The Full File Update Problem
Full File Update Program
Program Notes
Test Data and Results
Summary
TestData
Notes
Chapter 11: Creating Tabular Data
Tables vs. Arrays
Table/Array Definition
Table/Array Differences
Declaring Tables
OCCURS Clause Rules
Subscript Rules
Why Use Tabular Data?
First Specification
Second Specification
Using a Table for the State Sales Totals
Third Specification: Group Items as Table Elements
Tabular Data Program
Multidimensional Tables
Multidimensional Program
Correct Depiction of COBOL Tables
Three-Dimensional Tables
Prefilled Tables
REDEFINES Clause
Creating Prefilled Tables of Values
Creating a Prefilled Two-dimensional Table
ANS 85 Table Changes
Summary
Specification Extension
Chapter 12: Advanced Data Declaration
The Redefines Clause
Specification: Aromamora Base Oil Sales Report
The REDEFINES Clause
REDEFINES Syntax
REDEFINES Notes
REDEFINES Examples
The RENAMES Clause
RENAMES Syntax
RENAMES Notes
RENAMES Examples
Listing Notes
The USAGE Clause
Representation of Numeric Data
Nonstandard USAGE Extensions
Decimal Arithmetic
Summary
The Problems
Program 1
Program 2
Program 3
Program 4
References
Chapter 13: Searching Tabular Data
SEARCHING Tabular Data
Searching Using SEARCH and SEARCH ALL
INDEXED BY Clause
Using SET to Manipulate the Table Index
The SEARCH Verb
SEARCH Examples
Searching Multidimensional Tables
Searching the First Dimension of a Two-Dimensional Table
The SEARCH ALL Verb
KEY IS Clause
How a Binary Search Works
SEARCH ALL
Variable-Length Tables
Summary
Chapter 14: Sorting and Merging
SORTING
Simple Sorting
Using Multiple Keys
SORT with Procedures
How an INPUT PROCEDURE Works
OUTPUT PROCEDURE
How the OUTPUT PROCEDURE Works
Some Interesting Programs
Sorting Tables: ISO 2002 Changes
Merging Files
MERGE Verb
MERGE Notes
Merging Province Sales Files
Summary
Chapter 15: String Manipulation
The INSPECT Verb
INSPECT
INSPECT
INSPECT: Format 3
INSPECT
String Concatenation
The STRING Verb
String Concatenation Example
String Splitting
The UNSTRING Verb
String-Splitting Program
Reference Modification
Intrinsic Functions
Using Intrinsic Functions
String Functions
DATE Functions
Summary
Chapter 16: Creating Large Systems
Subprograms and the COPY Verb
The CALL Verb
Parameter-Passing Mechanisms
Subprograms
State Memory and the IS INITIAL Phrase
The CANCEL Verb
The IS GLOBAL Clause
The IS COMMON PROGRAM Clause
Example Programs and Their Subprograms
The IS EXTERNAL Clause
Using IS EXTERNAL Data Items
The COPY Verb
The COPY Metalanguage
How COPY Works
How the REPLACING Phrase Works
COPY Examples
Summary
Chapter 17: Direct Access Files
Direct Access vs.Sequential Files
Organization of Relative Files
Processing Relative Files
Reading a Relative File
Creating a Relative File from a Sequential File
Applying Transactions to a Relative File
Relative Files: Syntax and Semantics
Relative Files: SELECT and ASSIGN Clause
Relative File Verbs
Organization of Indexed Files
Processing Indexed Files
Reading an Indexed File
Creating an Indexed File from a Sequential File
Using Indexed Files in Combination
Applying Transactions to an Indexed File
Indexed Files: Syntax and Semantics
Indexed Files: SELECT and ASSIGN Clause
The Key of Reference
Indexed File Verbs
Comparison of COBOL File Organizations
Sequential File Organization
Relative File Organization
Indexed File Organization
Summary
Introduction
General Description
Maintenance Procedure
The Redundant Stock Report
Chapter 18: The COBOL Report Writer
Report Writer
Example Report: Solace Solar Solutions
How the Report Writer Works
Writing a Report Program
Adding Features to the Report Program
Adding More Features to the Report Program
Report Writer Declaratives
Report Writer Syntax and Semantics
Special Report Writer Registers
PROCEDURE DIVISION Report Writer Verbs
Declaratives
Using Declaratives with the Report Writer
Using Declaratives with Files
Summary
Introduction
File Descriptions
Print Specification
Chapter 19: OO-COBOL
Module Strength and Module Coupling
Informational-Strength Modules in COBOL
OO-COBOL
The UseDictionary Program
The Dictionary Class
A Formal Introduction to OO-COBOL
Objects, Classes, and Methods
Programming with Objects
Registering a Class
Declaring Object References
Sending Messages to Instance Objects
Creating a New Object Instance
Destroying Objects
Predefined Object Identifiers
Writing Your Own Classes
The Issue of Scope
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →