Using the ODBC Operator on IBM z/OS
Ensuring that the HOST ODBC Driver is Setup
This task is usually performed by a z/OS system programmer or DB2 DBA.
The Mainframe HOST DB2 ODBC interface uses a plan named DSNACLI. Part of the DB2 installation process involves binding this plan and its associated packages (see member DSNTIJCL in SDSNSAMP).
For more information the DB2 z/OS ODBC Guide and Reference.
Note: The above interface is not the JDBC interface. Some windows DESKTOP software, including many IBM applications use JDBC. Just because your windows software is functional does not mean the above task has been performed correctly.
Ensuring that UNIX User IDs are Setup
This task is performed by the system security staff or system programmers.
Teradata PT requires that User OMVS Segments are defined.
Note: If the OMVS segment is not defined, the results are undetermined.
Teradata PT hangs when the default OMVS Segment is used because IBM (when running the default OMVS segment) does not support some of the callable services used by Teradata PT, among them kill(), pidaffinity(), trace(), and sigqueue().
Obtaining Database System Identity Information
Note: The following information, used by the Teradata PT ODBC operator, must be provided by a DB2 DBA or z/OS system programmer:
In many applications, when DDF is not being used, a local database is accessed. In these cases, the local database name is the name that was set during DB2 installation as DB2 LOCATION NAME on the DSNTIPR installation panel for the DB2 subsystem.
When the data source name is not provided, the default local database will be used. The local database is identified by the SSID.
Setting Up the Teradata PT Job JCL for ODBC
To define a subsystem to DB2 ODBC:
The DSNHDECP load module is usually link-edited into the *.SDSNEXIT data set. See the example below:
//STEPLIB DD DSN=DSN910.SDSNEXIT,DISP=SHR
// DD DSN=DSN910.SDSNLOAD,DISP=SHR
To set up a Teradata PT Job JCL for ODBC:
//JOBLIB DD ( … )
// DD DSN=DB2910.SDSNLOAD,DISP=SHR
//TPT.DSNAOINI DD DSN=DB2910.INIT(DB2INIT)
DB2INIT:
[COMMON]
MVSDEFAULTSSID=SSID
Updating the Teradata PT Job Variables File
Set the following variables in the job variables file:
Data_Source = 'connection-name'
DB2UserName = 'johndoe'
DB2Password = 'abcd1234'
Updating the Teradata PT Job Script
Define the following attributes in the ODBC job script:
VARCHAR DSNName = @Data_Source,
VARCHAR UserName = @DB2UserName,
VARCHAR UserPassword = @DB2Password,
Note: The DSNName is the data source name. When this is not provided, the default local database identified by the SSID is used. When the user name and password are not provided the RACF credentials of the job and/or the name of the user who submitted the job are used.
Debugging Connection Errors
To debug connection errors, set the ODBC Operator script "tracelevel" to "special" in the ODBC job script, as follows:
VARCHAR TraceLevel = 'Special'
The following are common connection errors:
Fatal error received from ODBC driver:
STATE=58004, CODE=-99999,
MSG='{DB2 for OS/390}{ODBC Driver}
SQLSTATE=58004 ERRLOC
CAF "OPEN" failed using DB2 system:DSN9 and PLAN:DSNACLI
RC=0c and REASON=00f30040
Note: After maintenance is applied to DB2, a connection failure of (-803) indicates that the plan needs to be rebound.
Fatal error received from ODBC driver:
STATE=42505, CODE=-922,
MSG='{DB2 for OS/390}{ODBC Driver}
DSNT408I SQLCODE = -922, ERROR: AUTHORIZATION FAILURE: 00D31024 ERROR.
CONNECT
DSNT418I SQLSTATE = 42505 SQLSTATE RETURN CODE
Fatal error received from ODBC driver:
STATE=58004, CODE=-99999,
MSG='{DB2 FOR OS/390}{ODBC DRIVER} SQLSTATE=58004 ERRLOC=2:170:9
CAF "CONNECT" failed using DB2 system:DSN9
RC=08 and REASON=00f30002
This can occur for two reasons: