<?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 then else syntax, trying to create a binary column, but only getting a column fill with 0s. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439499#M4693</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am having a problem with a simple code. I am trying to use the if then else syntax but I feel like the else part is not been taken into account by SAS Studio. Here is the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data WORK.HEART_plus;&lt;BR /&gt;set WORK.HEART_complete;&lt;BR /&gt;if AgeCDHdiag = . then cat_AgeCDHdiag=0;&lt;BR /&gt;else cat_AgeCDHdiag=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The WORK.HEART_complete table comes from filtering the missing values of the smoking, weight, and cholesterol variables from the HEART table.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2018 22:35:03 GMT</pubDate>
    <dc:creator>luigipugliese</dc:creator>
    <dc:date>2018-02-22T22:35:03Z</dc:date>
    <item>
      <title>if then else syntax, trying to create a binary column, but only getting a column fill with 0s.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439499#M4693</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am having a problem with a simple code. I am trying to use the if then else syntax but I feel like the else part is not been taken into account by SAS Studio. Here is the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data WORK.HEART_plus;&lt;BR /&gt;set WORK.HEART_complete;&lt;BR /&gt;if AgeCDHdiag = . then cat_AgeCDHdiag=0;&lt;BR /&gt;else cat_AgeCDHdiag=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The WORK.HEART_complete table comes from filtering the missing values of the smoking, weight, and cholesterol variables from the HEART table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439499#M4693</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-02-22T22:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: if then else syntax, trying to create a binary column, but only getting a column fill with 0s.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439505#M4694</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195111"&gt;@luigipugliese&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not a guy so I guess I shouldn't answer your question?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check your log, there's likely a note about an variable not being initialized which points to a typo error. If not, post your full code and log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195111"&gt;@luigipugliese&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;I am having a problem with a simple code. I am trying to use the if then else syntax but I feel like the else part is not been taken into account by SAS Studio. Here is the code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WORK.HEART_plus;&lt;BR /&gt;set WORK.HEART_complete;&lt;BR /&gt;if AgeCDHdiag = . then cat_AgeCDHdiag=0;&lt;BR /&gt;else cat_AgeCDHdiag=1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The WORK.HEART_complete table comes from filtering the missing values of the smoking, weight, and cholesterol variables from the HEART table.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439505#M4694</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-22T22:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: if then else syntax, trying to create a binary column, but only getting a column fill with 0s.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439509#M4695</link>
      <description>sorry, just wanted to say hi in a general way. thanks for the reply.</description>
      <pubDate>Thu, 22 Feb 2018 22:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439509#M4695</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-02-22T22:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: if then else syntax, trying to create a binary column, but only getting a column fill with 0s.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439512#M4696</link>
      <description>&lt;P&gt;what does it mean when a variable is uninitialized? I think that is the only relevant note from the LOG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439512#M4696</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-02-22T22:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: if then else syntax, trying to create a binary column, but only getting a column fill with 0s.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439520#M4697</link>
      <description>&lt;P&gt;&lt;SPAN&gt;typo error -&amp;gt; you have the variable name wrong.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 23:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/if-then-else-syntax-trying-to-create-a-binary-column-but-only/m-p/439520#M4697</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-22T23:37:52Z</dc:date>
    </item>
  </channel>
</rss>

