<?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: How do I add multiple conditions to an IF statement when subsetting my data? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279075#M56215</link>
    <description>&lt;P&gt;haha that was really dumb of me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data keepca;&lt;BR /&gt;set allmergefinalanzio;&lt;BR /&gt;IF (description = "Comprehensive Assessment") OR (description="Comprehensive Ax - TM");&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2016 15:53:54 GMT</pubDate>
    <dc:creator>christinagting0</dc:creator>
    <dc:date>2016-06-21T15:53:54Z</dc:date>
    <item>
      <title>How do I add multiple conditions to an IF statement when subsetting my data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279071#M56213</link>
      <description>&lt;P&gt;I am trying to subset my data based on keeping observations that contain "Comprehensive Assessment" and "Comprehensive AX - TM" in the variable named Description&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code doesn't work when I do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data keepca;&lt;BR /&gt;set allmergefinalanzio;&lt;BR /&gt;IF (description = "Comprehensive Assessment") AND&amp;nbsp;(description = "Comprehensive Ax - TM");&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it does seem to work when I do just one qualifyer like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data keepca;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set allmergefinalanzio;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IF (description = "Comprehensive Assessment")&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I have multiple conditions in one if statement to subset my data? what am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks, new to sas!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279071#M56213</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-21T15:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple conditions to an IF statement when subsetting my data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279074#M56214</link>
      <description>&lt;P&gt;In any programming language, "and" is a logical and, meaning both parts of the condition need to be true so that the whole condition will resolve to true.&lt;/P&gt;
&lt;P&gt;What you are looking for is achieved by using "or" instead.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279074#M56214</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-21T15:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple conditions to an IF statement when subsetting my data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279075#M56215</link>
      <description>&lt;P&gt;haha that was really dumb of me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data keepca;&lt;BR /&gt;set allmergefinalanzio;&lt;BR /&gt;IF (description = "Comprehensive Assessment") OR (description="Comprehensive Ax - TM");&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-multiple-conditions-to-an-IF-statement-when/m-p/279075#M56215</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-21T15:53:54Z</dc:date>
    </item>
  </channel>
</rss>

