<?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 Re: Example of DSN-less SQL Server connection from Linux in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349472#M10389</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;.&amp;nbsp; Worked like a charm from Windows but I think I'm going to submit to SAS tech support to ask about Linux.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I poked around a bit, and tried specifiying driver in different ways:&lt;/P&gt;
&lt;PRE&gt;  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=/sas/sas94/.../lib/S0sqls27.so;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=DataDirect 7.1 SQL Server Wire Protocol;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=SAS Institute, Inc 7.1 SQL Server Wire Protocol;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first two fail with:&lt;/P&gt;
&lt;PRE&gt;ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Data source name not found and no default driver specified&lt;/PRE&gt;
&lt;P&gt;The laset fails with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Specified driver could not be loaded&lt;/PRE&gt;
&lt;P&gt;So maybe that last one is close, and it's a problem with our odbinst.ini file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The docs state that complete= prompt= and required= are not supported on Unix, so&amp;nbsp;I suppose it's possible that noprompt= isn't supported either.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2017 14:21:19 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2017-04-12T14:21:19Z</dc:date>
    <item>
      <title>Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349245#M10386</link>
      <description>&lt;P&gt;If you have a successfull example of a DSN-less connection string used to connect to a MS SQL Server database from SAS 9.4 on a linux server,&amp;nbsp;could you please show me what it looks like?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a working explicit pass-through connection that uses a DSN, but would like to convert to DSN-less.&amp;nbsp; I've been playing with different permutations of complete= / noprompt= / required= etc, but don't even think I'm coming close.&amp;nbsp; Not even&amp;nbsp;sure what&amp;nbsp;to use for the driver name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We're running&amp;nbsp;9.4M3.&amp;nbsp; &amp;nbsp;I suspect the relevant part of the odbc.ini file are:&lt;/P&gt;
&lt;PRE&gt;[MYDATABASE]
Driver=/sas/sasinstall/AccessClients/9.4/SQLServer/lib/S0sqls27.so
Database=MY DATABASE
HostName=[ip address]
PortNumber=[port number]
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 20:01:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349245#M10386</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-04-11T20:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349265#M10387</link>
      <description>&lt;P&gt;Well, we use this approach exclusively but under Windows only. Here are examples that work for us. The first one uses Windows Authentication so I'd suggest starting with the second example which is pretty generic. Your Linux Administrator should be able to tell you the ODBC driver name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  connect to odbc (noprompt = "server=SQLServerName;DRIVER=SQL Server Native Client 11.0;Trusted_Connection=yes;DATABASE=MyDatabase;");
  connect to odbc (noprompt = "server=SQLServerName;DRIVER=SQL Server Native Client 11.0;Uid=myUsername;Pwd=myPassword;DATABASE=MyDatabase;");
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This link may also be helpful:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.connectionstrings.com/sql-server-native-client-11-0-odbc-driver/" target="_blank"&gt;https://www.connectionstrings.com/sql-server-native-client-11-0-odbc-driver/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 20:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349265#M10387</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-04-11T20:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349472#M10389</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;.&amp;nbsp; Worked like a charm from Windows but I think I'm going to submit to SAS tech support to ask about Linux.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I poked around a bit, and tried specifiying driver in different ways:&lt;/P&gt;
&lt;PRE&gt;  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=/sas/sas94/.../lib/S0sqls27.so;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=DataDirect 7.1 SQL Server Wire Protocol;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
  connect to sqlsvr (noprompt = "SERVER=MyServer;DRIVER=SAS Institute, Inc 7.1 SQL Server Wire Protocol;UID=MyUser;PWD=MyPwd;DATABASE=My Database;");
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first two fail with:&lt;/P&gt;
&lt;PRE&gt;ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Data source name not found and no default driver specified&lt;/PRE&gt;
&lt;P&gt;The laset fails with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Specified driver could not be loaded&lt;/PRE&gt;
&lt;P&gt;So maybe that last one is close, and it's a problem with our odbinst.ini file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The docs state that complete= prompt= and required= are not supported on Unix, so&amp;nbsp;I suppose it's possible that noprompt= isn't supported either.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 14:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349472#M10389</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-04-12T14:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349592#M10394</link>
      <description>&lt;P&gt;Yep, SAS Tech Support is a good move. It's unfortunate that the use of connection strings with SAS/ACCESS products is not well documented for all supported operating systems. Hunting around for answers is a frustrating exercise.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 20:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349592#M10394</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-04-12T20:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349599#M10395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This SGF paper may help you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings14/SAS039-2014.pdf" target="_self"&gt;An Insider's Guide to SAS/ACCESS Interface to ODBC&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The paper includes a trick that may allow you to pull the information for your DSN-less connection from a DSN connection. It is a pretty cool trick, but it doesn't work for ever ODBC driver.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using SAS/ACCESS Interface to ODBC or SAS/ACCESS Interface to Microsoft SQL Server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 20:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349599#M10395</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2017-04-12T20:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349815#M10397</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;.&amp;nbsp; I couldn't get that trick to work. I'm using SAS/ACCESS Interface to MS SQL Server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Got a good reponse to my tech support ticket.&amp;nbsp; They said yes, it should be workable from linux, and gave and example:&lt;/P&gt;
