How to Compile and link cobols on unix
First make sure the basic is set properly.
On Digital Unix and Sun Solaris, the variable to check is LD_LIBRARY_PATH.
On HPUX, the variable is SHLIB_PATH.
On AIX, the variable is LIBPATH.
A typical LD_LIBRARY_PATH, SHLIB_PATH, or LIBPATH might be:
LD_LIBRARY_PATH=/usr/lib/cobol/coblib:/usr/sybase/lib
This can be set in the .profile or the psconfig.sh file in the $PS_HOME directory.
1) COBDIR <== Should point to where the compiler is installed
2) PATH <== Should have your $COBDIR/bin (which cob will tell you which one it is executing)
3) LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH <== Should have $COBDIR/lib (depending on flavour of unix)
Then at the prompt if you type ' cob ‘, you should get a message to the effect saying I see no work.
Please follow the 'Compiling COBOL on UNIX' in PeopleTools installation guide to check the environment variables.
MicroFocus advises "unset COBPATH" when compiling, leaving
$COBPATH set when executing is okay!
To test a compile, set your env minus $COBPATH and create a temp directory:
# cp -p $ COBDIR/demo/debug/pi.cbl /tmp/location
Change to your /tmp/location:
# cob pi.cbl
This should compile if all is well...
In Unix all you need to do to compile all the COBOL is from the $PS_HOME/install directory type:
pscbl.mak
psrun.mak
Setting Environment Variables
On your UNIX system, you need to log in and ensure the following environment variables are set appropriately. Alternatively, make sure the following environment variables are set in the .profile file in the user's home directory:
• $ORACLE_HOME must point to the correct Oracle installation; for example:
ORACLE_HOME=/products/oracle/8.1.7;export ORACLE_HOME
• $ORACLE_HOME/bin must be added to PATH; for example:
PATH=$PATH:$ORACLE_HOME/bin;export PATH
• $ORACLE_HOME/lib must be appended to LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH,
whichever is appropriate for your platform.
• $ORACLE_SID must be set to the correct Oracle instance; for example:
ORACLE_SID=hdmo;export ORACLE_SID
• $COBDIRmust be set to the Server Express installation; for example:
COBDIR=/cobol/prod/svrexp-2.2.SP1;export COBDIR
• $COBDIR/lib must be appended to LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH, whichever is appropriate for your platform.
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COBDIR/lib;export LD_LIBRARY_PATH
LIBPATH=$LIBPATH:$COBDIR/lib;export LIBPATH
SHLIB_PATH=$SHLIB_PATH:$COBDIR/lib;export SHLIB_PATH
• $COBDIR/bin must be appended to the PATH; for example:
PATH=$PATH:$COBDIR/bin;export PATH
To set the required PeopleSoft environment variables, run psconfig.sh. Enter the following command:
cd
. ./psconfig.sh