rodrigosantosbr

[Ubuntu >=12.04] How to install Cobol Compiler

Dec 30th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Installing cobol compiler

sudo apt-get install -y open-cobol

Make sure Cobol Compiler is installed on your system

whereis cobc

output:

cobc: /usr/bin/cobc /usr/share/man/man1/cobc.1.gz
which cobc

output:

/usr/bin/cobc

Write a Hello World Cobol Program

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

Compile the cobol program

cobc -free -x hello -o hello-exe

Execute the cobol program

hello-exe
Add Comment
Please, Sign In to add comment