<?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 ERROR: Result of WHEN clause 2 is not the same data type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type/m-p/514671#M138792</link>
    <description>&lt;P&gt;I'm receiving the error as &amp;nbsp;'ERROR: Result of WHEN clause 2 is not the same data type' while I tried to execute the following case when statement. Could you please help me understand the likely cause for this issue? Both the variables KHIREF and KHIREF1 are character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when KHIREF1 ne " " then KHIREF=KHIREF1 
else KHIREF 
end&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Nov 2018 05:36:33 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2018-11-20T05:36:33Z</dc:date>
    <item>
      <title>ERROR: Result of WHEN clause 2 is not the same data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type/m-p/514671#M138792</link>
      <description>&lt;P&gt;I'm receiving the error as &amp;nbsp;'ERROR: Result of WHEN clause 2 is not the same data type' while I tried to execute the following case when statement. Could you please help me understand the likely cause for this issue? Both the variables KHIREF and KHIREF1 are character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when KHIREF1 ne " " then KHIREF=KHIREF1 
else KHIREF 
end&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 05:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type/m-p/514671#M138792</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-11-20T05:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Result of WHEN clause 2 is not the same data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type/m-p/514673#M138793</link>
      <description>&lt;P&gt;In your case-expression KHIREF&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;KHIREF1 is a logical value (numeric). You probably want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when KHIREF1 ne " " then KHIREF1 
else KHIREF 
end&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 05:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type/m-p/514673#M138793</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-11-20T05:42:02Z</dc:date>
    </item>
  </channel>
</rss>

