DATA Step, Macro, Functions and more

SAS Access/Interface with SQL server

Reply
New Contributor JS3
New Contributor
Posts: 3

SAS Access/Interface with SQL server

Hi, I am having a problem with connecting to data in sql database.

 

I am not sure if I don't have certain driver or if the code I am using is incorrect. Could someone please help guiding me to the right direction?

 

1. Below is the product license that I have after running Proc Setinit

Inline image 1

 

2. Below is product installed after I ran Proc Product_Status

Inline image 2

 

It seems like sas access to sql server is not installed right?

 

I am also trying these codes to connect and all got error. Which direction of code should I be using? ODBC or sqlsvr?

 

I tried sqlsvr and got this error message

Code:

LIBNAME database1 sqlsvr user=datareader password=myspassword DATAsrc=clientA;

Error:

LIBNAME database1 sqlsvr user=datareader password=XXXXXXX DATAsrc=clientA;

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.

 

When I tried ODBC route, I got this message

Code:

LIBNAME database1 ODBC DSN=clientA User=datareader Password=myspassword ;

Error:

LIBNAME database1 ODBC DSN=clientA User=datareader Password=XXXXXXX;

ERROR: The ODBC engine cannot be found. ERROR: Error in the LIBNAME statement.

 

Could someone please point me to the right direction? Should DSN be the name of the database of each client as "ClientA" etc or should it be the name of the server?

 

Thank you so much!

PROC Star
Posts: 2,319

Re: SAS Access/Interface with SQL server

1. Your images didn't make it to the post.

2. DSN is the name of the data source. It is visible in the list of sources when running ODBC Manager.

New Contributor JS3
New Contributor
Posts: 3

Re: SAS Access/Interface with SQL server

1.png2.png

Thank you.  Above are the image again.  Thank you!

Super User
Posts: 9,925

Re: SAS Access/Interface with SQL server

Since this is part of a log, don't use a picture for posting. Copy/paste the text to a {i} subwindow. (ctrl-c/ctrl-v in Windows)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor JS3
New Contributor
Posts: 3

Re: SAS Access/Interface with SQL server

Posted in reply to KurtBremser

Hi KurtBremser,

Here's the copy.paste version of log.  Do you have any recommendation on my questions?  Thank you

 

Current version: 9.04.01M5P091317


Expiration: 14FEB2018.
Grace Period: 45 days (ending 31MAR2018).
Warning Period: 45 days (ending 15MAY2018).
System birthday: 13DEC2017.
Operating System: WX64_WKS.
Product expiration dates:
---Base SAS Software
14FEB2018
---SAS/STAT
14FEB2018
---SAS/GRAPH
14FEB2018
---SAS/Secure 168-bit
14FEB2018
---SAS/Secure Windows
14FEB2018
---SAS Enterprise Guide
14FEB2018
---SAS/ACCESS Interface to PC Files
14FEB2018
---SAS/ACCESS Interface to Microsoft SQL Server
31DEC2017
---SAS Workspace Server for Local Access
14FEB2018
---SAS/ACCESS to Amazon Redshift
31DEC2017
---High Performance Suite
14FEB2018

16 proc Product_Status ; run;

For Base SAS Software ...
Custom version information: 9.4_M5
Image version information: 9.04.01M5P090617
For SAS/STAT ...
Custom version information: 14.3
For SAS/GRAPH ...
Custom version information: 9.4_M5
For SAS/ACCESS to Amazon Redshift ...
Custom version information: 9.42
For High Performance Suite ...
Custom version information: 2.2_M6
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M5
NOTE: PROCEDURE PRODUCT_STATUS used (Total process time):
real time 0.24 seconds
cpu time 0.00 seconds

Ask a Question
Discussion stats
  • 4 replies
  • 158 views
  • 0 likes
  • 3 in conversation