<?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 Why would SAS generate an error instead of a warning trying to drop a non existent Teradata table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825714#M326132</link>
    <description>&lt;P&gt;Hallo SAS Programmers, would anyone know why SAS would generate an error message instead of the usual warning message when attempting to drop a non existent Teradata table?&amp;nbsp; The code is existing code where this situation would have come up before but would have generated a warning message.&amp;nbsp; I've made the code and log generic but it follows the code I ran.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname mylib teradata user=( &amp;lt;connection to Teradata&amp;gt;);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;drop table mylib.mytable;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;create table mylib.mytable (FASTLOAD=YES) as&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;select distinct *&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;from work.mydata;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally this would generate a warning message if the Teradata table does not exist but the following was generated in the program output.&amp;nbsp; Any idea why it would be an ERROR and not just a WARNING that I would normally see when I attempt to delete a Teradata table that does not exist using the code format above.&amp;nbsp; I wasn't able to reproduce this error.&amp;nbsp; Successive attempts generated the warning message and no error message.&lt;/P&gt;&lt;P&gt;Thanks for any info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Teradata execute: Object 'tera_table.mytable' does not exist.&lt;BR /&gt;WARNING: Table mylib.mytable has not been dropped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 15:59:39 GMT</pubDate>
    <dc:creator>Maninspecs</dc:creator>
    <dc:date>2022-07-27T15:59:39Z</dc:date>
    <item>
      <title>Why would SAS generate an error instead of a warning trying to drop a non existent Teradata table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825714#M326132</link>
      <description>&lt;P&gt;Hallo SAS Programmers, would anyone know why SAS would generate an error message instead of the usual warning message when attempting to drop a non existent Teradata table?&amp;nbsp; The code is existing code where this situation would have come up before but would have generated a warning message.&amp;nbsp; I've made the code and log generic but it follows the code I ran.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname mylib teradata user=( &amp;lt;connection to Teradata&amp;gt;);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;drop table mylib.mytable;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;create table mylib.mytable (FASTLOAD=YES) as&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;select distinct *&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;from work.mydata;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally this would generate a warning message if the Teradata table does not exist but the following was generated in the program output.&amp;nbsp; Any idea why it would be an ERROR and not just a WARNING that I would normally see when I attempt to delete a Teradata table that does not exist using the code format above.&amp;nbsp; I wasn't able to reproduce this error.&amp;nbsp; Successive attempts generated the warning message and no error message.&lt;/P&gt;&lt;P&gt;Thanks for any info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Teradata execute: Object 'tera_table.mytable' does not exist.&lt;BR /&gt;WARNING: Table mylib.mytable has not been dropped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 15:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825714#M326132</guid>
      <dc:creator>Maninspecs</dc:creator>
      <dc:date>2022-07-27T15:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why would SAS generate an error instead of a warning trying to drop a non existent Teradata tabl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825724#M326138</link>
      <description>&lt;P&gt;First question would be what changed/different from the runs that generate a WARNING&lt;/P&gt;
&lt;P&gt;I suspect SAS is just passing back a message from Teradata, so maybe the Teradata version has changed and now passes back an error.&lt;/P&gt;
&lt;P&gt;Do you have a DROP that produces the WARNING to compare against&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 16:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825724#M326138</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-07-27T16:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why would SAS generate an error instead of a warning trying to drop a non existent Teradata tabl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825906#M326223</link>
      <description>Could you try Pass-through SQL ? Like&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to teradata..........&lt;BR /&gt;execute(&lt;BR /&gt;drop table ........&lt;BR /&gt;)&lt;BR /&gt;by teradata ;&lt;BR /&gt;quit;</description>
      <pubDate>Thu, 28 Jul 2022 12:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/825906#M326223</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-07-28T12:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why would SAS generate an error instead of a warning trying to drop a non existent Teradata tabl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/826154#M326326</link>
      <description>&lt;P&gt;Thanks everyone who responded.&amp;nbsp; I wasn't able to reproduce the issue using the suggestions provided.&amp;nbsp; My best guess is it was a one off resulting from weekend maintenance on SAS, Teradata or somewhere else.&amp;nbsp; I've got into the habit of using the macro below when writing new code or where I can easily include it with code updates.&amp;nbsp; I think I got it from a paper on lexjansen.com so thanks to the author.&amp;nbsp; It first checks whether a table or file exists, and only drops it, if it does exist.&amp;nbsp; This avoids generating unnecessary warning messages and presumably would have avoided the error message in my original post.&amp;nbsp; You can use this as accept as solution.&amp;nbsp; I don't seem to be able to do this for my own posts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Drop table macro to avoid warning message if table does not exist. Warning message will cause autosys run to fail */&lt;BR /&gt;%macro checkDrop(tmpData);&lt;BR /&gt;%if %SYSFUNC(exist(&amp;amp;tmpData))&lt;BR /&gt;%then %do;&lt;BR /&gt;proc sql;&lt;BR /&gt;drop table &amp;amp;tmpData;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend checkDrop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%checkDrop(mydb.mytable)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 12:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-would-SAS-generate-an-error-instead-of-a-warning-trying-to/m-p/826154#M326326</guid>
      <dc:creator>Maninspecs</dc:creator>
      <dc:date>2022-07-29T12:49:45Z</dc:date>
    </item>
  </channel>
</rss>

