Overview

Let me be blunt.

This is not the "best" way and it might not be a "good" way.

It may even be a "bad" way and I'm sure that some people will look at this and say: "Why did you do it "that" way?"

But, it does run and it does work.

If you have the desire to be able to write COBOL program with embedded SQL statements that access an IBM DB2 LUW RDBMS in a Linux environment...

This is "a" way.

Why this way you ask?

I run an Archlinux(ArcoLinux to be precise) system.

I can create, compile and run GnuCOBOL programs on that system that run just fine.

I haven't installed DB2 on that system, nor do I want to.

I have downloaded the Docker DB2 image and can run it but there are problems which I haven't solved yet which prevent me from using that.

Lazy of me? Maybe

My goal was to learn how to create, compile and run COBOL/DB2 program in a Linux environment.

I had a choice of which path to I want to go down first: Fix the problems with Docker or create an Ubuntu VM.

I chose the "Create a VM" path.

IBM DB2 LUW Installation Environment

According to the documentation, the only supported Linux environments are RedHat and Ubuntu.

Personally, I like the UI for Pop!_OS (by System 76) better and it is based on Ubuntu so I am using that.

All the commands work on Ubuntu as well so if you want to use that instead, go for it.

You will need to do five things:

  1. Create a VM

  2. Install IBM DB2 LUW

  3. Create the Sample DB

Then go to the Dev Tools guide:

  1. Install GnuCOBOL

  2. Install a Basic Develoment Environment

Can I do this in Windows WSL?

You may be asking, "Windows has the WSL that can install an Ubuntu distribution, can I do this within that?"

I have no idea.

I have never used WSL so I don't know what it can or cannot do.

I do have a Windows 10 system and I have installed IBM DB2 LUW on that, but I use MingGW for DB2 programs and Cygwin for batch programs.

Do a search on the GnuCOBOL discussion board for instructions on how to set that up if you want to go that route.