IT-info

Cobol

Resources and info

Hello World example code (GnuCOBOL)

Columns: 1234567...
>>SOURCE FORMAT FREE
IDENTIFICATION DIVISION.
    PROGRAM-ID. HELLOWORLD.
    DATA DIVISION.
    FILE SECTION.
    WORKING-STORAGE SECTION.
    PROCEDURE DIVISION.
    MAIN-PROCEDURE.
        DISPLAY "Hello world".
    STOP RUN.
END PROGRAM HELLOWORLD.

Save source code as helloworld.cob and compile it in GnuCOBOL using the command cobc -x helloworld.cob

There is a informative Stack Overflow Blog post about COBOL: Brush up your COBOL: Why is a 60 year old language suddenly in demand?
Among it's content there's a section about columns in COBOL source code that is quite useful.