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
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
Hi Tom,
EG SAS is running on the server.
Thanks
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
Looks you are needing the ODBC definition on the Server to be present. See also: https://communities.sas.com/thread/56280
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..?
Are you using SQL server?: http://support.microsoft.com/kb/273813
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);
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
@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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.