Compiling 64-bit applications

If your application is written for 64-bit addressing, use the ODBC 64-bit driver to compile your application.

Procedure

To compile 64-bit applications:

Perform one of the following actions based on the compiler method:
Compile method Application language Action
Compile on z/OS® All Specify the LP64 compile option. Also consider specifying the FLOAT(HEX) and WARN64 compile options. a b

For an example, see DSNTEJ8E in prefix.SDSNSAMP.

Compile in z/OS UNIX System Services C Use the c89 command with the -W 'c,lp64' compile option. Also consider specifying the float(hex) and warn64 compile options. a b

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

c89 -c -W 'c,lp64,float(hex),warn64,long,source,list'
 -I"//'prefix.SDSNC.H'" \
 dsn8o3vp.c
C++ Use the cxx compile command with the -W 'c,lp64' compile option. Also consider specifying the float(hex) and warn64 compile options. a b

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

cxx -c -W 'c,lp64,float(hex),warn64,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.The following example shows how to compile a 64-bit C application by using the command line options:
xlc -c -q64 -qfloat=hex -qwarn64 dsn8o3vp.c
-I"//'prefix.SDSNC.H'"
C++ Specify the appropriate compiler options in the source program, a configuration file, or on the command line. The following example shows how to compile a 64-bit C++ application by using the command line options:
xlC -c -q64 -qfloat=hex -qwarn64 dsn8o3vp.C
-I"//'prefix.SDSNC.H'"
Notes:
  1. Specify FLOAT(HEX) if you want the 64-bit application to generate floating-point data in hexadecimal format. By default, specifying the LP64 compile option generates FLOAT(IEEE) code. This behavior is different from the default setting of FLOAT(HEX) when compiling 31-bit applications. For applications that are compiled with FLOAT(IEEE), you must specify FLOAT=IEEE in the common section of the initialization file.
    Important: after setting FLOAT=IEEE, you must recompile your application program with the C compiler option set to FLOAT(IEEE). Failure to do so could result in data corruption.
  2. Specify WARN64 when recompiling existing 31-bit ODBC applications into 64-bit code. This option detects possible portability errors.