LIBNAME ODBC (reading DB2) error

Reply
Occasional Contributor
Posts: 7

LIBNAME ODBC (reading DB2) error

Hi All,

I support Windows SAS for a bunch of users.

Here is a problem reading DB2 through ODBC, using 9.3 on a 64 bit machine with 64 bit DB2 Connect:

A number of users run code like this:

  libname in odbc complete="dsn=M1DB2P;Uid=xxxxx;pwd=xxxxx" schema=fdrp;

and it works fine assigning the libref and can be used to read the data fine. (So we know the ODBC driver is ok.)

But when they want to enter id and pswd in popup boxes and run this:

  libname in odbc complete="dsn=M1DB2P" schema=fdrp;

they get this error:

ERROR: CLI error trying to establish connection: [IBM][CLI Driver] SQL1013N  The database alias        name or database name " " could not be found.  SQLSTATE=42705

Making it more difficult for me to debug, I can run both version on my own machine just fine.

Everything seems the same between my machine and theirs.

All thoughts greatly appreciated,

Steve


With all the same conditions, I do not get the

Contributor
Posts: 66

Re: LIBNAME ODBC (reading DB2) error

Posted in reply to staffordst

Try without the complete="...", i.e.,

libname in odbc dsn=M1DB2P schema=fdrp;

My libname statements work without this options, for instance for Oracle or Taradata.

Alternatively try adding PROMPT= "uid=;pwd=;"

Occasional Contributor
Posts: 7

Re: LIBNAME ODBC (reading DB2) error

Posted in reply to Dorota_Jarosz

This syntax does not work at all, even on my machine where the other syntax does.

Thanks for the email. I appreciate trying any possible solutions.

Steve

Contributor
Posts: 66

Re: LIBNAME ODBC (reading DB2) error

Posted in reply to staffordst

I am getting a similar message on PC SAS when my password expires. Is this on a server or on an independent PC workstation?

Occasional Contributor
Posts: 18

Re: LIBNAME ODBC (reading DB2) error

Posted in reply to staffordst

Hi Staffordst,

Try the following code this might solve your problem.

%window info

  #5 @5 'Please enter userid:'

  #5 @26 id 8 attr=underline

  #7 @5 'Please enter password:'

  #7 @28 pass 8 attr=underline display=no;

%display info;

libname in odbc complete="dsn=M1DB2P;Uid= &id; pwd=&pass" schema=fdrp;

Ask a Question
Discussion stats
  • 4 replies
  • 1228 views
  • 0 likes
  • 3 in conversation