Desktop productivity for business analysts and programmers

EG SAS ODBC

Reply
Contributor
Posts: 22

EG SAS ODBC

Hi,

Attached is a program with log that I am trying to run again one of
the servers. It runs fine on PC SAS. But when I tried to run it on EG SAS, I am
a getting this error (see at the bottom): I don’t’ understand what this error
is all about.. Here what does "near 2 means"?

 

ERROR: CLI describe error: [Sybase][ODBC
Driver][Adaptive Server Enterprise]Incorrect syntax near '2'.

I would appreciate your help..

Thanks

Attachment
Trusted Advisor
Posts: 1,051

Re: EG SAS ODBC

Hi, Anna

My first question is, is the SAS session that EG connects to on your local PC, or are you using a SAS process on a remote server to run this code? The debugging process will be different depending on the answer.

Tom

Contributor
Posts: 22

Re: EG SAS ODBC

Hi Tom,

EG SAS is running on the server.

Thanks

Trusted Advisor
Posts: 1,051

Re: EG SAS ODBC

I think that is onto something. I would suggest that you test his hypothesis with some very simple code that would pull some data out of one of your tables using the pass-through syntax that you are trying to use.

Without knowing anything about your database, I would use something like this to prevent putting any load on your environment:

%LET facid=("DSN=Reporting;" || "UID=rp&UID.;" || "PWD=&pwd.;" || "SERVER=cbcfrpt00");

proc sql;

connect to odbc &facid;

create table work.TestOutput as select UMUM_REF_ID from CMC_UMUM_UTIL_MGT(obs=10);

quit;

If you get data back, it means that your macro variable is working correctly. If not, you'd need to tinker with your macro variable and connect statement until you get data back. Then you can proceed with your more complex statement.

Tom

Valued Guide
Posts: 3,206

Re: EG SAS ODBC

Looks you are needing the ODBC definition on the Server to be present. See also: https://communities.sas.com/thread/56280

---->-- ja karman --<-----
Contributor
Posts: 22

Re: EG SAS ODBC

Hi Jaap,

We do have ODBC connections set up on the server. If I run a very simple query against that db, it works..also the steps before this SQL works where I am pointing to the same db. But it’s just I am getting this error message when I try to run this SQL. And I don't understand the error either.. Also this SQL runs fine on PC SAS. Doesn't look like anything wrong iwth the query. May there is something in thei query that EG doesn't like..?

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: EG SAS ODBC

Are you using SQL server?: http://support.microsoft.com/kb/273813

Respected Advisor
Posts: 3,825

Re: EG SAS ODBC

Looking at your log it appears to me that the connection string is incorrect.

411        connect to odbc &facid; /* Chris DSN for FACETS is logidf */

SYMBOLGEN:  Macro variable FACID resolves to ("DSN=Reporting;" || "UID=xxxx;" || "PWD=xxxx;" || "SERVER=xxxx")

This means SAS sees the following:

connect to odbc ("DSN=Reporting;" || "UID=xxxx;" || "PWD=xxxx;" || "SERVER=xxxx");

I believe it should be:

connect to odbc (DSN=Reporting UID=xxxx PWD=xxxx SERVER=xxxx);

Valued Guide
Posts: 3,206

Re: EG SAS ODBC

AnnaShami, that is a lot of information to think...

Eguide is nothing more as a very good editor, it does not run the SAS code.

You can direct that code either to "local" or to a server "SASApp". When you send your code to 'local" that is your pc/desktop PC SAS, there is no difference at all. 

Very sure this code runs unchanged when using "local' correct?

Your included log is telling the code has run in a Windows environment (namings //../../), as you say the ODBC connection is working (DNS=).

To pinpoint to a cause eliminiate all those possible differences.

- which SAS version local and on the server

- which ODBC version local and on the server.

- What SAS options have been set. Special attention for those for the ODBC Access 

You are using explicit pass through, still you could activate a trace to see what is happening / getting better information

  SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Third Edition

---->-- ja karman --<-----
Valued Guide
Posts: 3,206

Re: EG SAS ODBC

@Patrick I think you are correct, the coding of facid looks to be copied from a data-set approach.  Here it macro-strings with %let.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 9 replies
  • 502 views
  • 0 likes
  • 5 in conversation