Compile a COBOL program in the LInux's Shell.

Show how is compiler a program create in Cobol in the Linux's Shell and install some libraries that need to compile and run programs in cobol.


1.- Write a program in language COBOL.

 For example

2.- Checked that component of COBOL is installed in ours Linux.

$ whereis cobc
cobc: /usr/bin/cobc   /usr/share/man/man1/cobc.1.gz

$which cobc
/usr/bin/cobc

If you don't have installed the compiler of COBOL.

3.- Install the compiler COBOL (cobc)

$ sudo apt-get install apen-cobol

3.- Compile the program of COBOL in the Linux's Shell.

$ cobc -free -x -o program-exe program

The program-exe is the name of the  executable program.

"Program" is the name of the file that have the code in COBOL.

-free-- use the format source free.

-x -- is for created the executable.

-o -- create in a file specific

Execute the program in Linux's shell.

$ ./program-exe