<?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: Error trapping for presence of table within an Access DB accessed through ODBC in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115002#M1261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that your ODBC library has libname="T", you can check for the presence of table "Test" like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select sum(upcase(memname)="TEST") into :testPresent &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;from dictionary.tables&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;where libname="T"; /* use uppercase */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;%put Present: &amp;amp;testPresent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;dictionary.tables is dynamic, i.e. it reflects the current state of the database in real time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Jul 2012 18:22:20 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-07-21T18:22:20Z</dc:date>
    <item>
      <title>Error trapping for presence of table within an Access DB accessed through ODBC</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115001#M1260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know how I can check for the presence of particular table within an Access DB from within my SAS code?&amp;nbsp; If you know of any other error checking I should do ivolving working with an Accdess Database in SAS, I would appreciate knowing that too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks in advance for your time and help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2012 17:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115001#M1260</guid>
      <dc:creator>pharmKitty</dc:creator>
      <dc:date>2012-07-21T17:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error trapping for presence of table within an Access DB accessed through ODBC</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115002#M1261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that your ODBC library has libname="T", you can check for the presence of table "Test" like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select sum(upcase(memname)="TEST") into :testPresent &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;from dictionary.tables&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;where libname="T"; /* use uppercase */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;%put Present: &amp;amp;testPresent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;dictionary.tables is dynamic, i.e. it reflects the current state of the database in real time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2012 18:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115002#M1261</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-07-21T18:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error trapping for presence of table within an Access DB accessed through ODBC</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115003#M1262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below code is what SAS DI Studio generates for such a test:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%let etls_tableExist = %eval(%sysfunc(exist(&lt;/STRONG&gt;&amp;lt;libref&amp;gt;.&amp;lt;table&amp;gt;,&lt;STRONG&gt; DATA)) or&amp;nbsp;&amp;nbsp; %sysfunc(exist(&lt;/STRONG&gt;&amp;lt;libref&amp;gt;.&amp;lt;table&amp;gt;&lt;STRONG&gt;, VIEW)));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;etls_tableExist is '0' if the table/view does not exist and '1' if the table/view exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pre-condition for this code to work is of course that you've issue a libname statement using the ODBC engine.&lt;/P&gt;&lt;P&gt;If you're just using SQL pass-through and there is no libname defined at all then you would also have to write some SQL pass-through code querying the dictionary tables on the DB side to determine if a table exists or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2012 10:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115003#M1262</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-07-22T10:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error trapping for presence of table within an Access DB accessed through ODBC</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115004#M1263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG, Thank you &lt;SPAN style="text-decoration: underline;"&gt;very&lt;/SPAN&gt; much for your fast reply.&amp;nbsp; I will try your solution Monday when I get to work. Then I will mark correct/helpful.&amp;nbsp; My home SAS has expired &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2012 15:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115004#M1263</guid>
      <dc:creator>pharmKitty</dc:creator>
      <dc:date>2012-07-22T15:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error trapping for presence of table within an Access DB accessed through ODBC</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115005#M1264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, thanks very much for your reply.&amp;nbsp; I do want to test whether the table exists to determine what will happen next so I really like this answer a lot.&amp;nbsp; I can't wait to get to work tomorrow to try this out.&amp;nbsp; Thanks also for such a detailed explanation!&amp;nbsp; I will mark as helpful/correct tomorrow after I try both these solutions out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2012 15:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Error-trapping-for-presence-of-table-within-an-Access-DB/m-p/115005#M1264</guid>
      <dc:creator>pharmKitty</dc:creator>
      <dc:date>2012-07-22T15:17:43Z</dc:date>
    </item>
  </channel>
</rss>

