<?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 do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks... in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34004#M8254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; UPCASE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 16:22:18 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-03-16T16:22:18Z</dc:date>
    <item>
      <title>How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33997#M8247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I delete all datasets in a library except those that contain, say, _MEANS2, in the dataset name ? &lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 14:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33997#M8247</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2012-03-16T14:05:15Z</dc:date>
    </item>
    <item>
      <title>How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33998#M8248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; If they started with _MEANS2 it would be really easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets library=... memtype=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; save _means2:;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For contains you will need to build the SAVE list from meta data DICTIONARY.MEMBERS perhaps.&amp;nbsp; Use SQL INTO macro variable and use macro variable in SAVE statement.&amp;nbsp; Easy enough.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 14:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33998#M8248</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-16T14:48:07Z</dc:date>
    </item>
    <item>
      <title>How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33999#M8249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Data_null_. And here is the code following his instruction:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select DISTINCT memname INTO :NAMES SEPARATED BY ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp; from dictionary.columns where libname='WORK' AND memname ? '_means2'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets library=WORK memtype=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; save &amp;amp;NAMES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I have use work library as an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/33999#M8249</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-16T15:06:22Z</dc:date>
    </item>
    <item>
      <title>How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34000#M8250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;ANOTHER WAY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MACRO WANT(LIB);&lt;BR /&gt;PROC SQL NOPRINT;&lt;BR /&gt;SELECT &lt;BR /&gt;&amp;nbsp;&amp;nbsp; COUNT(*) &lt;BR /&gt;&amp;nbsp; ,MEMNAME INTO : CONT,&amp;nbsp; : NAME &lt;BR /&gt;SEPARATED BY " "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;BR /&gt;DICTIONARY.TABLES&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;BR /&gt; UPCASE(LIBNAME) EQ "&amp;amp;LIB."&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MEMNAME NOT CONTAINS '_MEANS2';&lt;BR /&gt;&amp;nbsp; QUIT;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %DO %UNTIL (&amp;amp;CONT.);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC DATASETS LIB = &amp;amp;LIB. MEMTYPE = DATA NOLIST;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DELETE &amp;amp;NAME.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %END;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%MEND;&lt;/P&gt;&lt;P&gt;%WANT (WORK); &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34000#M8250</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-03-16T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34001#M8251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, data_null_; , Hai.kuo and Augusto for your quick and very helpful replies ! This is better than writing out the datasets in a Proc Delete and I also learnt something new. Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34001#M8251</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2012-03-16T15:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34002#M8252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you, Hai.kuo, for your reply. Although I had a lot of datasets in the work library with and without "_means2" in the dataset name, this code did not select anything into Names and so, in the next step the marco could not be resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34002#M8252</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2012-03-16T15:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34003#M8253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could we see your log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 15:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34003#M8253</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-16T15:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34004#M8254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; UPCASE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34004#M8254</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-16T16:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete all dataset in a library except those that contain, say, _MEANS2, in the dataset name ? Thanks...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34005#M8255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep! Most likely! Also make sure there is a blank in separated by ' '.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:26:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-delete-all-dataset-in-a-library-except-those-that/m-p/34005#M8255</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-16T16:26:27Z</dc:date>
    </item>
  </channel>
</rss>

