Wildcat Cobol Compiler for .NET

home | about | docs | feedback | download

An open-source COBOL compiler for .NET and Mono

Getting Started

Obtaining the compiler

Before starting to compile your COBOL programs with the Wildcat COBOL compiler, you should download and unzip it. The ZIP archive contains cobolc.exe, the required assemblies and the sample "Hello world" program which is listed below.

Installation

Before trying to compile anything, you will need to ensure that cobolc.exe and ilasm.exe (part of your .NET framework tools) are both in your PATH.

Unfortunately, there is no Windows installer for the compiler yet. Ilasm.exe is probably already in your path but you will have to explicitly add the location of cobolc.exe and its assemblies. The best way to do this is to place the files in a folder on your C: drive, right-click on My Computer and choose properties, where you can set the PATH environment variable to include the folder where cobolc.exe is.

On Mac OS X, Linux and other Unix-like systems, after unzipping the binary ZIP file, "cd" to that directory and type this to install the compiler:

sudo make install

Compiling the Sample Program

To compile the sample hello world program, open a command prompt and type:

cobolc hello.cbl

Or, if you're using Mono, type:

mono /path/to/cobolc.exe hello.cbl

The Wildcat COBOL compiler will compile the specified COBOL program, and assemble it with ilasm.exe - the Intermediate Language assembler which is part of your .NET Framework. A temporary file (hello.il) will be created in the same directory as the executable which is produced.

The Sample "Hello World" Program

000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. HELLO-WORLD.
000030 AUTHOR. SANDY DUNLOP.
000040*The standard Hello world program
000050
000060 ENVIRONMENT DIVISION.
000070
000080 DATA DIVISION.
000090 WORKING-STORAGE SECTION.
000100 01 MESSAGE PIC X(12) VALUE 'Hello world!'.
000110
000120 PROCEDURE DIVISION.
000130 MAIN-PARAGRAPH.
000140 DISPLAY MESSAGE
000150 STOP RUN.

[download the source]