<?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 How to Delete Multiple Observations in a SAS Data Set Using the _n_ Variable and In Statement Hi! I in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862402#M340657</link>
    <description>&lt;P class=""&gt;Hi! I am trying to delete rows in a SAS data set that does not have data in specific rows. Is it possible to do it by including the variable for the Obs column (i.e., the variable _n_)?&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I used the following Data Step, but it did not seem to work (rows 809-868 do not have data, and I am trying to delete those rows):&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;CODE class=""&gt;data two; set one; if _n_ &amp;gt;=809 or _n_&amp;lt;=868 then delete; run;&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Any input regarding this would be much appreciated!&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 03:21:00 GMT</pubDate>
    <dc:creator>JackZ295</dc:creator>
    <dc:date>2023-03-06T03:21:00Z</dc:date>
    <item>
      <title>How to Delete Multiple Observations in a SAS Data Set Using the _n_ Variable and In Statement Hi! I</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862402#M340657</link>
      <description>&lt;P class=""&gt;Hi! I am trying to delete rows in a SAS data set that does not have data in specific rows. Is it possible to do it by including the variable for the Obs column (i.e., the variable _n_)?&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I used the following Data Step, but it did not seem to work (rows 809-868 do not have data, and I am trying to delete those rows):&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;CODE class=""&gt;data two; set one; if _n_ &amp;gt;=809 or _n_&amp;lt;=868 then delete; run;&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Any input regarding this would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 03:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862402#M340657</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2023-03-06T03:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Multiple Observations in a SAS Data Set Using the _n_ Variable and In Statement Hi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862404#M340659</link>
      <description>&lt;P&gt;If you are wanting to delete rows in a certain range try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two; 
  set one; 
  if 809 &amp;lt;= _n_ &amp;lt;= 868 then delete; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2023 03:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862404#M340659</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-06T03:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Multiple Observations in a SAS Data Set Using the _n_ Variable and In Statement Hi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862405#M340660</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;! I realized that I could use the following code as well:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data two;
set one;
if _N_ in (809:868) then delete;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2023 03:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862405#M340660</guid>
      <dc:creator>JackZ295</dc:creator>
      <dc:date>2023-03-06T03:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete Multiple Observations in a SAS Data Set Using the _n_ Variable and In Statement Hi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862406#M340661</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213376"&gt;@JackZ295&lt;/a&gt;&amp;nbsp; - Now you've taught me a new method too!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 03:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Delete-Multiple-Observations-in-a-SAS-Data-Set-Using-the/m-p/862406#M340661</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-06T03:45:18Z</dc:date>
    </item>
  </channel>
</rss>

