How to use the initialization file
The Db2 ODBC initialization file is read at application run time. You can specify the file by using either a DSNAOINI data definition statement or by defining a DSNAOINI z/OS® UNIX environment variable.
Db2 ODBC opens the DSNAOINI data set allocated in your JCL first. If a DSNAOINI data set is not allocated, then Db2 ODBC opens the environment variable data set.
The initialization file specified can be either a traditional z/OS data set or an HFS file under the z/OS UNIX environment. For z/OS data sets, the record format of the initialization file can be either fixed or variable length.
The following examples use a DSNAOINI JCL data definition statement to specify the Db2 ODBC initialization file types supported:
//DSNAOINI DD DSN=USER1.DB2ODBC.ODBCINI,DISP=SHR
Partitioned data set USER1.DB2ODBC.DATA, member ODBCINI: //DSNAOINI DD DSN=USER1.DB2ODBC.DATA(ODBCINI),DISP=SHR
Inline JCL DSNAOINI DD specification: //DSNAOINI DD *
[COMMON]
MVSDEFAULTSSID=VD1A
/*
HFS file /u/user1/db2odbc/odbcini: //DSNAOINI DD PATH='/u/user1/db2odbc/odbcini'
The following examples of z/OS UNIX export statements define the Db2 ODBC DSNAOINI z/OS UNIX environment variable for the Db2 ODBC initialization file types supported:
export DSNAOINI="/u/user1/db2odbc/odbcini"
HFS file ./db2odbc/odbcini, relative to the present working directory of the application: export DSNAOINI="./db2odbc/odbcini"
Sequential data set USER1.ODBCINI: export DSNAOINI="USER1.ODBCINI"
Redirecting to use a file that is specified by another previously allocated DD statement, MYDD: export DSNAOINI="//DD:MYDD"
Partitioned data set USER1.DB2ODBC.DATA, member ODBCINI: export DSNAOINI="USER1.DB2ODBC.DATA(ODBCINI)"
When specifying an HFS file, the value of the DSNAOINI environment variable must begin with either a single forward slash (/), or a period followed by a single forward slash (./). If a setting starts with any other characters, Db2 ODBC assumes that a z/OS data set name is specified.
Allocation precedence: Db2 ODBC opens the DSNAOINI data set allocated in your JCL first. If a DSNAOINI data set is not allocated, then Db2 ODBC opens the environment variable data set.