<?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: Subsetting: If _ then delete, else don't do anything in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746361#M234128</link>
    <description>&lt;P&gt;Here's a simple example, just to illustrate:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input name $ age;
    datalines;
Allen 12
Bob 23
Charles 34
Doug 45
Edward 56
    ;
run;

title 'Before:';
proc print data=have; run;

data want;
    set have;
    if name = 'Bob' then delete;
run;

title 'After:';
proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Jun 2021 19:28:25 GMT</pubDate>
    <dc:creator>mklangley</dc:creator>
    <dc:date>2021-06-07T19:28:25Z</dc:date>
    <item>
      <title>Subsetting: If _ then delete, else don't do anything</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746350#M234119</link>
      <description>&lt;P&gt;I hope it is clear what I want to do without code:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a date set, and if one condition is true then I want to delete that row. If it is not true, then I don't want to do anything with the data, just let it be what it is.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How could I achieve this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 18:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746350#M234119</guid>
      <dc:creator>SasStatistics</dc:creator>
      <dc:date>2021-06-07T18:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting: If _ then delete, else don't do anything</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746353#M234122</link>
      <description>&lt;P&gt;Just like you wrote it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if /* condition */ then delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jun 2021 19:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746353#M234122</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-07T19:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting: If _ then delete, else don't do anything</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746361#M234128</link>
      <description>&lt;P&gt;Here's a simple example, just to illustrate:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input name $ age;
    datalines;
Allen 12
Bob 23
Charles 34
Doug 45
Edward 56
    ;
run;

title 'Before:';
proc print data=have; run;

data want;
    set have;
    if name = 'Bob' then delete;
run;

title 'After:';
proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jun 2021 19:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746361#M234128</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2021-06-07T19:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting: If _ then delete, else don't do anything</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746363#M234129</link>
      <description>&lt;P&gt;To use with a subsetting IF just invert the test.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   if name = 'Bob' then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is the same as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   if not (name = 'Bob') ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jun 2021 19:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-If-then-delete-else-don-t-do-anything/m-p/746363#M234129</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-07T19:34:10Z</dc:date>
    </item>
  </channel>
</rss>

