COBOL

COBOL is one of the oldest programming languages and has been pronounced dead many times.
The abbreviation stands for COmmon Business Oriented Language and was primarily developed for finance, business and administration.
Still running in many banks, processing financial transactions in the background every day all over the world, I decided to teach myself some COBOL.
Yes, I know: It is not sexy, but it will pay and it is actually fun learning something pretty different from modern programming languages.
Since I am waiting for my new PC to be delivered and I am sometimes inpatient, I wanted to try some COBOL programming on my MacBook.
Knowing that COBOL is a very old language, I was prepared for some effort to get things going.
Surprisingly it was quite easy. Looking for something to train basics, I found GNU-COBOL.
GNU-COBOL is an open source implementation of a COBOL compiler available for MacOS.
- Hits: 12207
Every program needs to "make" decisions at some point.
To achieve this COBOL provides conditional clauses like IF.
Syntax
IF condition (THEN)
PERFORM DO SOMETHING.
ELSE
PERFORM DO SOMETHING ELSE
END IF.
- Hits: 2796
Programs use variables to store and process data at runtime.
This article gives a brief introduction to COBOL literals, constants and variables including some examples.
Variables are also referred to as Elementary Types.
Literals
Literals occur in the PROCEDURE DIVISION without being declared.
Strings like the text in the following code snippet are considered literals
- Hits: 10208
Page 1 of 2