Importing UNIX Applications into Net Express | Tips and Troubleshooting |
COBSQL is an integrated preprocessor designed to work with COBOL precompilers supplied by relational database vendors. It is intended for use with:
You should use COBSQL if you are creating applications that will be deployed on UNIX platforms and need to access either Oracle or Sybase relational databases.
To create a database application using COBSQL on Net Express that can be deployed to a UNIX system, first set up database software:
You would normally only need to perform these steps once. If you install a new release of the COBOL system on UNIX, or update the database client, you will have to relink the COBOL run-time system with the database support modules.
Develop the database application using COBSQL and the database precompiler in Net Express. See the Database Access (DBpubb03.htm) book for more information on how to invoke COBSQL under Net Express. There are normally sample programs supplied with the database precompiler that show how to code a COBOL program using Embedded SQL statements. Animate or run the application on Net Express, and, when the application is working as expected, copy the database application to the UNIX system:
Publish the project. The files are copied to the UNIX system, and a
Makefile created, but the application is not rebuilt.
k
option and the C"p(cobsql)"
directive. For example:
Animtst1.int: Animtst1.pco ./mfenv.sh cob Animtst.pco
becomes:
Animtst1.int: Animtst1.pco ./mfenv.sh cob k Animtst.pco C"p(cobsql)"
make
with this modified version of CSQLMakefile to
create versions of the programs that can be debugged on the UNIX system.
Note: If required, once you have set up the CSQLMakefile correctly, you can use Publisher to automate this step. Publisher enables you to specify UNIX commands to be performed before a build takes place.
make f makefilename
in the Pre-Build Command field. makefilename should
be the name of your edited Makefile (in this example, CSQLMakefile).
Click .
If you do this, then when you publish the project, the
automatically-generated build will fail, but the build created using
your makefile (CSQLMakefile in this example) will rebuild the
application successfully.
If you are developing an application on Net Express that you want
to deploy on a UNIX system, you should note the following:
COBSQLTYPE=ORACLE
enter:
COBSQLTYPE==ORACLE
This only applies to directives placed on the cob command
line. It does not apply to directives in the cobsql.dir file.
Note: To be able to re-link the COBOL run-time a version of the "C" development system must be available on the machine.
new-run-time program-name
where new-run-time is the name of the re-linked run-time and
program-name is the name of the application.
* CSQL-F-016: UNIX Exec error Return Code is return code
This indicates that errors occurred and so the precompilation did
not execute correctly.
* CSQL-F-021: Precompiler did not complete -- Terminating
The following example shows the command lines required to compile a COBSQL program for Oracle under UNIX:
cob -a -v -k sample.pco -C "p(cobsql) cstop cobsqltype==ORACLE"
The following example shows the command lines required to compile a COBSQL program for Sybase under UNIX:
cob -a -v -P -k example1.pco -C"p(cobsql) nocst csp CSQLT==syb"
The following COBSQL error messages only appear on UNIX systems.
CSQL-F-002: Unable to connect with Micro Focus CDI2
As part of the initialisation process COBSQL tries to connect to the internal Micro Focus module CDI2. CDI2 provides COBSQL with CSI information about variables within the program being compiled. CDI2 is an integral part of the Toolbox or Object COBOL environment, so under normal execution it should always be present. This error would usually only be displayed if there are memory problems. Shutting down the Toolbox environment or the Object COBOL Development Environment Menu System, and restarting should clear the problem.
CSQL-F-016: UNIX Exec error Return Code is return-code
On UNIX this is NOT a fatal error. If a database precompiler finds errors in the source file, it is likely to produce a non-zero return code. Because this might happen, COBSQL will continue after displaying this message.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Importing UNIX Applications into Net Express | Tips and Troubleshooting |