<?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: Result of When clause 2 is not the same data type as preceding results in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550475#M8806</link>
    <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making the change you provided cleared up the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Walt&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 23:50:25 GMT</pubDate>
    <dc:creator>wlierman</dc:creator>
    <dc:date>2019-04-11T23:50:25Z</dc:date>
    <item>
      <title>Result of When clause 2 is not the same data type as preceding results</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550460#M8802</link>
      <description>&lt;P&gt;I am trying to execute a query to search for keywords from ICD10 codes and receive the error written in the Subject line. My query follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Proc sql noprint;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Create table NCI_Out.Conditions_Flags As&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Select Distinct RecipientID,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ClaimType As Condition Label 'Condition',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Gender,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Medicare_status,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Month,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CASE&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Depress%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Depression'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_01,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Schizo%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Schizophrenia'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_02,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*BiPol%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'BiPolar'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_03,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Mood%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Mood_Disorder'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_04,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Anxiety%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Anxiety_Disorder'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_05,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Chemical%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Chemical_Dependence'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_06,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Opiate%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Chemical_Dependence'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_06a,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;When Primary_Dx_Desc Like '*Opiod%'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Then Condition = 'Chemical_Dependence'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Else ' '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;End As BI12_06b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;From NCI_Out.ICD10_Text_Check_ok&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Order by RecipientID, Month;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Quit;Proc sql noprint;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;I appreciate any help that is offered.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 22:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550460#M8802</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2019-04-11T22:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Result of When clause 2 is not the same data type as preceding results</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550466#M8804</link>
      <description>&lt;P&gt;It may help to show the entire Proc SQL &lt;STRONG&gt;from the log&lt;/STRONG&gt; along with all error messages or notes. Best is to copy from the log and paste into a code box opened using the forum's {I} or "running man" icon to preserver the formatting of any error messages. Many errors include indicators of where the problem was detected and the main message windows will reformat text moving the indicators.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 23:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550466#M8804</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-11T23:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Result of When clause 2 is not the same data type as preceding results</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550468#M8805</link>
      <description>&lt;P&gt;So the ELSE clause is specifying a character string, but after the THEN you have a boolean expression that is testing whether the variable&amp;nbsp;&lt;SPAN&gt;Condition has the value 'Depression' or not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume that you actually meant:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;when Primary_Dx_Desc like '*Depress%' then 'Depression'
else ' '
end as BI12_01&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2019 23:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550468#M8805</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-11T23:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Result of When clause 2 is not the same data type as preceding results</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550475#M8806</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making the change you provided cleared up the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Walt&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 23:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Result-of-When-clause-2-is-not-the-same-data-type-as-preceding/m-p/550475#M8806</guid>
      <dc:creator>wlierman</dc:creator>
      <dc:date>2019-04-11T23:50:25Z</dc:date>
    </item>
  </channel>
</rss>