&lt;PRE&gt;libname sqwireno sqlsvr noprompt='Driver=SQLServer;Address=machine1.reg.company.com,1433;Database=users;UID=myuser;PWD=mypass;' schema=myschema;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also referred me to Step #8 of this note: &lt;A href="http://support.sas.com/kb/48/515.html&amp;nbsp;" target="_blank"&gt;http://support.sas.com/kb/48/515.html&amp;nbsp;&lt;/A&gt; Apparently the key point is to make sure those environment variables are set correctly, then make sure the odbcinst.ini file is configured correctly (see the full code tab), and use the driver name from the odbcinst.ini file in the connection string.&amp;nbsp; I haven't got it working yet, as I will need to get with an admin to monkey with the odbcinst.ini file, but looks promissing.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 17:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349815#M10397</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-04-13T17:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349919#M10401</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;many thanks for posting a connection example that works for Linux. That is very handy to know.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 00:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/349919#M10401</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-04-14T00:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Example of DSN-less SQL Server connection from Linux</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/440259#M13580</link>
      <description>&lt;P&gt;Hi, all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case you all were not able to get DSN-less connections working and need additional clarification, I have included a section from an email which I recently sent to a customer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what may throw some folks off is that Progress/Data Direct does DSN-less connections a bit differently than when using a unixODBC driver manager.&amp;nbsp; Whereas you can do DSN-less connections when using a unixODBC driver manager and not reference any INI files at all, Progress/Data Direct requires that you at least reference an odbcinst.ini file entry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="cs8A70F0C8"&gt;When doing DSN-less connections with Progress/Data Direct ODBC client components (we bundle these in with SAS ACCESS TO MS SQL Server), you do not have to have an odbc.ini file with DSN entries for SQL Server data bases but you must create an entry in an odbcinst.ini and you must set the ODBCINST environment to point to this odbcinst.ini file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;I have set up a test environment on a Linux server here and the following shows how I got this to work. &amp;nbsp;I have set things up so that I can use either reference DSNs in an odbc.ini file or do DSN-less connections.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;My odbc.ini file looks like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[ODBC Data Sources]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;sqlserver=SAS Institute, Inc 7.1.5 SQL Server Wire Protocol&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[ODBC]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;IANAAppCodePage=4&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;InstallDir=/users/sasswl/acc_mssql_dsnless/sqls715&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Trace=0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;TraceFile=/tmp/odbctrace.out&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;TraceDll=/users/sasswl/acc_mssql_dsnless/sqls715/lib/S0trc27.so&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[sqlserver]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Driver=/users/sasswl/acc_mssql_dsnless/sqls715/lib/S0sqls27.so&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Description=SAS Institute, Inc 7.1.5 SQL Server Wire Protocol&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;AnsiNPW=1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;AuthenticationMethod=1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Database=users&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;EnableQuotedIdentifiers=0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;HostName=blackfin.na.sas.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Language=&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;PortNumber=1433&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;My odbcinst.ini looks like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[ODBC_Drivers]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;sqlserver_dsnless=SAS Institute, Inc 7.1.5 SQL Server Wire Protocol&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[ODBC]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;#This section must contain values for DSN-less connections&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;#if no odbc.ini file exists. If an odbc.ini file exists,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;#the values from that [ODBC] section are used.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;[sqlserver_dsnless]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Driver=/users/sasswl/acc_mssql_dsnless/sqls715/lib/S0sqls27.so&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;I set ODBC-related environment variables in the sasenv_local file in the $SASROOT/bin directory on Linux like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;export ODBCHOME=/users/sasswl/acc_mssql_dsnless/sqls715&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;export ODBCINI=$ODBCHOME/odbc.ini&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;export ODBCINST=$ODBCHOME/odbcinst.ini&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;export LD_LIBRARY_PATH=$ODBCHOME/lib:$LD_LIBRARY_PATH&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;The following excerpt from my SAS Log shows how I can successfully use SAS ACCESS TO MS SQL SERVER to do either DSN or DSN-less connections in the same SAS session.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; 1? libname sqltest1 sqlsvr user=xxxx pw=xxxx dsn=sqlserver;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;NOTE: Libref SQLTEST1 was successfully assigned as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Engine: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLSVR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Physical Name: sqlserver&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; 2? libname sqltest2 sqlsvr noprompt="Driver=sqlserver_dsnless;AnsiNPW=1;AuthenticationMethod=1;Database=users;EnableQuotedIdentifiers=0;HostName=blackfin.na.sas.com;PortNumber=1433;UID=xxxx;PWD=xxxx";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;NOTE: Libref SQLTEST2 was successfully assigned as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Engine: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLSVR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Physical Name:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;NOTES:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;Again, I set things up so that I could do either DSN or DSN-less connections in the same SAS session.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs8A70F0C8"&gt;If you are only doing DSN-less connections, you could do away with the odbc.ini file altogether and only reference an odbcinst.ini file by only setting the ODBCINST environment variable...BUT the Progress/Data Direct driver manager relies on an [ODBC] stanza and if you are not referencing an odbc.ini (where you normally include this stanza) you must include this [ODBC] stanza in your odbcinst.ini file. &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 17:15:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Example-of-DSN-less-SQL-Server-connection-from-Linux/m-p/440259#M13580</guid>
      <dc:creator>SamLoflin</dc:creator>
      <dc:date>2018-02-26T17:15:18Z</dc:date>
    </item>
  </channel>
</rss>

