Compiling an ODBC application

The first step in preparing an ODBC application is to compile it. the compiler process is slightly different depending on whether the application is an XPLINK application, a non-XPLINK application, or a 64-bit application.

Before you begin

Before you begin compiling a Db2 ODBC application, ensure that you include the header file sqlcli1.h in your application. This header file contains all information that is required to compile the application. To include this file, add the following directive in the header of your Db2 ODBC application:
#include <sqlcli1.h>

Procedure

To compile an ODBC application:

Depending on whether the application is an XPLINK application, a non-XPLINK application, or a 64-bit application, follow the appropriate instructions for compiling it.

For all Db2 ODBC applications, when you compile the application, you must add the DSN1310.SDSNC.H data set to the SYSPATH concatenation, the include path that is specified by the SEARCH or LSEARCH compiler options or the -I option for z/OS® UNIX System Services. This data set includes all Db2 ODBC header files that define the function prototypes, constants, and data structures that are needed for a Db2 ODBC application.