Search This Blog

COBOL-Tutorial


The word COBOL is an acronym that stands for COmmon Business Oriented Language. As the
the expanded acronym indicates, COBOL is designed for developing business, typically fileoriented,
applications. It is not designed for writing systems programs. For instance you would
not develop an operating system or a compiler using COBOL.



Coding Sheet.
1-6 Page/line numbers - Optional (automatically assigned by compiler)
7 Continuity (-), Comment (*), Starting a new page (/), Debugging lines (D)
8-11 Column A -Division, Section, Paragraph, 01,77 declarations must begin here.
12-72 Column B -All the other declarations/statements begin here.
73-80 Identification field. It will be ignored by the compiler but visible in the source listing.
Language Structure.
Character Set :- Digits (0-9), Alphabets (A-Z), Space (b), Special Characters (+ - * / ( ) = $ ; " > <
. ,)
Word :- One or more characters- User defined or Reserved.
Clause :- One or more words. It specifies an attribute for an entry.
Statement :- One or more valid words and clauses.
Sentence :- One or more statements terminated by a period.
Paragraph :- One or more sentences.
Section :- One or more paragraphs.
Division :- One or more sections or paragraphs.
Program :- Made up of four divisions.
Divisions in COBOL.
There are four divisions in a COBOL program and Data division is optional.
1. Identification Division.
2. Environment Division.
3. Data Division.
4. Procedure Division.
Identification Division.
This is the first division and the program is identified here. Paragraph PROGRAM-ID followed
by user-defined name is mandatory. All other paragraphs are optional and used for
documentation. The length of user-defined name for IBM COBOL is EIGHT.
IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM NAME.
AUTHOR. COMMENT ENTRY.
INSTALLATION. COMMENT ENTRY.
DATE-WRITTEN. COMMENT ENTRY.
DATE-COMPILED. COMMENT ENTRY.
SECURITY. COMMENT ENTRY.
Security does not pertain to the operating system security, but the information that is passed to the
user of the program about the security features of the program.


No comments:

Post a Comment