Migrating an ODBC 31-bit application to a 64-bit application

Consider migrating an application from 31-bit mode to 64-bit mode only if the application can take advantage of more than 2 GB of memory. Most applications run acceptably with the 31-bit addressing limitations.

About this task

Applications that are most likely to benefit from 64-bit addressing are those that work with large amounts of data. For example, applications that work with large data sets can preload data into direct addressable memory for rapid access. Similarly, applications that work with large databases can cache more data in memory, which reduces the number of database requests.

Although 64-bit mode provides larger addressable storage, the amount of data that can be sent to and retrieved from Db2 by an ODBC application is still limited by the amount of storage that is available below the 2-GB bar. For example, an application cannot declare a 2-GB LOB above the bar and insert the entire LOB value into a Db2 LOB column.

Procedure

To migrate an ODBC 31-bit application to a 64-bit application:

  1. Modify your application as follows:
    • If your application calls the SQLSetConnectOption function, change the application to use the SQLSetConnectAttr function instead. SQLSetConnectOption is not supported in the ODBC 64-bit driver.
    • If your application calls the SQLSetStmtOption function, change the application to use the SQLSetStmtAttr function instead. SQLSetStmtOption is not supported in the ODBC 64-bit driver.
    • Use the C-defined types SQLINTEGER and SQLUINTEGER to declare all Db2 ODBC variables and arguments that contain 32-bit integer values.
    Recommendation: If your application calls any ODBC functions that have arguments of type SQLINTEGER or SQLUINTEGER, change those function calls to pass and receive values of type SQLLEN instead of SQLINTEGER and type SQLULEN instead of SQLUINTEGER.
  2. Recompile the application with the LP64 compile option. If you want the compiler to identify any potential portability errors, also specify the WARN64 compile option.
  3. Link-edit the application with the definition sidedeck for the z/OS® ODBC 64-bit driver, DSN1310.SDSNMACS(DSNAO64C).
  4. Execute the application.