<?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 as the preceding results. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type-as-the/m-p/540301#M7206</link>
    <description>&lt;P&gt;Hi all, I am attempting to use Proc SQL to combine values (Total_XP_Made) of specific players (as each player has multiple observations within the data set) based on a dummy variable I have created along with it (Pre_or_post_change). Below is the code itself, let me know if additional information is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table KID1 as&lt;BR /&gt;select distinct a.player, a.pre_or_post_change, a.Total_XP_made,&lt;BR /&gt;(case&lt;BR /&gt;when a.pre_or_post_change = 0 then sum(a.Total_XP_Made)&lt;BR /&gt;else 'None'&lt;BR /&gt;end) as XpMade&lt;BR /&gt;from KickersInfoDiff as a&lt;BR /&gt;group by Player;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2019 01:18:25 GMT</pubDate>
    <dc:creator>Cfert13</dc:creator>
    <dc:date>2019-03-05T01:18:25Z</dc:date>
    <item>
      <title>ERROR: Result of WHEN clause 2 is not the same data type as the preceding results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type-as-the/m-p/540301#M7206</link>
      <description>&lt;P&gt;Hi all, I am attempting to use Proc SQL to combine values (Total_XP_Made) of specific players (as each player has multiple observations within the data set) based on a dummy variable I have created along with it (Pre_or_post_change). Below is the code itself, let me know if additional information is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table KID1 as&lt;BR /&gt;select distinct a.player, a.pre_or_post_change, a.Total_XP_made,&lt;BR /&gt;(case&lt;BR /&gt;when a.pre_or_post_change = 0 then sum(a.Total_XP_Made)&lt;BR /&gt;else 'None'&lt;BR /&gt;end) as XpMade&lt;BR /&gt;from KickersInfoDiff as a&lt;BR /&gt;group by Player;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 01:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type-as-the/m-p/540301#M7206</guid>
      <dc:creator>Cfert13</dc:creator>
      <dc:date>2019-03-05T01:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Result of WHEN clause 2 is not the same data type as the preceding results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type-as-the/m-p/540308#M7207</link>
      <description>&lt;P&gt;problem&amp;nbsp; is&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;(case&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when a.pre_or_post_change = 0 then sum(a.Total_XP_Made)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else 'None'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;you have&amp;nbsp;&amp;nbsp;sum(a.Total_XP_Made) and 'None' for same variable&amp;nbsp;XpMade, of which one value is numeric and another one is character&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try change 'None' to&amp;nbsp; .( a missvalue for numeric variable)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 03:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Result-of-WHEN-clause-2-is-not-the-same-data-type-as-the/m-p/540308#M7207</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-03-05T03:33:41Z</dc:date>
    </item>
  </channel>
</rss>

