<?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: delete observations in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49129#M13331</link>
    <description>Also consider using a WHERE statement, if appropriate, for efficiency.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 15 Jul 2010 14:25:33 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-07-15T14:25:33Z</dc:date>
    <item>
      <title>delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49120#M13322</link>
      <description>Hello, First time here.  I have a data set where i would like to remove observations which equal a particular value of a variable.  Here's what i've got:&lt;BR /&gt;
&lt;BR /&gt;
data st.Def_2008;&lt;BR /&gt;
 delete all where (ResultType=77);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Here's the error i get:&lt;BR /&gt;
ERROR 79-322: Expecting a ;.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
Help?</description>
      <pubDate>Wed, 14 Jul 2010 06:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49120#M13322</guid>
      <dc:creator>CharlesR</dc:creator>
      <dc:date>2010-07-14T06:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49121#M13323</link>
      <description>You should read the "SAS 9.2 Language Reference: Concepts, Second Edition", especially the chapter about "DATA step concepts".&lt;BR /&gt;
&lt;BR /&gt;
Link: &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/titlepage.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/titlepage.htm&lt;/A&gt;</description>
      <pubDate>Wed, 14 Jul 2010 06:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49121#M13323</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2010-07-14T06:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49122#M13324</link>
      <description>&amp;gt; data st.Def_2008;&lt;BR /&gt;
&amp;gt;  delete all where (ResultType=77);&lt;BR /&gt;
&lt;BR /&gt;
Why not use 'not' operation symbol.&lt;BR /&gt;
&lt;BR /&gt;
data st.Def_2008;&lt;BR /&gt;
   where ResultType  ne 77 ;</description>
      <pubDate>Wed, 14 Jul 2010 11:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49122#M13324</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-14T11:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49123#M13325</link>
      <description>There definitely needs to be more substance to the DATA step - either a SET (providing an input SAS member) or some type of assignment statements to derive one or more SAS variables and then use an IF &lt;EXPRESSION&gt; THEN DELETE;  or some similar-result oriented coding technique.&lt;BR /&gt;
&lt;BR /&gt;
However, as was suggested, the SAS DOC and other supplemental technical reference material hosted at SAS.COM support website will be quite useful to the original poster.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/EXPRESSION&gt;</description>
      <pubDate>Wed, 14 Jul 2010 12:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49123#M13325</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-14T12:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49124#M13326</link>
      <description>Try sql instead:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 delete * &lt;BR /&gt;
 from st.Def_2008&lt;BR /&gt;
 where ResultType=77&lt;BR /&gt;
 ;&lt;BR /&gt;
quit;</description>
      <pubDate>Wed, 14 Jul 2010 12:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49124#M13326</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2010-07-14T12:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49125#M13327</link>
      <description>Thanks so much for all the help everyone!  Proc SQL seems like what I'm really looking for!  I have multiple situations to eliminate observations and it's what is easiest for me to get a handle on.</description>
      <pubDate>Wed, 14 Jul 2010 16:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49125#M13327</guid>
      <dc:creator>CharlesR</dc:creator>
      <dc:date>2010-07-14T16:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49126#M13328</link>
      <description>The equivalant DATA step logic is:&lt;BR /&gt;
&lt;BR /&gt;
data st.Def_2008;&lt;BR /&gt;
  set st.Def_2008;&lt;BR /&gt;
  if ResultType=77 then delete;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The advantage of the DATA step is you can do a lot more in the same step with only one pass of the data than you can in SQL, for example create more than one output dataset containing different results.</description>
      <pubDate>Wed, 14 Jul 2010 22:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49126#M13328</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-07-14T22:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49127#M13329</link>
      <description>Thanks . Sbb.&lt;BR /&gt;
There are more things i have to learn.And also forget SasKiwi's right code.:(</description>
      <pubDate>Thu, 15 Jul 2010 08:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49127#M13329</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-15T08:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49128#M13330</link>
      <description>Just try this code:&lt;BR /&gt;
&lt;BR /&gt;
data st.Def_2008; /*Destination dataset */&lt;BR /&gt;
set st.Def_2008; /*Source dataset*/&lt;BR /&gt;
if ResultType=77 then delete;&lt;BR /&gt;
&lt;BR /&gt;
It should delete that particular value from the dataset.</description>
      <pubDate>Thu, 15 Jul 2010 11:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49128#M13330</guid>
      <dc:creator>Anilsk</dc:creator>
      <dc:date>2010-07-15T11:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49129#M13331</link>
      <description>Also consider using a WHERE statement, if appropriate, for efficiency.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 15 Jul 2010 14:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49129#M13331</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-15T14:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: delete observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49130#M13332</link>
      <description>One advantage with proc sql is that index is kept and that you don't rewrite the table, useful when working with larga ds...</description>
      <pubDate>Fri, 16 Jul 2010 14:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-observations/m-p/49130#M13332</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2010-07-16T14:11:50Z</dc:date>
    </item>
  </channel>
</rss>

