BookmarkSubscribeRSS Feed
sasuser1031
Calcite | Level 5

I am getting error when I try yo connect to SSMS in server. I have successful ODBC connection. However, I get the following error. It looks like error is coming from two words in user. How to fix it?

 

libname mydblib odbc user=apple orange  password=XXXXXXXXXXXX dsn=sqlserver;
______
22
ERROR: Libref MYDBLIB is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name orange.

5 REPLIES 5
LeonidBatkhan
Lapis Lazuli | Level 10

Hi sasuser1031,

Try putting the user value in quotes: user="apple orange"  .

sasuser1031
Calcite | Level 5

Hi Leonid,

Thanks for the suggestion. I tried using quotes, but It  gives this error now.

ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver
specified
ERROR: Error in the LIBNAME statement.

SASKiwi
PROC Star

The error suggests that the DSN sqlserver is not defined on your SAS server. Is your SAS session running locally on your PC or on a remote SAS server? If you use a remote SAS server what OS is it using?

 

If you are running SAS locally on your PC then you can use the Windows ODBC Administrator to define the DSN with the appropriate SQL Server ODBC driver.

sasuser1031
Calcite | Level 5

Hi SASKiwi,

This SAS EG is installed in my machine and connected to the server. I am not sure what OS it is using. 

How do you fix if it is connected to server?

SASKiwi
PROC Star

You will need to work with your SAS administrator who will hopefully know what is required.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 526 views
  • 0 likes
  • 3 in conversation