<?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 condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360289#M84791</link>
    <description>&lt;P&gt;Are you mixing up CASE and IF statements?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If youre assigning variables using THEN put the assignment at the end rather than at the beginning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If &amp;lt;condition&amp;gt; then ffom = downfall;&lt;/P&gt;
&lt;P&gt;Else ffom = other variable;&lt;/P&gt;</description>
    <pubDate>Sun, 21 May 2017 08:00:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-05-21T08:00:10Z</dc:date>
    <item>
      <title>If condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360287#M84790</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks easy and i still do not know what is my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a new variable named FFOM. This variable will get value if founder (dummy variable 1/0) or secthird&amp;nbsp;&lt;SPAN&gt; (dummy variable 1/0) is 1 and FOWNFF (countinous variable) &amp;gt;0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is my code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Y210517; set sasuser.y2; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ffom = if founder eq 1 or secthird eq 1 and fownff gt 0 then fownff; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log I got is:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8976i66460D99228A7A38/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="SAS 2105.png" title="SAS 2105.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any clue...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 07:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360287#M84790</guid>
      <dc:creator>yael</dc:creator>
      <dc:date>2017-05-21T07:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: If condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360289#M84791</link>
      <description>&lt;P&gt;Are you mixing up CASE and IF statements?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If youre assigning variables using THEN put the assignment at the end rather than at the beginning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If &amp;lt;condition&amp;gt; then ffom = downfall;&lt;/P&gt;
&lt;P&gt;Else ffom = other variable;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 08:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360289#M84791</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-21T08:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: If condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360557#M84916</link>
      <description>&lt;P&gt;Hi, another idea ...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data y2;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;input founder secthird fownff @@; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;datalines;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;0 0 0 1 0 0 1 1 0 0 0 9 1 0 9 1 1 9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data y210517; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;set y2; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ffom = (founder | secthird) * fownff; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;DATA SET: y210517&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;founder secthird fownff ffom&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9 &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 21:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/360557#M84916</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-05-22T21:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: If condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/373446#M89345</link>
      <description>&lt;P&gt;Mike's idea is logically clear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or similar one like following in SAS. your statement is actually ambiguous.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_ffom = (founder eq 1 or secthird eq 1 and fownff gt 0 );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ffom=_ffom*fownff;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;simple is best.&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cheers.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 21:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-condition/m-p/373446#M89345</guid>
      <dc:creator>fy1</dc:creator>
      <dc:date>2017-07-05T21:30:53Z</dc:date>
    </item>
  </channel>
</rss>

