Presentation is loading. Please wait.

Presentation is loading. Please wait.

COBOL LANGUAGE COmmon Business Oriented Language Sarunya Dechasajja 47541487.

Similar presentations

Presentation on theme: "COBOL LANGUAGE COmmon Business Oriented Language Sarunya Dechasajja 47541487."— Presentation transcript:

1 COBOL LANGUAGE COmmon Business Oriented Language Sarunya Dechasajja 47541487

2 BACKGROUND -Developed in 1959 by a group of computer professionals called the Conference on Data Systems Languages (CODASYL) -In 1968 the American National Standards Institute (ANSI) developed a standard form of the language. This version was known as American National Standard (ANS) COBOL. -Object-oriented COBOL is a subset of COBOL 97, which is the fourth edition in the continuing evolution of ANSI/ISO standard COBOL. -Like the C++ programming language, object- oriented COBOL compilers are available even as the language moves toward standardization.

3 DESCRIPTION OF COBOL LANGUAGE -COBOL is a Third-generation programming language, and one of the oldest programming languages still in active use. -Defining its primary domain in business, finance, and administrative system for companies and governments. -Example of COBOL standard: COBOL-68, COBOL- 74, COBOL-85 and COBOL 2002



6 DISTINCTIVE CHARACTERISTIC -The language that automated business -Allows names to be truly connotative - permits both long names (up to 30 characters) and word-connector characters (dashes) -Every variable is defined in detail - this includes number of decimal digits and the location of the implied decimal point -File records are also described with great detail, as are lines to be output to a printer - ideal for printing accounting reports -Offers object, visual programming environments -Class Libraries -Rapid Application Capabilities -Integration with the World Wide Web

7 DISTINCTIVE CHARACTERISTIC COBOL, long associated with green screens, core dumps, and traditional mainframe connections, may at first glance seem at odds with object technology, push-button graphical interfaces, and interactive development environments. This perceived incongruity, however, is more a reflection of the mainframe’s ability to keep pace with the innovations of desktop and client- server computing than a flaw in the COBOL language.

8 DESIGN GOALS -One goal of COBOL's design was for it to be readable by managers, so the syntax had very much of an English-like flavor. -The specifications were to a great extent inspired by the FLOW-MATIC language invented by Grace Hopper -She then promoted COBOL’s use

9 CHARACTERISTICS COBOL is a simple language with a limited scope of function(no pointers, no user defined functions, no user defined types ). And that is the way it used to be but the introduction of OO-COBOL has changed all that. OO-COBOL retains all the advantages of previous versions but now includes - User Defined Functions - Object Orientation - National Characters - Unicode - Multiple Currency Symbols - Cultural Adaptability (Locales) - Dynamic Memory Allocation (pointers) - Data Validation Using New VALIDATE Verb - Binary and Floating Point Data Types - User Defined Data Types

10 SAMPLE PROGRAM: Displaying the message "Hello world!". 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 000400* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "Hello world!" LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT. Sample Run Hello world!

11 SAMPLE PROGRAM: Accepts two numbers and adds them together 000100 ID DIVISION. 000200 PROGRAM-ID. ACCEPT1. 000300 DATA DIVISION. 000400 WORKING-STORAGE SECTION. 000500 01 WS-FIRST-NUMBER PIC 9(3). 000600 01 WS-SECOND-NUMBER PIC 9(3). 000700 01 WS-TOTAL PIC ZZZ9. 000800* 000900 PROCEDURE DIVISION. 001000 0000-MAINLINE. 001100 DISPLAY 'ENTER A NUMBER: '. 001200 ACCEPT WS-FIRST-NUMBER. 001300* 001400 DISPLAY 'ANOTHER NUMBER: '. 001500 ACCEPT WS-SECOND-NUMBER. 001600* 001700 COMPUTE WS-TOTAL = WS-FIRST-NUMBER + WS-SECOND-NUMBER. 001800 DISPLAY 'THE TOTAL IS: ', WS-TOTAL. 001900 STOP RUN. Sample Run ENTER A NUMBER: a ANOTHER NUMBER: b THE TOTAL IS: a + b

