Skip to the posts
Buffalo's neighborhood journals since 2003 🍀 Patrick Spicy Devil Logan🌭 Sahlen🥨 Weber Spank🥟 Pierogi🐸 Scaj🍺 Labatt Utica Pink Cherio❄️ Snow Murder

uncutsaniflush’s journal

Hello World, Hello COBOL (updated with code))


Well, I got open-cobol to compile and run a simple "Hello Word" program. So it works.

It seems that Cobol is still in the punch card age in which commands have to start in the 8th column. But open-cobol has a freestyle option.

@paul wanted to see some code:

Here's the sort of COBOL"hello world" I remember from my college days:

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "Hello world!" LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.

Here's the same thing freestyled in open-cobol.

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Hello world!'.
STOP RUN.

Share 117 words · edited Jan 14, 2012

💬 1 comment

  1. paul ·

    Retro. What does it look like. You can upload a text file or PDF attachment on estrip thanks to a request from @tinypliny.

💬 Write a comment