Difference between revisions of "COBOL"
From Computer History Wiki
(New page: COBOL is primarily found on the mainframe environments, and related to business 'batch' processing. {{stub}} Category:Languages) |
(Add 'Hello World!' examples) |
||
Line 1: | Line 1: | ||
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. | ||
+ | ===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=== | ||
+ | * http://code.xmlgadgets.com/2012/03/28/cobol-hello-world-program/ | ||
+ | * http://groups.engin.umd.umich.edu/CIS/course.des/cis400/cobol/hworld.html | ||
{{stub}} | {{stub}} | ||
[[Category:Languages]] | [[Category:Languages]] |
Revision as of 10:51, 18 March 2013
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.