Install COBOL and check the version
Install GnuCOBOL
GnuCOBOL is the open source COBOL compiler used throughout this course. On Debian and Ubuntu it lives in the system repositories, so two commands are enough:
sudo apt update
sudo apt install gnucobol
cobc --version
Check the compiler after the install. The first line shows GnuCOBOL itself:
cobc --version
cobc (GnuCOBOL) 3.2.0
Other compilers
GnuCOBOL is enough for every example in this course. Commercial compilers (IBM Enterprise COBOL, Micro Focus) add mainframe-only features like CICS and Db2 precompilers.
If your distro ships an older GnuCOBOL, that is fine: every lesson works with GnuCOBOL 3.0 and newer.
The cobc --version output on this page was produced by GnuCOBOL 3.2.0 on Alpine Linux 3.24.3 (x86_64) in a Docker container. The apt install commands were not run: they need Ubuntu and root.
Article author: Arthur Isaev