Overview
GNU COBOL(formerly OpenCOBOL) is a free COBOL compiler that translates COBOL code into an executable using intermediate C sources.
Details regarding the GNU Cobol compiler can be found here: https://sourceforge.net/projects/open-c ... cobol/2.0/
A user manual can be found here: http://www.opencobol.org/modules/bwiki/ ... UserManual
The FAQ is found here: http://opencobol.add1tocobol.com/gnucobol/
Setup Steps
The steps below describe how to install and setup the GNU Cobol toolset so that they can be used from inside the Zeus IDE.
These steps should also be read in conjunction with the details found here: viewtopic.php?t=7603
(1) Download the GNU Cobol 2.0 binary files found here: http://www.kiska.net/opencobol/2.0/index.html
Note: The older OpenCobol 1.1 binary files found can be found here: http://www.kiska.net/opencobol/1.1/index.html
Unzip the file to the C:\ folder and after unzipping you should see this file:
Code: Select all
C:\OpenCobol\cobc.exe
Note: You will also need some version of the Microsoft C compiler installed on the machine. The free Microsoft C/C++ Express version will do, so if you want to use that version, use Google to get the latest download link for that compiler.
Important: Make sure you choose matching 32/64 bit versions of both tools otherwise it will not work

(2) Before the compiler can be run the install folder needs to be added to the PATH environment variable.
To do this add the the following folder to the PATH using the details found here.
Code: Select all
C:\OpenCobol\
Code: Select all
cobc.exe -V
Code: Select all
cobc (OpenCOBOL) 2.0.20120211
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Keisuke Nishida
Copyright (C) 2006-2012 Roger While
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Built Dec 22 2013 11:01:58
Packaged Feb 11 2012 12:36:31 UTC
C version (Microsoft) 1600
Code: Select all
'cobc.exe' is not recognized as an internal or external command,
operable program or batch file.
For the Cobol compiler to work in needs a working Microsoft C/C++ compiler.
To check if the Microsoft C/C++ compiler is working correctly, refer to the simple test found here: viewtopic.php?f=5&t=2707&p=4936
(4) Inside Zeus, create a simple c:\temp\test.cob COBOL test file as shown below:
Code: Select all
* Hello World Program
IDENTIFICATION DIVISION.
PROGRAM-ID. "cobmain".
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MYVAR PIC X(20).
PROCEDURE DIVISION.
DisplayPrompt.
MOVE "HELLO" to MYVAR
DISPLAY "Hello, world.".
STOP RUN.
Code: Select all
Using document type compiler options....
cob56.c
Code: Select all
Using document type compiler options....
cob34.c
LINK : warning LNK4044: unrecognized option "manifest"; ignored
test.exe.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
If the compile worked it should have also have created the c:\temp\test.exe file. To check this use the Tools, DOS Command Line menu and in the resulting dialog enter this command:
Code: Select all
dir c:\temp\test.exe
Code: Select all
c:\temp\test.exe
Code: Select all
Hello, world.
One of the easier options is to run the executable as a tool using the Tools menu or running the executable using a macro script.
For example, to run the executable via a macro edit the Macros section of the COBOL Document Type and add the following macro:
Code: Select all
Menu Text: Execute '$fb.exe'
Macro Name: $zud\zscript\cs_exec.py
Arguments: $fdd$fb.exe
[x] Add to popup menu
For more options on how to run the executable just search the Zeus forum for details.
Cheers Jussi