BookmarkSubscribeRSS Feed
SYREXOKONNA0
Calcite | Level 5

Hi All,

 

I NEED URGENT HELP AND I AM NOT AN IT GURU,SO PLEASE TRY AND USE SIMPLE TERMS WHEN GIVING ME THE SOLUTION.

 

I have finally convince my company to get me SAS and I have been given a desktop they have gone and purchase desktop SAS enterprise guide and Enterprise miner for me. And its installed on window 10 computer 64 bit with 24 GB RAM

I have never been involved in setting this tool up in my previous roles.

I want to use SAS/ACCESS statement to read data from our data base (MS SQL SERVER 2008 R2) into the SAS environment and create a library for my use within SAS.

Please can someone give me a step by step solution to this if possible some codes.

Nobody in my organisation knows this and even my IT guys have not deal with SAS tool before,I had to talk them through the download even though I don't know much about it 

Proc SETINIT statement gives me the following result,this will give you clue of the software and SAS Ad-in I have.

---Base SAS Software 15OCT2018
---SAS/STAT 
---SAS/GRAPH 
---SAS Enterprise Miner 
---SAS/Secure 168-bit 
---SAS/Secure Windows 
---SAS Enterprise Guide 
---SAS/ACCESS Interface to PC Files 
---SAS/ACCESS Interface to Microsoft SQL Server 
---SAS Enterprise Miner for Desktop 
---SAS Workspace Server for Local Access 
---High Performance Suite 
---SAS Add-in for Microsoft Excel

 

1 REPLY 1
wrrichar1
SAS Employee

Hello SYREXOKONNA0,

 

Judging by your Proc Setinit output, it appears you have one of the necessary products (SAS/ACCESS Interface to Microsoft SQL Server) licensed to enable a connection Microsoft SQL Server 

 

This product is ODBC based.  Therefore, in order to connect to the DBMS, you will need to setup an ODBC Data Source (DSN) in the ODBC Data Source Administrator outside of SAS on the machine where Foundation SAS is installed.  Based on your description it sounds as if the Foundation SAS machine is your PC, but you will need to confirm this before setting up the DSN.  If Foundation SAS is running on a server, then the configuration of the DSN will need to be done on the server.

 

The driver will be supplied by SAS (SAS Access to SQL Server), so there will be no need to install that.  What you will need to do is access the ODBC Data Source that is of the same bit as your Foundation SAS installation (i.e. 64 bit SAS -->  64 bit ODBC Data Source Administrator) and configure your DSN.  This will require that you know site specific information such as the server name where the SQL Server database resides, what type of authentication is required to access the database, either the SQL Server login credentials or the Windows authentication credentials, etc.  

 

Once you have created the DSN of the appropriate bit, connection from within SAS is relatively easy.  All you will need to do is issue a Libname that follows a similar structure to the one below:

 

libname test sqlsvr dsn='the dsn name you created' user='your user id' pw='your password' schema='your schema';

 

Note:  if you use Windows authentication, the user and pw parameters are not needed in the Libname.  Additionally, the default schema for SQL Server is dbo, so if you issue the Libname successfully, but do not see the tables, a good starting schema would be 'dbo';

 

If you are not familiar with setting up ODBC DSN's using the Microsoft ODBC Data Source Administrator, I suggest calling or emailing SAS Technical Support to open a track with them.  SAS Technical Support is free of charge to sites that have paid for a SAS license.  Please be aware that Technical Support can only help you get this connection made if you have the site-specific information necessary to create the DSN.

 

I hope this helps!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1641 views
  • 2 likes
  • 2 in conversation