BookmarkSubscribeRSS Feed
lfabbri
Obsidian | Level 7

Hello everyone, I need to write pipeline jobs in SAS Data Integration Studio with connections to Microsoft Sql Server databases both as source and destination for the data.

 

From the documentation I read that there is the possibility to setup an ODBC connection, but it must be created at operative system level (using microsoft windows odbc administrator). Is this the preferred way to setup connections to MSS in SAS 9.4 or there is a better way?

 

Thanks for any information!

12 REPLIES 12
JuanS_OCS
Amethyst | Level 16

Hello @lfabbri,

 

it depends on the SAS/ACCESS software your company has purchased. You can know this info by running proc setinit;run;

In general, you can connect on several ways: ODBC, OLEDB and with the native MSSQL connection.

Normally, the MSSQL connections would be faster and they have the potential to run even in-database procedures if you have the license/software.

 

lfabbri
Obsidian | Level 7

Hi @JuanS_OCS, thanks for the reply.

I've run the comand, this is the output:

 

---Base SAS Software
  30JUN2019
---SAS/STAT
  30JUN2019
---SAS/GRAPH
  30JUN2019
---SAS/CONNECT
  30JUN2019
---SAS Enterprise Miner
  30JUN2019
---SAS Integration Technologies
  30JUN2019
---SAS/Secure 168-bit
  30JUN2019
---SAS/Secure Windows
  30JUN2019
---SAS Enterprise Miner Server
  30JUN2019
---SAS Enterprise Miner Client
  30JUN2019
---SAS Text Miner
  30JUN2019
---SAS Enterprise Guide
  30JUN2019
---SAS/ACCESS Interface to PC Files
  30JUN2019
---SAS/ACCESS Interface to ODBC
  30JUN2019
---SAS/ACCESS Interface to MySQL
  30JUN2019
---SAS Metadata Bridges for General Industry Standards
  30JUN2019
---SAS Workspace Server for Local Access
  30JUN2019
---SAS/ACCESS to Postgres
  30JUN2019
---High Performance Suite
  30JUN2019
---SAS Add-in for Microsoft Excel
  30JUN2019

Could you please point me where I can find a detailed guide/docs on how to properly setup the connection using the native MSSQL interface (I guess it is supported in my configuration)? There is a tons of documentation and I am a bit lost.

 

Thank you very much!

JuanS_OCS
Amethyst | Level 16

Hi @lfabbri,

 

if you do now have the ODBC connections in your OS, you can always define them on code:

http://support.sas.com/kb/52/777.html

 

If you want to use pass-through: http://support.sas.com/kb/41/888.html

 

I recommend you a general read of this short document: http://support.sas.com/techsup/technote/accessing-microsoft-sql-server-from-sas.pdf

LinusH
Tourmaline | Level 20

Well, you always need a driver to be installed.

But if you are asking how to do a connection without having to define a DSN, see this thread:

https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Li...

Data never sleeps
lfabbri
Obsidian | Level 7

Thank you, I am asking because when I register a server or a library in Management Console I can see both ODBC server and Microsoft SQL Server options, although in the documentation I've read so far only the ODBC option is described.

LinusH
Tourmaline | Level 20

So I'm not sure what the question is?

There are several guides on how to set it up in SMC for ODBC sources.

If I recall right, you first select ODBC, but I then still specify which the underlying source is.

Data never sleeps
SASKiwi
PROC Star

If you are creating ODBC connections to SQL Server then you define the server in SMC as an ODBC server.

lfabbri
Obsidian | Level 7

Thanks guys for the great help, I was able to create the odbc server and library.

 

Now I have the following problem

The odbc library I've created is visible in Data Integration Studio by me and other users. I've also registered some tables from the SQL Server database, which are visible as well in the Inventory by me and other users. The problem is when creating a job that involves read/write from that odbc connection/library, it works only for my user but it fails for the other users with the following errors:

 

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.

ERROR: Libref DWHANPAL is not assigned.

I need to make this odbc library working for all the sas users. What I have to do?

 

Thanks in advance!

 

JuanS_OCS
Amethyst | Level 16

Hello @lfabbri,

 

please share with us your code (I suggest masking your sensible data of the connection), and please be aware, on the server where you run the SAS code, you still will need the correct ODBC to SQL Server (and right version) to be at least installed as bare minimum.

lfabbri
Obsidian | Level 7

Hi, I've finally solved creating a System DSN instead of a User DSN for my ODBC connection

ccaulkins912
Obsidian | Level 7

@JuanS_OCS did @lfabbri ever get to show you code/solution for his SQL Server issue?

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 4185 views
  • 25 likes
  • 5 in conversation