Skip to main content

Problem:

When publishing Cobsql applications to UNIX, even if the Oracle environment is set up within the users' .login/.profile etc., this may not get picked up correctly by the remote command.

This will lead to Cobsql attempting to invoke procob18, rather than procob, which will either fail (if Pro*COBOL 1.8.xxx was not installed), or invoke the wrong precompiler.

Resolution:

In order to resolve this, follow the instructions documented in the UNIX Option User's Guide appendix on publishing Cobsql applications. Copy the created Makefile to CSQLMakefile,  then to add to the entries which create mfenv.sh :

mfenv.sh:

        @echo "#!/bin/sh" > mfenv.sh

        @echo "ORACLE_HOME=MY_ORACLE_HOME" >> mfenv.sh

        @echo "export ORACLE_HOME" >> mfenv.sh

        @echo "PATH=\\$$ORACLE_HOME/bin:\\$$PATH" >> mfenv.sh

        @echo "export PATH" >> mfenv.sh

        @echo "LD_LIBRARY_PATH=\\$$ORACLE_HOME/LIBDIR:\\$$LD_LIBRARY_PATH" >> mfenv.sh

        @echo "export LD_LIBRARY_PATH" >> mfenv.sh

        @echo "COBDIR=$(COBDIR)" >> mfenv.sh

where

MY_ORACLE_HOME is the correct ORACLE_HOME directory on your target machine

for LIBDIR, substitute lib/lib32/lib64 as appropriate.

for AIX and HP-UX PA-RISC 32-bit, substitute LD_LIBRARY_PATH for LIBPATH and SHLIB_PATH respectively.

Hence if publishing to Linux Intel, and Oracle's root is /home/oracle8/9.2.0,  specify

mfenv.sh:

        @echo "#!/bin/sh" > mfenv.sh

        @echo "ORACLE_HOME=/home/oracle8/9.2.0" >> mfenv.sh

        @echo "export ORACLE_HOME" >> mfenv.sh

        @echo "PATH=\\$$ORACLE_HOME/bin:\\$$PATH" >> mfenv.sh

        @echo "export PATH" >> mfenv.sh

        @echo "LD_LIBRARY_PATH=\\$$ORACLE_HOME/lib:\\$$LD_LIBRARY_PATH" >> mfenv.sh

        @echo "export LD_LIBRARY_PATH" >> mfenv.sh

        @echo "COBDIR=$(COBDIR)" >> mfenv.sh

Old KB# 2187