<?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: Deleting rows from datasets within a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784813#M250446</link>
    <description>&lt;P&gt;Thank you very much. It got the job done.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 03:17:51 GMT</pubDate>
    <dc:creator>nduksy</dc:creator>
    <dc:date>2021-12-08T03:17:51Z</dc:date>
    <item>
      <title>Deleting rows from datasets within a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784759#M250428</link>
      <description>&lt;P&gt;I want to delete all rows where the if statement is true for all datasets within a specific library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is what I have done thus far, the problem with this is that it fuses all the datasets into one. I want to still keep the datasets, but just delete all rows that meet the condition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data temp;
	set keep2.S:;
	if f1 =. and f2 =. then delete;
run;&lt;/PRE&gt;
&lt;P&gt;PS: Every dataset in the library starts with &lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 21:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784759#M250428</guid>
      <dc:creator>nduksy</dc:creator>
      <dc:date>2021-12-07T21:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting rows from datasets within a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784778#M250431</link>
      <description>&lt;P&gt;How about this? Sounds like you have an Excel file with some columns that aren't "empty".&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  a = 1; b = 2; f1 = 3; f2 = 4;
  output;
   a = 1; b = 2; f1 = .; f2 = .;
  output;
run;

proc sql;
create table members as 
select libname, memname
from dictionary.members
where libname = "WORK" and memtype = "DATA"
;
quit;

data _null_;
  set members;
  where libname = 'WORK';
  call execute ('data ' !! strip(libname) !! '.' !! memname !!
                '; set ' !! strip(libname) !! '.' !! memname !!'; if f1 = . and f2 = . then delete; run;'); 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Dec 2021 22:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784778#M250431</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-12-07T22:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting rows from datasets within a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784803#M250444</link>
      <description>&lt;P&gt;Thanks for your input. I have tried to substitute my values with your solution and I haven't gotten far.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table members as 
select libname, memname
from dictionary.members
where libname = "keep2" and memtype = "DATA"
;
quit;

data _null_;
  set members;
  where libname = 'keep2';
  call execute ('data ' !! strip(libname) !! '.' !! memname !!
                '; set ' !! strip(libname) !! '.' !! memname !!'; if f1 = . and f2= . then delete; run;'); 
run;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;ps: The name of the library that contains the datasets is called &lt;STRONG&gt;keep2.&amp;nbsp;&lt;/STRONG&gt;There are 50 datasets in the library and 23 of meet that condition (f1 and f2 are blank)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 01:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784803#M250444</guid>
      <dc:creator>nduksy</dc:creator>
      <dc:date>2021-12-08T01:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting rows from datasets within a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784808#M250445</link>
      <description>&lt;P&gt;LIBNAMES need to be uppercase:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where libname = "KEEP2" and memtype = "DATA"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And remove the WHERE LIBNAME statement in this step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set members;
  where libname = 'keep2'; * &amp;lt;== remove this;
  call execute ('data ' !! strip(libname) !! '.' !! memname !!
                '; set ' !! strip(libname) !! '.' !! memname !!'; if f1 = . and f2= . then delete; run;'); 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 01:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784808#M250445</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-12-08T01:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting rows from datasets within a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784813#M250446</link>
      <description>&lt;P&gt;Thank you very much. It got the job done.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 03:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-rows-from-datasets-within-a-library/m-p/784813#M250446</guid>
      <dc:creator>nduksy</dc:creator>
      <dc:date>2021-12-08T03:17:51Z</dc:date>
    </item>
  </channel>
</rss>

