3. Embedded QUEL for COBOL : Precompiling, Compiling, and Linking an EQUEL Program : Incorporating Ingres into the Micro Focus RTS--UNIX : Building an Ingres RTS Without the Ingres FRS
 
Share this page                  
Building an Ingres RTS Without the Ingres FRS
If you are using the COBOL screen utilities and do not need the Ingres forms runtime system (FRS) incorporated into your COBOL runtime support module, then you can link the RTS exclusively for database activity.
This section describes how to provide the COBOL RTS with all Ingres runtime routines.
Create a directory in which you want to store the Ingres-linked RTS. For example, if the COBOL root directory is "/usr/lib/cobol", you may want to add a new directory "/usr/lib/cobol/ingres" to store the Ingres/COBOL RTS. From that new directory, issue the commands that extract the Ingres Micro Focus support modules, link the Ingres COBOL RTS, and supply an alias to run the new program. The shell script shown below performs all of these steps. Note that "$II_SYSTEM" refers to the path-name of the Ingres root directory on your system:
#
# These 2 steps position you in the directory in which 
# you want to build the RTS
#
mkdir /usr/lib/cobol/ingres
cd /usr/lib/cobol/ingres

# Extract 2 Ingres Micro Focus COBOL support modules
#
ar xv $II_SYSTEM/ingres/lib/libingres.a iimfdata.o
ar xv $II_SYSTEM/ingres/lib/libingres.a iimflibq.o
#
# Now link the new Ingres COBOL RTS (this example c
# calls it "ingrts")
#
cob -x -e "" -o ingrts                     \
       iimfdata.o iimflibq.o               \
       $II_SYSTEM/ingres/lib/libingres.a   \
       -lc -lm
#
# Provide an alias to run the new program (distribute to 
#  RTS users)
#
alias ingrts /usr/lib/cobol/ingrts
Ingres shared libraries are available on some Unix platforms. To link with these shared libraries replace "libingres.a" in the cob command with:
-L $II_SYSTEM/ingres/lib -linterp.1 -lframe.1 -lq.1 \
     -lcompat.1
To verify if your release supports shared libraries check for the existence of any of these four shared libraries in the $II_SYSTEM/ingres/lib directory. For example:
ls -l $II_SYSTEM/ingres/lib/libq.1.*
Since the resulting RTS is quite large, the temporary holding directory required by COBOL may need to be reset. By default, this directory is set to "/usr/tmp". If you are issued "out of disk space" errors during the linking of the Ingres/COBOL RTS, you should consult your COBOL Programmer's Reference Manual to see how to modify the TMPDIR environment variable.
Note that you may need to specify other system libraries in addition to the "-lm" library on the cob command. The libraries required are the same as those needed to link an EQUEL/C program. The library names may be added to the last line of the cob command shown above. For example, if the "inet" and the "inetd" system libraries are required, the last line of the cob command would be:
-lc -lm -linet -linetd
At this point you are ready to run your EQUEL/COBOL program.