<?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 Delete a SAS dataset based on the values of one of the same dataset variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39351#M10179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Nikos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with help of so many people I came up with a macro. This macro will drop your dataset if you have a variable with all missing value. becareful if you are going to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; test(lib,dsn);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;select catx(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;'nmiss('&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,name,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;') as'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,name) into : list separated by &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;','&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; from dictionary.columns &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; where libname=&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;"%upcase(&amp;amp;lib)"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; and memname=&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;"%upcase(&amp;amp;dsn)"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;select count(*) into : nobs from &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 12pt;"&gt;lib.&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;create table temp as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; select &amp;amp;list from &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 12pt;"&gt;lib.&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;set temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;array _x{*} _numeric_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;do i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; to dim(_x);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; if _x{i} eq &amp;amp;nobs then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;'proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop table &amp;amp;lib..&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;&amp;nbsp; quit;'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;stop;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;(your_library,your_dateset)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;Linlin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2012 19:02:51 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2012-03-21T19:02:51Z</dc:date>
    <item>
      <title>How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39345#M10173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SAS dataset that I would like to delete when all the values of one of its variables are all missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be more than welcomed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nikos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 15:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39345#M10173</guid>
      <dc:creator>Nikos</dc:creator>
      <dc:date>2012-03-21T15:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39346#M10174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a SAS-L thread that addresses finding out if a variable only contains missing values. &lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1112B&amp;amp;L=sas-l&amp;amp;P=R15676&amp;amp;D=1&amp;amp;H=0&amp;amp;J=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=333745"&gt;http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1112B&amp;amp;L=sas-l&amp;amp;P=R15676&amp;amp;D=1&amp;amp;H=0&amp;amp;J=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=333745&lt;/A&gt;&lt;/P&gt;&lt;P&gt; Once you identify that the condition exists, deleteing the file can be accomplished in various ways (e.g., proc delete)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 15:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39346#M10174</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-21T15:46:20Z</dc:date>
    </item>
    <item>
      <title>How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39347#M10175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Use this macro. ds is the dataset name, nVar is the variable name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro delMiss(ds, mVar);&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select sum(&amp;amp;mVar is not missing) into :nMissNb from &amp;amp;ds;&lt;/P&gt;&lt;P&gt;%if &amp;amp;nMissNb = 0 %then drop table &amp;amp;ds.;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 15:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39347#M10175</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-03-21T15:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39348#M10176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Base on Ksharp 's code (sorry I can't find it right now), you can also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select catx(' ','nmiss(',name,') as',name) into : list separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp; from dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where libname='WORK' and memname='HAVE';&lt;/P&gt;&lt;P&gt; select count(*) into : nobs from have;&lt;/P&gt;&lt;P&gt; create table temp as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select &amp;amp;list from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; set temp;&lt;/P&gt;&lt;P&gt; length _list $ 4000;&lt;/P&gt;&lt;P&gt; array _x{*} _numeric_;&lt;/P&gt;&lt;P&gt; do i=1 to dim(_x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _x{i} eq &amp;amp;nobs then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('drop','have');&lt;/P&gt;&lt;P&gt; stop;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;drop table &amp;amp;drop;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code above can be easily translated into Macros.&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>Wed, 21 Mar 2012 15:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39348#M10176</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-21T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39349#M10177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Haikuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there should be an "end" after "stop", and "&lt;/P&gt;&lt;P&gt;length _list $ 4000;" should be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 16:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39349#M10177</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-03-21T16:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39350#M10178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. Thanks, Linlin, now you know I am a slacker.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 16:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39350#M10178</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-21T16:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a SAS dataset based on the values of one of the same dataset variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39351#M10179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Nikos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with help of so many people I came up with a macro. This macro will drop your dataset if you have a variable with all missing value. becareful if you are going to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; test(lib,dsn);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;select catx(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;'nmiss('&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,name,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;') as'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;,name) into : list separated by &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;','&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; from dictionary.columns &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; where libname=&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;"%upcase(&amp;amp;lib)"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; and memname=&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;"%upcase(&amp;amp;dsn)"&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;select count(*) into : nobs from &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 12pt;"&gt;lib.&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;create table temp as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; select &amp;amp;list from &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 12pt;"&gt;lib.&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;set temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;array _x{*} _numeric_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;do i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; to dim(_x);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp; if _x{i} eq &amp;amp;nobs then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;'proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop table &amp;amp;lib..&amp;amp;dsn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 12pt;"&gt;&amp;nbsp; quit;'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;stop;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 12pt; background-color: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;(your_library,your_dateset)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 12pt;"&gt;Linlin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 19:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Delete-a-SAS-dataset-based-on-the-values-of-one-of-the/m-p/39351#M10179</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-03-21T19:02:51Z</dc:date>
    </item>
  </channel>
</rss>

