<?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: SAS libname MS SQL server ODBC in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196299#M49089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2015 08:58:12 GMT</pubDate>
    <dc:creator>thetoddflatline</dc:creator>
    <dc:date>2015-08-12T08:58:12Z</dc:date>
    <item>
      <title>SAS libname MS SQL server ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196297#M49087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I've googled for a few days and can't get this working. Hopefully this is the correct forum.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I'm using SQL 2014 and the adventureworks database.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I've got SAS 9.3.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I've tried different ODBC settings, as in setting a default database, using Windows login, or SQL login. Different drivers. Still nothing, used complete and noprompt:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;libname mylib odbc complete='TrustedConnection=True;DSN=test2;SERVER=MYSERVER\SQLEXPRESS;DATABASE=AdventureWorks2012;'stringdates=yes; proc print data=mylib.Person;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;Error message:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;NOTE: Libref MYLIB was successfully assigned as follows: Engine: ODBC Physical Name: test2&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 5.48 seconds cpu time 0.34 seconds&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;700 proc print data=mylib.Person; ERROR: File MYLIB.Person.DATA does not exist&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I've tried with Person.Person and also in the connection string using schema=Person.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;However if I use the following it works. I put the default database in the ODBC:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;proc sql; connect to odbc as mycon (required = "dsn=awlt32;uid=sa;password=mypassword");&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;select * from connection to mycon (select * from Person.Person);&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;disconnect from mycon; quit;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;I know this is a super simple question but I can't seem to get it working, no matter what example code I find. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 06:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196297#M49087</guid>
      <dc:creator>thetoddflatline</dc:creator>
      <dc:date>2015-08-11T06:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname MS SQL server ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196298#M49088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this. You don't need to specifiy a DSN, you can define it all in the connection string. Note don't leave any more blanks in the NOPROMPT string than in my example otherwise it won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt; SQLSRVR &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;odbc&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;noprompt&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: Consolas; font-size: 9pt;"&gt;"server=MYSERVER\SQLEXPRESS;DRIVER=SQLServer Native Client 11.0;Trusted Connection=yes"&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;DATABASE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt; = AdventureWorks2012 &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;schema&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt; = dbo;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 19:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196298#M49088</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-08-11T19:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname MS SQL server ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196299#M49089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 08:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196299#M49089</guid>
      <dc:creator>thetoddflatline</dc:creator>
      <dc:date>2015-08-12T08:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname MS SQL server ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196300#M49090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert a blank between the string and stringdates=yes to avoid the note 49-169.&lt;/P&gt;&lt;P&gt;To test your libname, do&lt;/P&gt;&lt;P&gt;proc datasets library=mylib;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;and take a look at the output listing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 10:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196300#M49090</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-12T10:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname MS SQL server ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196301#M49091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had some success with the Native ODBC SQL Server Driver on SAS 9.3 (On Linux) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We do not use a Libname Statement for extracting data though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use this method to connect to MSSQL 2014 Server databases:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; connx=(dsn=&amp;lt;myODBC_DSN&amp;gt; user=&amp;lt;MYLOGIN&amp;gt; pwd=xxxxxxx);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;connect&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; odbc&amp;amp;connx;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; Test &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; connection to odbc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; [SQLDatabase]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;[dbo]&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;[MyTable]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;Disconnect&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; odbc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method is dependent on a ODNC.ini DSN entry, so you will need to make sure that you have a proper DSN in your ODBC.ini and ODBCINST.ini files on your Linux Server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 10:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-libname-MS-SQL-server-ODBC/m-p/196301#M49091</guid>
      <dc:creator>Lenvdb</dc:creator>
      <dc:date>2015-08-13T10:06:20Z</dc:date>
    </item>
  </channel>
</rss>

