>>SOURCE FORMAT IS FREE *> cobol-hello-world.cob - a first program: four divisions, *> DISPLAY, and STOP RUN *> Dialect: GnuCOBOL 3.x, free format *> Status : desk-checked against the GnuCOBOL 3.2 Programmer's Guide; *> compiled and run with GnuCOBOL 3.2 on 2026-10-29 *> Inputs : none *> Outputs: six lines on standard output *> Build : cobc -x cobol-hello-world.cob *> Run : ./cobol-hello-world *> (Windows: cobol-hello-world.exe) IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-FOUR. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. DESKTOP-PC. OBJECT-COMPUTER. DESKTOP-PC. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-Greeting PIC X(20) VALUE "Hello from COBOL". 01 WS-Unsigned-Count PIC 9(3) VALUE 7. 01 WS-Signed-Count PIC S9(3) VALUE -7. 01 WS-Sum PIC S9(4) VALUE ZERO. PROCEDURE DIVISION. MAIN-PARAGRAPH. DISPLAY WS-Greeting DISPLAY "Unsigned count : " WS-Unsigned-Count DISPLAY "Signed count : " WS-Signed-Count ADD WS-Unsigned-Count TO WS-Sum ADD WS-Signed-Count TO WS-Sum DISPLAY "Sum : " WITH NO ADVANCING DISPLAY WS-Sum DISPLAY "A literal : " 42 DISPLAY "Two literals : " "COBOL" " " 1959 STOP RUN.