How to Install COBOL on MacOS?
Last Updated : 23 Feb, 2022
COBOL is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily used in business, finance, and administrative systems for companies and governments.
In this article, we will look at the process of installing COBOL in MacOS.
Installation Procedure:
Follow the below steps to install COBOL in MacOS:
Step 1: Install Homebrew if it is not installed in your system. Enter system password if required.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Step 2: Install the GNU-COBOL using the below brew command:
brew install gnu-cobol
Step 3: Check if it is installed correctly using the below command:
cobc -v

Hello, world in COBOL:
Use the below in a new .cbl file and save it inside a folder to run the hello world program.
Cobol IDENTIFICATION DIVISION. PROGRAM-ID. HELLOWORLD. PROCEDURE DIVISION. DISPLAY "HELLO WORLD". STOP RUN.
Now open a terminal inside the folder and enter the following commands to build and run the code:
cobc -x -o hello_world hello_world.cbl ./hello_world
Output:

Installing COBOL-IDE:
Prerequisites
Now Enter OpenCobolIDE in Terminal to launch the IDE:
The IDE should open up as shown below, Click on New File.
Here Enter a name and select OK.
A "Hello World" program should appear by default, Click on RUN to view "Hello World" as Output.
Similar Reads
How to Install Golang on MacOS? Before, we start with the process of Installing Golang on our System. We must have first-hand knowledge of What the Go Language is and what it actually does? Go is an open-source and statically typed programming language developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but
4 min read
How to Install Caffe on MacOS? In this guide, we will walk you through the process of installing Caffe on macOS, ensuring you have everything you need to start building and training neural networks. What is Caffe? Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by Berkeley A
2 min read
How to Install Anaconda on MacOS? In this article, we will learn how to install Anaconda on MacOS. Anaconda is a distribution of the Python and R programming languages for scientific computing, that aims to simplify package management and deployment. Installation using Graphical Interface Step 1: Download the Graphical installer fro
1 min read
How to Install Turbo C++ on MacOS? Turbo C++ is a single-language compiler and integrated development environment. It is free of charge and can be downloaded from any website. The first release of Turbo C++ was released in May 1990 version 1.0, running on MS-DOS computers. For the C++ programming language, Turbo C++ is an integrated
4 min read
How to Install Weka on MacOS? Weka is computer software and its full form is Waikato Environment for Knowledge Analysis, it was built to fulfil the purpose of data mining and it is used in the field of data science. It is open-source software that is built using Java programming language. It is free and can be run on different p
2 min read