<?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 statement will not become a variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484725#M6009</link>
    <description>As Tom suggested, the logic of your if/then is flawed.&lt;BR /&gt;&amp;gt;= 4 will give you 4 &amp;amp; 5&lt;BR /&gt;&amp;lt; 3 will never define 3&lt;BR /&gt;You need &amp;lt; 4 to complete the logic&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 07 Aug 2018 13:05:22 GMT</pubDate>
    <dc:creator>epniv</dc:creator>
    <dc:date>2018-08-07T13:05:22Z</dc:date>
    <item>
      <title>IF/THEN statement will not become a variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484546#M6007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a new variable from information already in my data set.&amp;nbsp; I used an if then statement to do so, however the code is reading but it will not make it a new variable in my data set.&amp;nbsp; When I try to use a Acecutoff variable later in my code, it tells me it is not found.&amp;nbsp; When I do proc print then it variable has a a triangle looking shape with an A inside of it, not a circle with a number let the rest.&amp;nbsp; It would be greatly appreciated if someone could tell me where I am going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data aces2;&lt;BR /&gt;	set b.aces;&lt;BR /&gt;&lt;BR /&gt;	if ACE_SCORE &amp;gt;=4.0 then&lt;BR /&gt;		Acecutoff="4 or greater";&lt;BR /&gt;	else if ACE_SCORE &amp;lt;3.0 then&lt;BR /&gt;		Acecutoff="less than 4";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484546#M6007</guid>
      <dc:creator>mj262716</dc:creator>
      <dc:date>2018-08-06T21:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: IF/THEN statement will not become a variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484548#M6008</link>
      <description>&lt;P&gt;Your code looks fine (other than not handling all possible values).&amp;nbsp; Are you sure you are looking at the right dataset? Did you check your log for errors?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aces ;
 id+1;
 input ace_score ;
cards;
1
2
3
4
5
;

data aces2;
 	set aces;
 	if ACE_SCORE &amp;gt;=4.0 then	Acecutoff="4 or greater";
 	else if ACE_SCORE &amp;lt;3.0 then	Acecutoff="less than 4";
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;              ace_
Obs    id    score     Acecutoff

 1      1      1      less than 4
 2      2      2      less than 4
 3      3      3
 4      4      4      4 or greater
 5      5      5      4 or greater&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484548#M6008</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-06T21:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: IF/THEN statement will not become a variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484725#M6009</link>
      <description>As Tom suggested, the logic of your if/then is flawed.&lt;BR /&gt;&amp;gt;= 4 will give you 4 &amp;amp; 5&lt;BR /&gt;&amp;lt; 3 will never define 3&lt;BR /&gt;You need &amp;lt; 4 to complete the logic&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Aug 2018 13:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/IF-THEN-statement-will-not-become-a-variable/m-p/484725#M6009</guid>
      <dc:creator>epniv</dc:creator>
      <dc:date>2018-08-07T13:05:22Z</dc:date>
    </item>
  </channel>
</rss>

