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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1212 views
  • 0 likes
  • 3 in conversation