<?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: How to drop tables with same prefix witout a cicle? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616856#M180672</link>
    <description>&lt;P&gt;If the deletion is just a manual step (as opposed to a production program whose log must be clean), you can use a "large enough" end value (like 99) for the list of numeric suffixes. For each non-existing dataset in the list you will get a&lt;/P&gt;
&lt;PRE&gt;WARNING: File WORK.TABLETODROP_&lt;EM&gt;##&lt;/EM&gt;.DATA does not exist.&lt;/PRE&gt;
&lt;P&gt;in the log, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a clean log &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s suggested code using PROC DATASETS is a better solution in case of an unknown number of files to be deleted having the same prefix. With this procedure the prefix-colon abbreviation works as it does in other contexts (e.g. SET statement). And, no, it has nothing to do with dataset names containing a ":" -- colons in dataset names are &lt;EM&gt;always invalid&lt;/EM&gt;, even with the option setting VALIDMEMNAME=EXTEND (see&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n09kmm7ak4qq36n1632wrrndz7fc" target="_blank" rel="noopener"&gt;Summary of Extended Rules for Naming SAS Data Sets and SAS Variables&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 09:34:45 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-01-13T09:34:45Z</dc:date>
    <item>
      <title>How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616454#M180472</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;I was expecting someting like this:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; WORK.TABLETODROP_:;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Tables to be droped:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;TABLETODROP_1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;TABLETODROP_2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;TABLETODROP_3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;TABLETODROP_20&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Ana&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 13:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616454#M180472</guid>
      <dc:creator>AnaC</dc:creator>
      <dc:date>2020-01-10T13:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616456#M180474</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/239797"&gt;@AnaC&lt;/a&gt;&amp;nbsp; &amp;nbsp;Wow, I really like your thinking in wanting Proc SQL to be compatible with variable or dataset names lists. I'm afraid lists(shortened versions) do not work in Proc SQL. You would have to separate one by one with a comma in between. Nice try though! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can write a small macro to hold that list separated by ',' and call that in the drop table clause in Proc SQL&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 13:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616456#M180474</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-10T13:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616469#M180482</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/239797"&gt;@AnaC&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=n0u6bw4nz2vrvtn1xvnqeyf7l7wn.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;PROC DELETE&lt;/A&gt; can do this (not with a colon list, though):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc delete data=TABLETODROP_1-TABLETODROP_20;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 13:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616469#M180482</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-10T13:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616472#M180484</link>
      <description>&lt;P&gt;Trying to get SQL to act like SAS code is probably not a useful path to follow.&lt;/P&gt;
&lt;P&gt;I would think that PROC DELETE should allow this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc delete data=have: ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it doesn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However you can use to more cumbersome PROC DATASETS instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets nolist lib=work;
  delete have: ;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 13:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616472#M180484</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-10T13:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616850#M180667</link>
      <description>&lt;P&gt;A I haven't try this because it seams that is for when I have ":" in the table name and not when a have a lot of table with the same prefix. Am I understanding wrong this code?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 08:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616850#M180667</guid>
      <dc:creator>AnaC</dc:creator>
      <dc:date>2020-01-13T08:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616852#M180669</link>
      <description>Thanks, it works!! Now I don't need to type all the table names.&lt;BR /&gt;For know I know how many table a have but some times I might have 30 or 40. My initial ideia with the ":" would be to cover this situation.</description>
      <pubDate>Mon, 13 Jan 2020 08:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616852#M180669</guid>
      <dc:creator>AnaC</dc:creator>
      <dc:date>2020-01-13T08:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616856#M180672</link>
      <description>&lt;P&gt;If the deletion is just a manual step (as opposed to a production program whose log must be clean), you can use a "large enough" end value (like 99) for the list of numeric suffixes. For each non-existing dataset in the list you will get a&lt;/P&gt;
&lt;PRE&gt;WARNING: File WORK.TABLETODROP_&lt;EM&gt;##&lt;/EM&gt;.DATA does not exist.&lt;/PRE&gt;
&lt;P&gt;in the log, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a clean log &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s suggested code using PROC DATASETS is a better solution in case of an unknown number of files to be deleted having the same prefix. With this procedure the prefix-colon abbreviation works as it does in other contexts (e.g. SET statement). And, no, it has nothing to do with dataset names containing a ":" -- colons in dataset names are &lt;EM&gt;always invalid&lt;/EM&gt;, even with the option setting VALIDMEMNAME=EXTEND (see&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n09kmm7ak4qq36n1632wrrndz7fc" target="_blank" rel="noopener"&gt;Summary of Extended Rules for Naming SAS Data Sets and SAS Variables&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 09:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616856#M180672</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-13T09:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop tables with same prefix witout a cicle?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616860#M180675</link>
      <description>So with my data names I should writ something like:&lt;BR /&gt;proc datasets nolist lib=work;&lt;BR /&gt;delete tabletodrop: ;&lt;BR /&gt;run;quit;</description>
      <pubDate>Mon, 13 Jan 2020 09:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-drop-tables-with-same-prefix-witout-a-cicle/m-p/616860#M180675</guid>
      <dc:creator>AnaC</dc:creator>
      <dc:date>2020-01-13T09:58:57Z</dc:date>
    </item>
  </channel>
</rss>

