<?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: Novice needs help with IF a=xx and/or b=yy and/or c=zz then ny_var=1, othervise ny_var=0 --&amp;gt; in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/438166#M28294</link>
    <description>&lt;P&gt;First step, run a PROC FREQ on the variables a, b, and c to be sure that you actually have the values you expect.&amp;nbsp; Your logic for creating MI depends on those, and looks like it should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A nice shortcut for the result you really want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MI = (a + b + c) &amp;gt;= 2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that is dependent on the logic being right ... a, b, and c should be variables with values of 0 or 1 only.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2018 15:27:32 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-02-17T15:27:32Z</dc:date>
    <item>
      <title>Novice needs help with IF a=xx and/or b=yy and/or c=zz then ny_var=1, othervise ny_var=0 --&gt; table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/438164#M28293</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am pretty much novice in SAS Enterprise Guide and I am facing a problem which I cannot resolve by myself.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I wrote this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test_new; set test;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if a=1 or b=1 or c=1 then MI=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;If MI=. or MI&amp;lt;1 then MI=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=MI;&lt;BR /&gt;tables&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MI*randomisation_code/chisq;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run the code, I only get the table with MI=0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I need the result for this:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;=1 and/or &lt;/SPAN&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;SPAN&gt;=1 and/or &lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt;=1 then &lt;/SPAN&gt;&lt;SPAN&gt;MI&lt;/SPAN&gt;&lt;SPAN&gt;=1; (at least two of the variables should mach together)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but cannot get it to work.&lt;BR /&gt;&lt;BR /&gt;I hope some of you can help me with advice what to do, in a step-by-step manner &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Mmignon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 15:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/438164#M28293</guid>
      <dc:creator>Mmignon</dc:creator>
      <dc:date>2018-02-17T15:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Novice needs help with IF a=xx and/or b=yy and/or c=zz then ny_var=1, othervise ny_var=0 --&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/438166#M28294</link>
      <description>&lt;P&gt;First step, run a PROC FREQ on the variables a, b, and c to be sure that you actually have the values you expect.&amp;nbsp; Your logic for creating MI depends on those, and looks like it should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A nice shortcut for the result you really want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MI = (a + b + c) &amp;gt;= 2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that is dependent on the logic being right ... a, b, and c should be variables with values of 0 or 1 only.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 15:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/438166#M28294</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-17T15:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Novice needs help with IF a=xx and/or b=yy and/or c=zz then ny_var=1, othervise ny_var=0 --&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/439737#M28408</link>
      <description>&lt;P&gt;Thank you very much for the shortcut &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;I found the solution by myself, but it's more elegant with your shortcut!&lt;BR /&gt;&lt;BR /&gt;Sincerely&lt;BR /&gt;Mmignon&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 15:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Novice-needs-help-with-IF-a-xx-and-or-b-yy-and-or-c-zz-then-ny/m-p/439737#M28408</guid>
      <dc:creator>Mmignon</dc:creator>
      <dc:date>2018-02-23T15:52:14Z</dc:date>
    </item>
  </channel>
</rss>

