<?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 Observations with Conditions in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/844013#M36653</link>
    <description>&lt;P&gt;can you post your data?&lt;/P&gt;</description>
    <pubDate>Sun, 13 Nov 2022 16:35:22 GMT</pubDate>
    <dc:creator>tarheel13</dc:creator>
    <dc:date>2022-11-13T16:35:22Z</dc:date>
    <item>
      <title>Deleting Observations with Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/843981#M36650</link>
      <description>&lt;P&gt;Not sure how to write this code. I am trying to answer this question:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Remove from the data set any observations where the date of delivery was recorded as before the date of admission to the hospital or after the date of discharge from the hospital.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When I use this code it says I have no observations:&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;date2 =&amp;nbsp;date&amp;nbsp;of&amp;nbsp;delivery&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;date1 =&amp;nbsp;date&amp;nbsp;of&amp;nbsp;admission&amp;nbsp;to&amp;nbsp;the&amp;nbsp;hospital&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;dod =&amp;nbsp;date&amp;nbsp;of&amp;nbsp;discharge&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data dil_merge;
merge hw6.dil1 hw6.dil2_temp; 
by MEDRNO;
if xwtgainlb &amp;gt; 60 then delete; 
if xwtgainlb &amp;lt; 60 then delete; 
if date2 &amp;lt; date1 then delete; 
if date2 &amp;gt; dod then delete; 
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2022 03:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/843981#M36650</guid>
      <dc:creator>MisterJenn</dc:creator>
      <dc:date>2022-11-13T03:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Observations with Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/843986#M36651</link>
      <description>&lt;P&gt;What are the values in xwtgainlb? Only &lt;EM&gt;exact&lt;/EM&gt; values of 60 will not be deleted by your first two IFs.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2022 06:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/843986#M36651</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-13T06:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Observations with Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/844013#M36653</link>
      <description>&lt;P&gt;can you post your data?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2022 16:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/844013#M36653</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-11-13T16:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Observations with Conditions</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/844027#M36656</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;A quick question: Does the code without the last to if clauses meet your expectations?&lt;/P&gt;
&lt;P&gt;i.e. does the code:&lt;/P&gt;
&lt;PRE&gt;data dil_merge;
merge hw6.dil1 hw6.dil2_temp; 
by MEDRNO;
if xwtgainlb &amp;gt; 60 then delete; 
if xwtgainlb &amp;lt; 60 then delete; 
run; &lt;/PRE&gt;
&lt;P&gt;return the correct results.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, then you needed to check on xwtgainlb as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has already suggested.&lt;/P&gt;
&lt;P&gt;--fja&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2022 22:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-Observations-with-Conditions/m-p/844027#M36656</guid>
      <dc:creator>fja</dc:creator>
      <dc:date>2022-11-13T22:00:18Z</dc:date>
    </item>
  </channel>
</rss>

