<?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 use multiple if statements together to eliminate the correct people? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736934#M229692</link>
    <description>&lt;P&gt;So you want to keep all persons who answered 3 or 4 to &lt;EM&gt;at least one&lt;/EM&gt; of these questions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, a simple subsetting IF will do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if
  v483 in (3,4) or
  v493 in (3,4) or
  v503 in (3,4) or
  v513 in (3,4) or
  v523 in (3,4) or
  v533 in (3,4) or
  v543 in (3,4)
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Apr 2021 10:23:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-04-26T10:23:55Z</dc:date>
    <item>
      <title>How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736931#M229690</link>
      <description>&lt;P&gt;Hello, I have a question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with the Allbus 2004 (like a census) and Need to eliminate all People, who do not have children in the household. For that, I tried to use the following Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if v483 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then v483=.;
if v493 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then v493=.;
if v503 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then v503=.;
if v513 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then V513=.;
if v523 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then V523=.;
if v533 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then v533=.;
if v543 in (1 2 5 6 7 8 9 10 11 12 13 14 15 16 99) then v543=.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the codebook, the questions for These variable are roughly translated "what is the relation for Household member Number (and then it goes 2, 3, ... for every mentioned variable) to you"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what I wanted to do is eliminate all the People, who did not answer with 3 or 4 (3=biological and 4=adoptive). I do not know though, how to eliminate a Person that didn't answer 3 or 4 even once in all those variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Need to know now if 1. my logic is right in this Code and 2. how I can Kind of chain These together. Can I use "&amp;amp;" between each one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ask this because I am actually not sure if coding a missing will "eliminate" this Person all together, so that the people who didn't answer V483 with 3 or 4 will not even be there anymore to be coded by the next if-statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really hope, that the way I described my Problem made even a Little sense. At this Point I am so confused by my own logic that I wasn't even able to describe it in my native language to my professor. Thank you for your time and help in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 09:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736931#M229690</guid>
      <dc:creator>Ioannas</dc:creator>
      <dc:date>2021-04-26T09:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736934#M229692</link>
      <description>&lt;P&gt;So you want to keep all persons who answered 3 or 4 to &lt;EM&gt;at least one&lt;/EM&gt; of these questions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, a simple subsetting IF will do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if
  v483 in (3,4) or
  v493 in (3,4) or
  v503 in (3,4) or
  v513 in (3,4) or
  v523 in (3,4) or
  v533 in (3,4) or
  v543 in (3,4)
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Apr 2021 10:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736934#M229692</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-26T10:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736939#M229694</link>
      <description>&lt;P&gt;Hello, thank you for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So do I mean I basically can copy your Code? Because I thought there has to be some Kind of consequence to the if-statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To eliminate everybody who hasn't answered with 3 or 4 at least once I can use the following code as it is right?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if
  v483 in (3,4) or
  v493 in (3,4) or
  v503 in (3,4) or
  v513 in (3,4) or
  v523 in (3,4) or
  v533 in (3,4) or
  v543 in (3,4)
then keep;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;will that eliminate all people who didn't answer with 3 or 4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 11:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736939#M229694</guid>
      <dc:creator>Ioannas</dc:creator>
      <dc:date>2021-04-26T11:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736943#M229695</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;then keep;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will cause an error in SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code presented by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;,&amp;nbsp;used exactly as he has written it, will cause the desired records to be kept and others deleted. When there is an IF but no THEN, that's what happens.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 11:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736943#M229695</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-26T11:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736954#M229697</link>
      <description>thank you so so much! you two helped me more than you know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/736954#M229697</guid>
      <dc:creator>Ioannas</dc:creator>
      <dc:date>2021-04-26T12:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use multiple if statements together to eliminate the correct people?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/737073#M229743</link>
      <description>&lt;P&gt;The construct I posted is called a Subsetting IF, which is documented &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lestmtsref/p1cxl8ifdt8u0gn12wqbji8o5fq1.htm" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 17:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-use-multiple-if-statements-together-to-eliminate-the/m-p/737073#M229743</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-26T17:59:07Z</dc:date>
    </item>
  </channel>
</rss>

