<?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 SAS to MS Access query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459120#M116576</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to figure out how to connect SAS to a query that is developed in MS access.&lt;/P&gt;&lt;P&gt;There is query in Access that uses a combination of tables and other queries to create a query that I need.&lt;/P&gt;&lt;P&gt;Now I was I found this site (&lt;A href="https://heuristically.wordpress.com/2010/06/04/sql-sas-access-2007-accdb/" target="_blank"&gt;https://heuristically.wordpress.com/2010/06/04/sql-sas-access-2007-accdb/&lt;/A&gt;) that shows me how to connect SAS to a table in MS access which worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how does one connect to a query in MS access?&lt;/P&gt;&lt;P&gt;Suggestions? links to articles that would help guide me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 21:26:48 GMT</pubDate>
    <dc:creator>sas_student1</dc:creator>
    <dc:date>2018-05-01T21:26:48Z</dc:date>
    <item>
      <title>How to connect SAS to MS Access query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459120#M116576</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to figure out how to connect SAS to a query that is developed in MS access.&lt;/P&gt;&lt;P&gt;There is query in Access that uses a combination of tables and other queries to create a query that I need.&lt;/P&gt;&lt;P&gt;Now I was I found this site (&lt;A href="https://heuristically.wordpress.com/2010/06/04/sql-sas-access-2007-accdb/" target="_blank"&gt;https://heuristically.wordpress.com/2010/06/04/sql-sas-access-2007-accdb/&lt;/A&gt;) that shows me how to connect SAS to a table in MS access which worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how does one connect to a query in MS access?&lt;/P&gt;&lt;P&gt;Suggestions? links to articles that would help guide me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 21:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459120#M116576</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2018-05-01T21:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect SAS to MS Access query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459149#M116586</link>
      <description>&lt;P&gt;If the approach in the referenced site worked for you to connect to a table then did you try replacing the name of the example table with the name of your query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the query is typical you may need put the name in quotes to handle long names with spaces and possibly set the VALIDMEMNAME=EXTEND option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to set the option VALIDVARNAME=ANY to get SAS to accept any spaces or odd characters in the query variable names.&lt;/P&gt;
&lt;P&gt;Code to use those names in SAS would then look like "Month total"n&amp;nbsp; (since space is not normally accepted as a variable name the Access variable/column&amp;nbsp;name would need quotes and the n immediately following tells SAS to treat as variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you have SAS/Access Interface to PC Files you may be able to get to the data with a libname statement.&lt;/P&gt;
&lt;P&gt;Which would look like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname yourlib "C:\pathtoaccessdatabase\MyDatabase.accdb";&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Libname yourlib&amp;nbsp;ACCESS Path=&amp;nbsp;"C:\pathtoaccessdatabase\MyDatabase.accdb";&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 23:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459149#M116586</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-01T23:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect SAS to MS Access query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459152#M116587</link>
      <description>&lt;P&gt;Ok, breaking it down &amp;amp; seeking clarification:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You want to access a Microsoft Access database. What version of SAS and/or Access products do you have?&lt;/LI&gt;
&lt;LI&gt;You want to execute an in-database query - that's an explicit SQL "execute" command.&lt;/LI&gt;
&lt;LI&gt;Your statement: &lt;EM&gt;"There is query in Access that uses a combination of tables and other queries to create a query"&lt;/EM&gt; - a query which creates a query, are you sure? I would have expected a query which creates/updates a table.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Depending on your product set and/or version, suggest you look at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://documentation.sas.com/?docsetId=acpcref&amp;amp;docsetTarget=titlepage.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;SAS/ACCESS® 9.4 Interface to PC Files: Reference, Fourth Edition&lt;/A&gt;&amp;nbsp;&lt;EM&gt;(if connecting via MS-Access)&lt;/EM&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=titlepage.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;SAS/ACCESS® 9.4 for Relational Databases: Reference, Ninth Edition&lt;/A&gt;&amp;nbsp;&lt;EM&gt;(if connecting via ODBC)&lt;/EM&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 01 May 2018 23:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459152#M116587</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2018-05-01T23:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect SAS to MS Access query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459445#M116698</link>
      <description>&lt;P&gt;OMG!! *face palm* a simple libname worked!!&lt;/P&gt;&lt;P&gt;it connected to the query in access and yielded the table I needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 17:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459445#M116698</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2018-05-02T17:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect SAS to MS Access query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459447#M116699</link>
      <description>&lt;P&gt;Thank you for your comment.&lt;/P&gt;&lt;P&gt;A simple libname worked and got what I needed.&lt;/P&gt;&lt;P&gt;To your question in 3, yes I am sure, I "inherited" this database in access and making heads and tails of it. I opened up one of the query in design view and was surprised to see that this one query was calling another query in and connecting to a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the libname to access the query in SAS and creating a table that I needed worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your assistance. The links were very useful and I will keep this as my reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 17:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-connect-SAS-to-MS-Access-query/m-p/459447#M116699</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2018-05-02T17:48:34Z</dc:date>
    </item>
  </channel>
</rss>

