Aleksey
New User
Joined: 24 Apr 2007 Posts: 13 Location: Russia
|
|
|
|
HI!
I'm writing C++ program, connecting to DB2 ver. 8 for z/OS, using CLI (ODBC)
Here the code:
Code: |
int main(void)
{
SQLRETURN cliRC = SQL_SUCCESS;
int rc = 0;
SQLHANDLE henv; /* environment handle */
SQLHANDLE hdbc; /* connection handles */
char dbAlias[]="****";
char dbUser[]="****";
char psw[]="****";
rc = CLIAppInit(dbAlias,
dbUser,
psw,
&henv,
&hdbc,
(SQLPOINTER)SQL_AUTOCOMMIT_ON);
...
}
int CLIAppInit(char dbAlias[],
char user[],
char pswd[],
SQLHANDLE *pHenv,
SQLHANDLE *pHdbc,
SQLPOINTER autocommitValue)
{
SQLRETURN cliRC = SQL_SUCCESS;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, pHenv);
...
return 0;
}
|
On the step
Code: |
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, pHenv);
|
" program fails, JCL returns code 12.
Can somebody help me? This step from the official CLI-sample. |
|