<?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: How to work properly with the if else statements in SAS EG? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683990#M36995</link>
    <description>&lt;P&gt;If column_x were actually a new variable then the values you would see would be "Fixed" and "Not f".&lt;/P&gt;
&lt;P&gt;If you do not explicitly set the length of a new variable then the first use will set the length. In this case that would be "Fixed" which is length 5. So "Not fixed" would be truncated to 5 characters.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 15:55:18 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-09-15T15:55:18Z</dc:date>
    <item>
      <title>How to work properly with the if else statements in SAS EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683971#M36993</link>
      <description>&lt;P&gt;With below code I tend to make a new column based on the values of an other column. When I click run and check the 'column_x' I see just the letter 'F' for criteria 'N' instead of the word `Fixed` and for the else I see just the letter 'N' instead of 'Not fixed'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
set have;
if index(criteria,'N') then colum_x= "Fixed";
else column_x= "Not fixed";
run;&lt;/PRE&gt;
&lt;P&gt;It seems like its just taking the first letters inside the parenthesis. Why is that and how can I fix it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 14:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683971#M36993</guid>
      <dc:creator>AK100</dc:creator>
      <dc:date>2020-09-15T14:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to work properly with the if else statements in SAS EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683974#M36994</link>
      <description>&lt;P&gt;This happens because your new variable isn't really new.&amp;nbsp; HAVE already contains COLUMN_X (or perhaps COLUM_X, whichever spelling you are using) and it has a defined length of $1.&amp;nbsp; You can change that by adding a LENGTH statement before the SET statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
length column_x $ 9;
set have;
if index(criteria,'N') then column_x= "Fixed";
else column_x= "Not fixed";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 14:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683974#M36994</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-09-15T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to work properly with the if else statements in SAS EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683990#M36995</link>
      <description>&lt;P&gt;If column_x were actually a new variable then the values you would see would be "Fixed" and "Not f".&lt;/P&gt;
&lt;P&gt;If you do not explicitly set the length of a new variable then the first use will set the length. In this case that would be "Fixed" which is length 5. So "Not fixed" would be truncated to 5 characters.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683990#M36995</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-15T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to work properly with the if else statements in SAS EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683998#M36996</link>
      <description>&lt;P&gt;Maxim 47.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-work-properly-with-the-if-else-statements-in-SAS-EG/m-p/683998#M36996</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-15T16:31:28Z</dc:date>
    </item>
  </channel>
</rss>