12 SAMPLE PROGRAM: Takes all input records of salesperson data and writes it to an output file reformatted 000100 ID DIVISION. 000200 PROGRAM-ID. SLS02. 000300 FILE-CONTROL. 000400 SELECT SALESPERSON-FILE 000500 ASSIGN TO DISK. 000600 SELECT REPORT-FILE 000700 ASSIGN TO PRINTER. 000800 DATA DIVISION. 000900 FILE SECTION. 001000 FD SALESPERSON-FILE. 001100 01 SALESPERSON-RECORD. 001200 05 FILLER PIC XX. 001300 05 SP-NUMBER PIC X(4). 001400 05 SP-NAME PIC X(18). 001500 05 FILLER PIC X(21). 001600 05 SP-CURRENT-SALES PIC 9(5)V99. 001700 05 SP-CURRENT-RETURNS PIC 9(4)V99. 001800 FD REPORT-FILE.

13 SAMPLE PROGRAM: Takes all input records of salesperson data and writes it to an output file reformatted 001900 01 REPORT-RECORD. 002000 05 FILLER PIC X(10). 002100 05 RT-NUMBER PIC X(4). 002200 05 FILLER PIC X(6). 002300 05 RT-NAME PIC X(18). 002400 05 FILLER PIC X(6). 002500 05 RT-CURRENT-SALES PIC ZZ,ZZZ.99. 002600 05 FILLER PIC X(6). 002700 05 RT-CURRENT-RETURNS PIC Z,ZZZ.99. 002800 05 FILLER PIC X(65). 002900 WORKING-STORAGE SECTION. 003000 01 WS-EOF-FLAG PIC X. 003100* 003200 PROCEDURE DIVISION. 003300* 003400 MAIN-ROUTINE. 003500 OPEN INPUT SALESPERSON-FILE 003600 OUTPUT REPORT-FILE 003700 MOVE "N" TO WS-EOF-FLAG 003800 READ SALESPERSON-FILE 003900 AT END MOVE "Y" TO WS-EOF-FLAG 004000 END-READ

14 SAMPLE PROGRAM: Takes all input records of salesperson data and writes it to an output file reformatted 004100* 004200 PERFORM UNTIL WS-EOF-FLAG IS EQUAL TO "Y" 004300 MOVE SPACES TO REPORT-RECORD 004400 MOVE SP-NUMBER TO RT-NUMBER 004500 MOVE SP-NAME TO RT-NAME 004600 MOVE SP-CURRENT-SALES TO RT-CURRENT-SALES 004700 MOVE SP-CURRENT-RETURNS TO RT-CURRENT-RETURNS 004800 WRITE REPORT-RECORD 004900 READ SALESPERSON-FILE 005000 AT END MOVE "Y" TO WS-EOF-FLAG 005100 END-READ 005200 END-PERFORM 005300* 005400 CLOSE SALESPERSON-FILE, REPORT-FILE 005500 STOP RUN. Sample Run 0005 BENNETT ROBERT 1,600.35 12.50 0016 LOCK ANDREW S 357.72 79.85 0080 PARKER JAMES E 18,200.00 165.00 0401 REDDING OLIVIA 16,123.99 2,301.75 1375 BENTON ALEX J 3,250.00 56.50 1442 ADAMS JUNE R 4,635.21 125.16 1842 COLE ROBERT N 14,285.14 6,385.29

15 CONTRIBUTION TO COMPUTER LANGUAGE COBOL programs are in use globally in governmental and military agencies, in commercial enterprises, and on operating systems such as IBM's z/OS, Microsoft's Windows, and the POSIX families

16 HOW WIDELY USED IS COBOL?? -In 1997 they estimated that there were about 300 billion lines of computer code in use in the world. Of that they estimated that about 80% (240 billion lines) were in COBOL and 20% (60 billion lines) were written in all the other computer languages combined [Brown].Brown -In 1999 they reported that over 50% of all new mission- critical applications were still being done in COBOL and their recent estimates indicate that through 2004-2005 15% of all new applications (5 billion lines) will be developed in COBOL while 80% of all deployed applications will include extensions to existing legacy (usually COBOL) programs. -Gartner estimates for 2002 are that there are about two million COBOL programmers world-wide compared to about about one million Java programmers and one million C++ programmers.

17 RESOURCES - /cis400/cobol/cobol.html /cis400/cobol/cobol.html - command=viewArticleBasic&articleId=266156&pa geNumber=1 command=viewArticleBasic&articleId=266156&pa geNumber=1 - m#part1 m#part1 Presented by: Sarunya Dechasajja 47541487

Download ppt "COBOL LANGUAGE COmmon Business Oriented Language Sarunya Dechasajja 47541487."

Similar presentations

Ads by Google