<?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: What are the errors in these codes? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556100#M9764</link>
    <description>&lt;P&gt;Did you try running any of the code to see if you get error messages?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where to initial values for A and B come from in the first data step?&lt;/P&gt;
&lt;P&gt;Similar in the second plus the LABEL statement is not conditional and depending on what was intended there could be several logic errors other than the syntax issues assignment and such.&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2019 20:44:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-05-03T20:44:34Z</dc:date>
    <item>
      <title>What are the errors in these codes?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556096#M9761</link>
      <description>&lt;P&gt;&lt;STRONG&gt;a)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;if a &amp;gt;= b then c=&lt;STRONG&gt;0&lt;/STRONG&gt;;;&lt;/P&gt;&lt;P&gt;else c=-&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;b)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;if a &amp;gt;= b then label dob="date of birth";&lt;/P&gt;&lt;P&gt;else label dob="date of death";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 19:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556096#M9761</guid>
      <dc:creator>dentrix</dc:creator>
      <dc:date>2019-05-03T19:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: What are the errors in these codes?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556100#M9764</link>
      <description>&lt;P&gt;Did you try running any of the code to see if you get error messages?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where to initial values for A and B come from in the first data step?&lt;/P&gt;
&lt;P&gt;Similar in the second plus the LABEL statement is not conditional and depending on what was intended there could be several logic errors other than the syntax issues assignment and such.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 20:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556100#M9764</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-03T20:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: What are the errors in these codes?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556105#M9766</link>
      <description>&lt;P&gt;These questions are meant to make you think by yourself, not to test your ability to survey others. What do YOU understand about these codes?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 21:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556105#M9766</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-05-03T21:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: What are the errors in these codes?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556106#M9767</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regardless the fact that you didn't initialized variables, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;pointed out, reasons seems to be as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a) - double semicolon after "if-then" part - it should be 1 (one) semicolon there, with two(;;) sas thinks that you have an empty statement there (second semicolon) and it throws an syntax error on the "else" part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;b)&amp;nbsp; - as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;pointed out, Label is not execution time statement but compilation time one. Try to test following code (which from the execution time point of view reduces to "empty" do-end block):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  if a &amp;gt;= b then do; label dob="date of birth"; end;
            else do; label dob="date of death"; end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;all the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 21:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-are-the-errors-in-these-codes/m-p/556106#M9767</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-05-03T21:19:48Z</dc:date>
    </item>
  </channel>
</rss>

