IBM Support

Compile a COBOL for AIX program that has embedded SQL statements that access an Oracle database

Question & Answer


Question

What should I consider when I compile COBOL source programs using COBOL for AIX, V3.1 that access Oracle Database 11g Release 1.

Answer

When you use IBM COBOL for AIX to compile source code that contains embedded SQL statements that access an Oracle database, you might receive the messages shown below:


0711-317 ERROR: Undefined symbol: SQLORA
0711-317 ERROR: Undefined symbol: SQLADR
0711-317 ERROR: Undefined symbol: SQLADRUC
0711-317 ERROR: Undefined symbol: SQLBEX

These symbols are routines in the SQL runtime provided by Oracle. You must specify these Oracle libraries on the cob2 command line when you link your application.

For example, to specify that the application you are attempting to build needs to link with the Oracle runtime libraries, enter this command:

cob2 -q64 $ORACLE_HOME/precomp/lib/cobsqlintf.o -L$ORACLE_HOME/lib/ -lclntsh -o program program.cbl

This command assumes that you have the ORACLE_HOME environment set correctly for the path to which you have installed Oracle on your AIX system. The -o option specifies the name of the executable produced by the compiler, and if not specified will default to a.out.

[{"Product":{"code":"SS6SGM","label":"COBOL for AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Compiler","Platform":[{"code":"PF002","label":"AIX"}],"Version":"3.1","Edition":"","Line of Business":{"code":"LOB17","label":"Mainframe TPS"}}]

Document Information

Modified date:
08 August 2018

UID

swg21409672