<?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 If condition error in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671010#M23350</link>
    <description>&lt;P&gt;I have two numeric variables with 1 and 0 as data points.&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;set new1;&lt;/P&gt;&lt;P&gt;if a=1 and b=0 then out="bad" else bad="good";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting below error:&lt;/P&gt;&lt;P&gt;Note: Invalid Numeric data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant change the dataset but how to change the code to handle this error&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 14:38:15 GMT</pubDate>
    <dc:creator>suresh123</dc:creator>
    <dc:date>2020-07-21T14:38:15Z</dc:date>
    <item>
      <title>If condition error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671010#M23350</link>
      <description>&lt;P&gt;I have two numeric variables with 1 and 0 as data points.&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;set new1;&lt;/P&gt;&lt;P&gt;if a=1 and b=0 then out="bad" else bad="good";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting below error:&lt;/P&gt;&lt;P&gt;Note: Invalid Numeric data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant change the dataset but how to change the code to handle this error&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671010#M23350</guid>
      <dc:creator>suresh123</dc:creator>
      <dc:date>2020-07-21T14:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: If condition error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671013#M23352</link>
      <description>&lt;P style="margin: 0in; margin-bottom: .0001pt; line-height: 15.75pt; background: white;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Arial',sans-serif; color: #333333;"&gt;Show us the log, including the entire DATA step code and all NOTES, WARNINGS and ERRORs for this DATA step. Do not chop anything out of the log.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; line-height: 15.75pt; background: white;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; line-height: 15.75pt; background: white;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Arial',sans-serif; color: #333333;"&gt;When providing the log, it is critical that you maintain the formatting of the log so we can see it exactly as SAS showed it to you, making it easier for us to use. To maintain the formatting of the log, click on the &amp;lt;/&amp;gt; icon and paste the log as text into the window that appears. DO NOT SKIP THIS STEP.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671013#M23352</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-21T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: If condition error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671031#M23354</link>
      <description>&lt;P&gt;Paste the lines from the log for the data step and the notes/errors. Make sure to use the Insert Code button (looks like &amp;lt; / &amp;gt; ) to get a pop-up window to paste the lines so they are not re-flowed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code at posted is missing a semi-colon.&amp;nbsp; It also looks strange as you are updating different variables in the THEN and ELSE clauses.&amp;nbsp; If the variable OUT is not already on the input dataset NEW1 then make sure to define it long enough to hold both values.&amp;nbsp; For example you could just add an extra space at the end of "bad " so that SAS sees you want room for 4 characters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
  set new1;
  if a=1 and b=0 then out="bad ";
  else out="good";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-condition-error/m-p/671031#M23354</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-21T15:00:24Z</dc:date>
    </item>
  </channel>
</rss>

