Problem:
I have just installed COBOL for UNIX (i.e. Server Express) for the first time, or I've made changes to the installation or to the licensing. What is a quick way to test whether Server Express can compile and run successfully?
Resolution:
Set the COBDIR environment variable to the Server Express location to be tested. For example:
COBDIR=/opt/microfocus/cobol
export COBDIR
Your machine might have more than one installation of Server Express (an old and a new version) in different locations. Decide which one you want to test, and set COBDIR to that location.
After COBDIR is set and exported, enter the following commands:
LD_LIBRARY_PATH=$COBDIR/lib
export LD_LIBRARY_PATH
[On AIX, specify LIBPATH instead of LD_LIBRARY_PATH, and on HP/UX, specify SHLIB_PATH instead]
PATH=$COBDIR/bin:$PATH
export PATH
COBPATH=.
export COBPATH
Next, copy and paste the following six commands onto the command line:
mkdir /tmp/cob_test
cd $COBDIR/demo/debug
cp pi.cbl /tmp/cob_test
cd /tmp/cob_test
cob pi.cbl
cobrun pi
A calculation of the mathematical constant "pi" should appear. If it does, you have proven that Server Express can successfully compile and run from that COBDIR location. This means both your development licensing and runtime licensing is set up correctly.
If not, the error messages are diagnostic. Take careful note of them, look them up in the Server Express documentation, or contact Customer Care.
#license