<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to connect to an external SQL Server from SAS Viya 4? in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/How-to-connect-to-an-external-SQL-Server-from-SAS-Viya-4/m-p/969153#M2884</link>
    <description>&lt;P&gt;Hi group,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our team has set up the sas-analytics-pro docker container, release stable-2025.05.&amp;nbsp; This will be replacing SAS 9.4 on the Windows desktops.&amp;nbsp; Our current solution involves defining a user ODBC DSN in Windows and then running LIBNAME at the top of SAS programs (or at start-up) to define a library reference to the SQL Server where our main data mart resides.&amp;nbsp; We are experiencing difficulties in getting the equivalent approach to work in Viya..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within SAS Studio I have run &lt;EM&gt;proc setinit noalias&lt;/EM&gt;; and confirm that&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;---SAS/ACCESS Interface to Microsoft SQL Server&lt;/EM&gt; is installed.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using curl I confirmed network connectivity from the container to the SQL Server.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We see in&amp;nbsp;&lt;EM&gt;/opt/sas/viya/home/lib64/accessclients/odbcinst.ini&lt;/EM&gt; that&amp;nbsp;SAS ACCESS to MS SQL Server is installed, or at the least, the referenced library file exists.&lt;/P&gt;&lt;P&gt;All of our attempts to connect using various methods in documentation or found in Internet forums have failed, usually with a variation of a libname error, example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;83         libname sqlsrv odbc
84           noprompt=
85             "Driver=SAS ACCESS to MS SQL Server;
86              Host=xxxxxx;
87              Port=1433;
88              Database=yyyyyy;
89              Uid=uuu;
90              Pwd=ppp;"
91           schema=dbo;
ERROR: CLI error trying to establish connection: 523 630
ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or in the case of a custom odbc.ini, with environment variables set appropriately&lt;/P&gt;&lt;P&gt;(ODBCINI=/data/odbc.ini&lt;BR /&gt;ODBCSYSINI=/opt/sas/viya/home/lib64/accessclients/odbcinst.ini)&lt;/P&gt;&lt;P&gt;the result is :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;83         libname mydblib odbc dsn="MSSQL_DSN" user="XXX" password=XXXXXXXXXXXXXXX schema=dbo;
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Driver Manager Message file not found. Please check for the 
       value of InstallDir in your odbc.ini.
ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the custom ini we have the usual source info parameters plus&lt;/P&gt;&lt;P&gt;InstallDir=/opt/sas/viya/home/lib64/accessclients&lt;/P&gt;&lt;P&gt;Driver=/opt/sas/viya/home/lib64/accessclients/lib/S0sqls28.so&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why none of these approaches are working, or pointers to references which could help us move forward?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2025 21:06:22 GMT</pubDate>
    <dc:creator>RussL</dc:creator>
    <dc:date>2025-06-16T21:06:22Z</dc:date>
    <item>
      <title>How to connect to an external SQL Server from SAS Viya 4?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-to-connect-to-an-external-SQL-Server-from-SAS-Viya-4/m-p/969153#M2884</link>
      <description>&lt;P&gt;Hi group,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our team has set up the sas-analytics-pro docker container, release stable-2025.05.&amp;nbsp; This will be replacing SAS 9.4 on the Windows desktops.&amp;nbsp; Our current solution involves defining a user ODBC DSN in Windows and then running LIBNAME at the top of SAS programs (or at start-up) to define a library reference to the SQL Server where our main data mart resides.&amp;nbsp; We are experiencing difficulties in getting the equivalent approach to work in Viya..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within SAS Studio I have run &lt;EM&gt;proc setinit noalias&lt;/EM&gt;; and confirm that&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;---SAS/ACCESS Interface to Microsoft SQL Server&lt;/EM&gt; is installed.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using curl I confirmed network connectivity from the container to the SQL Server.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We see in&amp;nbsp;&lt;EM&gt;/opt/sas/viya/home/lib64/accessclients/odbcinst.ini&lt;/EM&gt; that&amp;nbsp;SAS ACCESS to MS SQL Server is installed, or at the least, the referenced library file exists.&lt;/P&gt;&lt;P&gt;All of our attempts to connect using various methods in documentation or found in Internet forums have failed, usually with a variation of a libname error, example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;83         libname sqlsrv odbc
84           noprompt=
85             "Driver=SAS ACCESS to MS SQL Server;
86              Host=xxxxxx;
87              Port=1433;
88              Database=yyyyyy;
89              Uid=uuu;
90              Pwd=ppp;"
91           schema=dbo;
ERROR: CLI error trying to establish connection: 523 630
ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or in the case of a custom odbc.ini, with environment variables set appropriately&lt;/P&gt;&lt;P&gt;(ODBCINI=/data/odbc.ini&lt;BR /&gt;ODBCSYSINI=/opt/sas/viya/home/lib64/accessclients/odbcinst.ini)&lt;/P&gt;&lt;P&gt;the result is :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;83         libname mydblib odbc dsn="MSSQL_DSN" user="XXX" password=XXXXXXXXXXXXXXX schema=dbo;
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Driver Manager Message file not found. Please check for the 
       value of InstallDir in your odbc.ini.
ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the custom ini we have the usual source info parameters plus&lt;/P&gt;&lt;P&gt;InstallDir=/opt/sas/viya/home/lib64/accessclients&lt;/P&gt;&lt;P&gt;Driver=/opt/sas/viya/home/lib64/accessclients/lib/S0sqls28.so&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why none of these approaches are working, or pointers to references which could help us move forward?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 21:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-to-connect-to-an-external-SQL-Server-from-SAS-Viya-4/m-p/969153#M2884</guid>
      <dc:creator>RussL</dc:creator>
      <dc:date>2025-06-16T21:06:22Z</dc:date>
    </item>
  </channel>
</rss>

