<?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: Case Expression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Case-Expression/m-p/487424#M127012</link>
    <description>&lt;P&gt;Well its either:&lt;/P&gt;
&lt;PRE&gt;case when cli in (4244,6454654) then 'Approved' end as status,&lt;/PRE&gt;
&lt;P&gt;Or:&lt;/P&gt;
&lt;PRE&gt;case when apps in (25,5) then 'In process' else 'other' end as req&lt;/PRE&gt;
&lt;P&gt;Or both.&amp;nbsp; Basically your comparing a variable of type numeric to character or vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you had provided either/or - test data in the form of a datastep, the actual log output, I could be more specific.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Aug 2018 14:06:00 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-16T14:06:00Z</dc:date>
    <item>
      <title>Case Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Expression/m-p/487420#M127010</link>
      <description>&lt;P&gt;Hello SAS Users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to submit&amp;nbsp;the following&amp;nbsp;case when expression and I get the error message that components are of different types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CREATE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;TABLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SELECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * ,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;CASE &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WHEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;CLI &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'4244'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'6454654'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;THEN&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'Approved'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;END &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; status,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;case &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;when&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;apps &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'25'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'5'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'In process'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'other'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; end &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; req &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.info&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Expression/m-p/487420#M127010</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2018-08-16T14:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Case Expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Expression/m-p/487424#M127012</link>
      <description>&lt;P&gt;Well its either:&lt;/P&gt;
&lt;PRE&gt;case when cli in (4244,6454654) then 'Approved' end as status,&lt;/PRE&gt;
&lt;P&gt;Or:&lt;/P&gt;
&lt;PRE&gt;case when apps in (25,5) then 'In process' else 'other' end as req&lt;/PRE&gt;
&lt;P&gt;Or both.&amp;nbsp; Basically your comparing a variable of type numeric to character or vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you had provided either/or - test data in the form of a datastep, the actual log output, I could be more specific.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Expression/m-p/487424#M127012</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-16T14:06:00Z</dc:date>
    </item>
  </channel>
</rss>

