<?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: If and Where in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517517#M139942</link>
    <description>Thankyou I included delete in the if then clause Appreciate it</description>
    <pubDate>Fri, 30 Nov 2018 15:32:32 GMT</pubDate>
    <dc:creator>Ranjeeta</dc:creator>
    <dc:date>2018-11-30T15:32:32Z</dc:date>
    <item>
      <title>If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517499#M139927</link>
      <description>&lt;P&gt;data stroke_onset;&lt;BR /&gt;set EVT.stroke_ischemic;&lt;BR /&gt;&lt;STRONG&gt;where SP340_ONSET IS NOT MISSING; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;where FIRST_ADM_TM&amp;gt;SP340_ONSET;&lt;/STRONG&gt;&lt;BR /&gt;by CIHI_KEY_DAD FIRST_ADM_TM;&lt;BR /&gt;Window1=(FIRST_ADM_TM-SP340_ONSET)/60;&lt;BR /&gt;length cat $100.;&lt;BR /&gt;if 0&amp;lt;=Window1&amp;lt;=360 then cat="0to6";&lt;BR /&gt;else if 360&amp;lt;Window1=&amp;lt;1440 then cat="6to24";&lt;BR /&gt;else if 1440&amp;lt;Window1 then cat = "&amp;gt;24";&lt;BR /&gt;&lt;STRONG&gt;else if missing (SP340_ONSET) then cat = "Stroke onset time missing";&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if FIRST_ADM_TM&amp;lt;SP340_ONSET then cat = "Stroke onset after First Admit Time";&lt;/STRONG&gt;&lt;BR /&gt;else cat='NA';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Hello Can someone advise how I would&amp;nbsp;write the above code i.e. using either the where or if clause to exclude the observations from the output for the bolded categories&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have stated in the if then conditions is what I want but now I want to exclude those observations from the output&lt;/P&gt;&lt;P&gt;Also did not want to combine the two where conditions using the and operator since I want to exclude observations for each condition applied separately. Do ijust use subsetting if statements&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 14:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517499#M139927</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-30T14:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517501#M139928</link>
      <description>&lt;P&gt;WHERE applies to source data.&lt;/P&gt;
&lt;P&gt;if you want to delete reservations based on if/assignment statements, you can include a DELETE statement, or an explicit OUTPUT for those observations you wish to save.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 15:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517501#M139928</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-11-30T15:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517505#M139932</link>
      <description>I basically did not want the observations for the two bolded if clauses included in stroke_onset dataset&lt;BR /&gt;then do I write the code as below:&lt;BR /&gt;else if missing (SP340_ONSET) then output Stroke onset time missing;</description>
      <pubDate>Fri, 30 Nov 2018 15:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517505#M139932</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-30T15:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517510#M139935</link>
      <description>&lt;P&gt;Only the last where condition will take effect, so you need to combine both into one with "and".&lt;/P&gt;
&lt;P&gt;Once that is done, the two bold else-if are not necessary any longer.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 15:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517510#M139935</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-30T15:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517517#M139942</link>
      <description>Thankyou I included delete in the if then clause Appreciate it</description>
      <pubDate>Fri, 30 Nov 2018 15:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517517#M139942</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-30T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: If and Where</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517518#M139943</link>
      <description>&lt;P&gt;if I include it using the an in the where then i am not getting the right result as both conditions are applied togetther whereas i wanted to apply both conditions seperately on the source data&lt;/P&gt;&lt;P&gt;Thankyou&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 15:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-and-Where/m-p/517518#M139943</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-30T15:33:43Z</dc:date>
    </item>
  </channel>
</rss>

