<?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 then conditional syntax errors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651909#M195638</link>
    <description>&lt;P&gt;You haven't posted neither the log nor sample of your imput,&lt;/P&gt;
&lt;P&gt;so it is impossible to know what is the mistake.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a variable&amp;nbsp; named GROUP in your input dataset ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 30 May 2020 02:44:53 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-05-30T02:44:53Z</dc:date>
    <item>
      <title>if then conditional syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651907#M195636</link>
      <description>&lt;P&gt;This should be fairly simple.&lt;/P&gt;&lt;P&gt;Trying to create a new variable for two groups separately.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For group a:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if diagn =0 or 1, then comorb=0;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if diagn &amp;gt;=2 then comorb=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For group b:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if diagn =0 then comorb=0;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if diagn &amp;gt;=1 then comorb=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The syntax for group2 works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my syntax for group1:&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;if group='a' then do;&lt;/P&gt;&lt;P&gt;if diagn =0 or diagn=1 then comorb=0;&lt;/P&gt;&lt;P&gt;else if diagn &amp;gt;=2 then comorb=1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This syntax does not calculate the comorb variable at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on what might be wrong and how to correct it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&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>Sat, 30 May 2020 02:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651907#M195636</guid>
      <dc:creator>NinaWestern</dc:creator>
      <dc:date>2020-05-30T02:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: if then conditional syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651908#M195637</link>
      <description>Can you create a sample dataset with what you HAVE? Then present another dataset with what you WANT. Look how some posters have done this in a datastep and show.&lt;BR /&gt;&lt;BR /&gt;If I were to take a wild guess, this condition is not met as specified.&lt;BR /&gt;if group='a' then do;&lt;BR /&gt;&lt;BR /&gt;Try specifying this as&lt;BR /&gt;if upcase(group)="A" then do;&lt;BR /&gt;</description>
      <pubDate>Sat, 30 May 2020 02:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651908#M195637</guid>
      <dc:creator>biopharma</dc:creator>
      <dc:date>2020-05-30T02:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: if then conditional syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651909#M195638</link>
      <description>&lt;P&gt;You haven't posted neither the log nor sample of your imput,&lt;/P&gt;
&lt;P&gt;so it is impossible to know what is the mistake.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a variable&amp;nbsp; named GROUP in your input dataset ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2020 02:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651909#M195638</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-05-30T02:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: if then conditional syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651910#M195639</link>
      <description>Yes, there is a variable named "group", with a and b as its values.&lt;BR /&gt;&lt;BR /&gt;The log has no errors.&lt;BR /&gt;</description>
      <pubDate>Sat, 30 May 2020 02:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651910#M195639</guid>
      <dc:creator>NinaWestern</dc:creator>
      <dc:date>2020-05-30T02:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: if then conditional syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651921#M195646</link>
      <description>&lt;P&gt;Please post the&amp;nbsp;&lt;EM&gt;whole&lt;/EM&gt; log of your data step.&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2020 03:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-conditional-syntax-errors/m-p/651921#M195646</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-30T03:53:59Z</dc:date>
    </item>
  </channel>
</rss>

