15
COBOL COBOL

COBOL Powerpoint Presentation.ppt

Embed Size (px)

DESCRIPTION

history of COBOL

Citation preview

Page 1: COBOL Powerpoint Presentation.ppt

COBOLCOBOL

Page 2: COBOL Powerpoint Presentation.ppt

HISTORYHISTORY

COBOL - Common Business Oriented Language

The Mother of COBOL, Grace Hopper, is said to have invented the term "computer bug" and "de-bug“.

A third-generation programming language and as one of the earliest high-level programming languages; still wide used today.

Business Computing Domain.

First proposed in 1959 by the Conference on Data Systems Languages (CODASYL).

Page 3: COBOL Powerpoint Presentation.ppt

It has emerged as the leading data processing language in the business world

COBOL is non-proprietary.

More than 80 percent of all daily business transactions are processed in COBOL.

COBOL is changing with the times. COBOL is being re-energized as an important component of moving businesses to the Web seamlessly and efficiently.

History (continued)History (continued)

Page 4: COBOL Powerpoint Presentation.ppt

ApplicationsApplications

Like the name suggests, COBOL was meant to be ‘common’ or compatible among a significant group of manufacturers

COBOL is designed for developing business, typically file-oriented, applications, and is not designed for writing systems programs.

Primary domain in business, finance, and administrative systems for companies and governments.

Page 5: COBOL Powerpoint Presentation.ppt

Pro’s and Con’sPro’s and Con’s

- Disadvantages - - Very wordy - - Has a very rigid format- - Not designed to handle

scientific applications

- Advantages- Simple- Portable- Maintainable- Self documenting

Page 6: COBOL Powerpoint Presentation.ppt

Structure of COBOLStructure of COBOL

COBOL programs are hierarchical in structure. Each element of the hierarchy consists of one or more

subordinate elements.

The levels of hierarchy are Divisions, Sections, Paragraphs, Sentences and Statements

There are 4 main divisions and each division provides an essential part of the information required by the complier

Page 7: COBOL Powerpoint Presentation.ppt

Structure of COBOL (continued)Structure of COBOL (continued)

At the top of the COBOL hierarchy are the four divisions. The sequence in which they are specified is fixed, and must follow

the order:

IDENTIFICATION DIVISION supplies information about the program to the programmer and the compiler.

ENVIRONMENT DIVISION is used to describe the environment in which the program will run.

DATA DIVISION provides descriptions of the data-items processed by the program.

PROCEDURE DIVISION contains the code used to manipulate the data described in the DATA DIVISION. It is here that the programmer describes his algorithm.

Some COBOL compilers require that all the divisions be present in a program while others only require the IDENTIFICATION DIVISION and the PROCEDURE DIVISION

Page 8: COBOL Powerpoint Presentation.ppt

Distinct featuresDistinct features

The language that automated business Allows names to be truly connotative Every variable is defined in detail Offers object, visual programming

environments Class libraries Rapid application capabilities Integration with the world wide web

Page 9: COBOL Powerpoint Presentation.ppt

Data Types in COBOLData Types in COBOL

COBOL is not a strongly typed language

In COBOL, there are only three data types Numeric, aphanumeric (text/string), alphabetic

Data types are declared using: A level number A data-name or identifier A Picture clause.

Page 10: COBOL Powerpoint Presentation.ppt

Basic CommandsBasic Commands

ADD a TO b GIVING c. SUBTRACT a FROM b GIVING c. MULTIPLY a BY b GIVING c. DIVIDE a INTO b GIVING c. COMPUTE x = a + b * c. MOVE a TO b c SORT sort-file ON ASCENDING KEY k USING inventory-file GIVING sorted-inventory-file .

Page 11: COBOL Powerpoint Presentation.ppt

Basic Commands (Contd.)Basic Commands (Contd.)

MERGE merge-work-file ON ASCENDING KEY K USING input-file1 input-file2 GIVING output-file .

DISPLAY total-cost. Accept identifier.

PERFORM paragraphname1 THROUGH paragraphname2 VARYING index FROM value1 BY value2 UNTIL condition.

Page 12: COBOL Powerpoint Presentation.ppt

000100 IDENTIFICATION DIVISION.000200 PROGRAM-ID. HELLOWORLD.000300000400 ENVIRONMENT DIVISION.000500 CONFIGURATION SECTION.000600 SOURCE-COMPUTER. RM-COBOL.000700 OBJECT-COMPUTER. RM-COBOL.000800000900 DATA DIVISION.001000 FILE SECTION.001100101200 PROCEDURE DIVISION.101300101400 MAIN-LOGIC SECTION.101500 DISPLAY "Hello world!"101600 STOP RUN.

Sample Program Sample Program (HELLO WORLD)(HELLO WORLD)

Page 13: COBOL Powerpoint Presentation.ppt

Writing, Compiling and Writing, Compiling and ExecutingExecuting1. Creating .cbl programs

Notepad/Text Editors and save as .cbl

2. Compiling and Running Open Cobol Directory Compile

Type in prompt: rmcobol <filename.extn> filename.extn is the source code

Execute If no errors:

Type in prompt: runcobol <filename> Filename is the object code

Page 14: COBOL Powerpoint Presentation.ppt

COBOL VERSIONSCOBOL VERSIONS

ANS COBOL 1968COBOL 1974COBOL 1985COBOL 2002 and object-oriented

COBOLVersion 4.1 (September 2010)

Page 15: COBOL Powerpoint Presentation.ppt

THE END...THE END...

Prepared by:

Crystal Genna F. Antinero Venus R. Tongohan

Mark A. Soliva Irene T. Pransal

4 - CpE