Setting up Db2 ODBC for the z/OS UNIX environment
You can compile, bind, and run ODBC applications in the z/OS® UNIX environment. However, you must first set up the environment. You need to perform this setup task only once.
Procedure
To set up Db2 ODBC for the z/OS UNIX environment:
Make the Db2 ODBC
definition sidedeck available to z/OS UNIX users
by performing one of the following actions:
- Define a data set alias for the ODBC sidedeck that uses
.EXPas the last qualifier in the name. This alias must relate to the prefix.SDSNMACS data set where the Db2 ODBC definition sidedeck is installed.The z/OS UNIX environment compiler determines the contents of an input file based on the file extension. If a file resides in a partitioned data set (PDS), the last qualifier in the PDS name is treated as the file extension.
The z/OS UNIX environment compiler recognizes the Db2 ODBC definition sidedeck if it meets these conditions:- It resides in a PDS.
- The last qualifier in the PDS name is
.EXP.
For example, assume that Db2 is installed using DSN1310 as the high-level data set qualifier. You can define the alias by using the following command:
This alias allows z/OS UNIX environment users to directly reference the Db2 ODBC definition sidedeck by specifying the following input files as input to the z/OS UNIX environmentDEFINE ALIAS(NAME('DSN1310.SDSNC.EXP') RELATE('DSN1310.SDSNMACS'))c89command.For the non-XPLINK ODBC driver:"//'DSN1310.SDSNC.EXP(DSNAOCLI)'"For the 31-bit XPLINK ODBC driver:"//'DSN1310.SDSNC.EXP(DSNAOCLIX)'"For the 64-bit XPLINK ODBC driver:"//'DSN1310.SDSNC.EXP(DSNAO64C)'" - Specify the z/OS data set
suffix by using the _C89_XSUFFIX_HOST or _CXX_XSUFFIX_HOST environment
variable. The default value is EXP.
For example, changing the default from EXP to SDSNMACS allows the link to work without a Define Alias.
For the c89 compiler, issue:export _C89_XSUFFIX_HOST="SDSNMACS"For the cxx compiler, issue:export _CXX_XSUFFIX_HOST="SDSNMACS"