BookmarkSubscribeRSS Feed
AnnaShami
Fluorite | Level 6

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

9 REPLIES 9
TomKari
Onyx | Level 15

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

AnnaShami
Fluorite | Level 6

Hi Tom,

EG SAS is running on the server.

Thanks

TomKari
Onyx | Level 15

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

jakarman
Barite | Level 11

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

---->-- ja karman --<-----
AnnaShami
Fluorite | Level 6

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..?

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

Patrick
Opal | Level 21

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);

jakarman
Barite | Level 11

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 --<-----
jakarman
Barite | Level 11

@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 --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1727 views
  • 0 likes
  • 5 in conversation