I compiling/running an ODBC application on z/OS.

I call the following functions:

SQLSetConnectAttr.....
SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&hen v);
SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc) ------> at this point I get error:

SQLSTATE: 58004
SQLCODE: -99999
MESSAGE: {DB2 FOR OS/390}{ODBC DRIVER} SQLSTATE=58004 ERRLOC=2:170:9
CAF "CONNECT" failed using DB2 systemSN
RC=0c and REASON=00f30006

Is there something I'm missing ?