BookmarkSubscribeRSS Feed
SVoldrich
Obsidian | Level 7

team is using:

SAS EG 8.2

Personal Login Manager 9.4
I inherited this code, and it works on the old server. 


Our server is updating in the next week, so I'm going through all our queries to make sure they are pointed to the correct new server.  (New server is live now, so we can connect. work is still being done in old server until final cutover and then new server will have the most current data.)

 

This query connects through a libname. 
LIBNAME COBSPROD SQLSVR authdomain=SQLSVR database=COBS SCHEMA=DBO;

 

It's been a while since I've had to set up a libname for sql server.

I can't figure out how/where to check it's connected to the correct server. 

8 REPLIES 8
ChrisNZ
Tourmaline | Level 20

You can extract information to validate what's there, like:

proc sql;
  connect using COBSPROD;
  select * from connection to COBSPROD (select * from  sys.sysdatabases);
quit;

Extract the information that will make you confident you are using the correct server.

 

 

ChrisNZ
Tourmaline | Level 20

You can also execute commands such as:

execute by COBSPROD (drop table test_table1) ;
SVoldrich
Obsidian | Level 7

Thanks.
Right now the old server is still up (we are confirming that things are working in the new server) so the 2 servers should be identical. 
Just trying to know how to know which server it's connected to. 

is it based on our ODBC connection? 

ChrisNZ
Tourmaline | Level 20

Are you using ODBC? I'd expect a dsn option in the libname statement if you are.

That ODBC manager's DSN entry would contain the ODBC connection parameters.

 

I'd just create a test table on the new server and check that I can see it.

AlanC
Barite | Level 11

I would echo ChrisNZ's suggestion and use ODBC.  In pretty much every MS/SAS consulting client, I would always encourage ODBC. It just works and is easier to configure. 

 

OleDB is similar but ODBC is more widely used. I don't believe I used the SQLSRVR engine and I did dozens of SAS/SQL Server engagements. IIRC, it was difficult to get setup with modern SQL Server engines due to security.  I am working off of memories so it certainly may have changed.

https://github.com/savian-net
SASKiwi
PROC Star

Looks like your LIBNAME is using an AUTHDOMAIN to define the credentials to connect to SQL Server. Ask your SAS administrator to explain the setup. This is done in SAS metadata via SAS Management Console.

ChrisNZ
Tourmaline | Level 20

Please select a reply as an answer if you answered your question.

Sajid01
Meteorite | Level 14

Hello
Your server appears to be connecting to the server defined by authdomain=SQLSVR . Your SAS Admin should be able to provide the details.
You can try a direct libname statement to connect to the new server. This link has the details.

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0gz66qe8msnkyn1jgnhrr0l2k8y.htm

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 8 replies
  • 747 views
  • 0 likes
  • 5 in conversation