Professional Documents
Culture Documents
Cobol (Common Business Oriented Language)
Cobol (Common Business Oriented Language)
As a programming language
Oriented towards business applications
Supports Procedural Programming (from
COBOL-60)
Supports Structured Programming (from
COBOL-68)
Features
As a programming language
Supports Machine Independent
Programming (from COBOL-73)
Supports Object oriented programming
(from COBOL-2002)
Features
As a high-level language
English like
Problem oriented
Self-documenting
Multi-platform support
Easy to learn/read/write and maintain
Program Structure
PROGRAM
DIVISIONS
SECTIONS
PARAGRAPHS
ENTRY SENTENCES
CLAUSE STATEMENT
PHRASE
WORDS CHARACTERS
Character Set
Keywords
The spelling of words are American
English and not British
COBOL supports abbreviations in many
cases
User Defined Words
Numeric Literals
May consist of
numerals
decimal point (.)
1 decimal character is allowed
Should not be the rightmost character
plus or minus sign
1 sign character (+ or -) is allowed
Leftmost character
Not enclosed in quotes
Literals
Numeric Literals
Examples
123
123.45
-256
+2987
Literals
In Mathematics In COBOL
12345000 1.2345*107 1.2345E07 or
+12.345E+06
Literals
Non-Numeric Literals
Enclosed in quotes (“)
May consists of alphanumeric characters
1 – 160 characters
An embedded quotation mark must be
represented by a pair of quotation marks (“
“)
Literals
Non-Numeric Literals
The opening delimiter (“) cannot split
across lines.
Examples
Examples
Examples
Examples
NOTES:
The singular and plural forms of a figurative
constant can be used interchangeably.
Do not use QUOTE/QUOTES to enclose a
Non-numeric literal.
ZERO, ZEROS, ZEROES are considered as
Numeric Literals.
Special Registers
Examples
Examples
Arithmetic Operators
Relational Operators
Logical Operators
Arithmetic Operators
Binary Operators
Addition +
Subtraction -
Multiplication *
Division /
Exponentiation **
Operators
Arithmetic Operators
Unary Operators
Positive + (Equals to Multiplication by +1)
Negative - (Equals to Multiplication by +1)
Operators
Relational Operators
Less Than <
Greater Than >
Equal To =
Less Than or Equal To <=
Greater Than or Equal To >=
Logical Operators
Conjunction AND
Inclusive OR
Negation NOT
Separator String
Examples
Separator comma ,b
Separator period .b
Separator Semicolon ;b
AT END
Examples
UNTIL A > B
Clause
OCCURS 5 TIMES
LABEL RECORDS ARE STANDARDS
Examples
Statement & Clause
Subgroup of Sections
Paragraphs
2 types:
Predefined
IDENTIFICATION DIVISION & ENVIRONMENT DIVISION have only predefines
paragraphs
User defined
PROCEDURE DIVISION allows to define user defined paragraphs
Paragraphs
Subgroup of Divisions
Sections
2 types:
Predefined
ENVIRONMENT DIVISION & DATA DIVISION have only predefines sections
User defined
PROCEDURE DIVISION allows to define user defined sections
Sections
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B
Note :
Anything that begins anywhere in Area A
or B is considered to be in Area A or B
respectively.
Level Numbers other than 01 & 77 can
begin in Area A or Area B.
COBOL Coding Sheet
1–6 7 8 – 11 12 – 72
Sequence No. Indicator No. Area A Area B