Compiling 31-bit XPLINK applications

If your 31-bit application needs to use z/OS® XPLINK function linkage, use the ODBC 31-bit XPLINK driver and compile your application as an XPLINK application.

To compile 31-bit XPLINK applications:

Perform one of the following actions based on the compiler method:
Compile method Application language Action
Compile on z/OS All Specify the XPLINK compile option. For an example, see DSNTEJ8X in prefix.SDSNSAMP.
Compile in z/OS UNIX System Services C Use the c89 command with the -W 'c,xplink,dll' compile option. (The 'dll' option enables the use of the Db2 ODBC driver for C applications.)

For example, to compile a C application that is named dsn8o3vp.c that resides in the current working directory, use the following c89 compile command:

c89 -c -W 'c,xplink,dll,long,source,list' -
 -I"//'prefix.SDSNC.H'" \
 dsn8o3vp.c
C++ Use the cxx compile command with the -W 'c,xplink' compile option.

For example, to compile a C++ application that is named dsn8o3vp.c that resides in the current working directory, use the following cxx compile command:

cxx -c -W 'c,xplink,long,source,list' -
 -I"//'prefix.SDSNC.H'" \
 dsn8o3vp.C
Compile with the xlc utility on z/OS UNIX System Services C Specify the appropriate compiler options in the source program, a configuration file, or on the command line.
For example, to compile a C application that is named dsn8o3vp.c, you can use the following command:
xlc -c -qxplink dsn8o3vp.c -I"//'prefix.SDSNC.H'"
C++ Specify the appropriate compiler options in the source program, a configuration file, or on the command line.

For example, to compile a C++ application that is named dsn8o3vp.c, you can use the following command:

xlC -c -qxplink dsn8o3vp.C -I"//'prefix.SDSNC.H'"