Difference between revisions of "COBOL"

From Computer History Wiki
Jump to: navigation, search
(Add 'Hello World!' examples)
m (Show what the acronym means)
Line 1: Line 1:
 +
'''C'''ommon '''B'''usiness '''O'''riented '''L'''anguage
 +
 
COBOL is primarily found on the mainframe environments, and related to business 'batch' processing.
 
COBOL is primarily found on the mainframe environments, and related to business 'batch' processing.
  

Revision as of 11:55, 18 March 2013

Common Business Oriented Language

COBOL is primarily found on the mainframe environments, and related to business 'batch' processing.

Example

Here's Hello World in COBOL.

      IDENTIFICATION DIVISION.
      PROGRAM-ID.    HELLOWORLD.
      ENVIRONMENT DIVISION.
      DATA DIVISION.
      PROCEDURE DIVISION.
          DISPLAY 'HELLO WORLD! ' .
          GOBACK.

Another variant, specifically for the RM/1 COBOL compiler:

      IDENTIFICATION DIVISION.
      PROGRAM-ID.     HELLOWORLD.

      ENVIRONMENT DIVISION.
      CONFIGURATION SECTION.
      SOURCE-COMPUTER. RM-COBOL.
      OBJECT-COMPUTER. RM-COBOL.

      DATA DIVISION.
      FILE SECTION.

      PROCEDURE DIVISION.
      
      MAIN-LOGIC SECTION.
      BEGIN.
          DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
          DISPLAY "Hello world!" LINE 15 POSITION 10.
          STOP RUN.
      MAIN-LOGIC-EXIT.
      EXIT.

References