Top / UserManual / 1
Getting Started †
Hello World! †
This is a sample program that displays "Hello World":
The I of IDENTIFICATION must be at the column 8 ( 7 spaces before ).
---- hello.cob -------------------------
* Sample COBOL program
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
----------------------------------------
The compiler is cobc, which is executed as follows:
$ cobc -x hello.cob $ ./hello Hello World!
The executable file name (i.e., hello in this case) is determined by removing the extension from the source file name.
You can specify the executable file name by specifying the compiler option -o as follows:
$ cobc -o hello-world hello.cob $ ./hello-world Hello World!
Counter: 60338,
today: 27,
yesterday: 36
Last-modified: Fri, 19 Sep 2008 08:19:46 GMT (1734d)
Last-modified: Fri, 19 Sep 2008 08:19:46 GMT (1734d)




