<?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 statement error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951549#M371953</link>
    <description>&lt;P&gt;Check all CASE expressions in your code. The SAS system does not issue this NOTE without cause.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 19:14:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2024-11-21T19:14:30Z</dc:date>
    <item>
      <title>Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951543#M371949</link>
      <description>I get this error in this portion of my code:&lt;BR /&gt;proc sql;&lt;BR /&gt;Create table test as&lt;BR /&gt;…,&lt;BR /&gt;(Case when Brangen = ‘1’ then ‘Gen’&lt;BR /&gt;when Brangen = ‘2’ then ‘Bran’&lt;BR /&gt;when Brangen = ‘3’ then ‘Undet’ else ‘E’ end ) as Flag&lt;BR /&gt;,&lt;BR /&gt;….&lt;BR /&gt;&lt;BR /&gt;The format of Brangen is character&lt;BR /&gt;How do I fix this error:&lt;BR /&gt;A case expression has no else clause, cases not accounted for by the when clauses will result in a missing value for the Case expression.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Nov 2024 18:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951543#M371949</guid>
      <dc:creator>SAS241</dc:creator>
      <dc:date>2024-11-21T18:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951546#M371951</link>
      <description>&lt;P&gt;That is not a SAS ERROR, it is a SAS NOTE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE &lt;BR /&gt;expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your program will continue to run OK. If you want to avoid these notes then just add an ELSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 19:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951546#M371951</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-11-21T19:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951547#M371952</link>
      <description>There is already an Else in my code</description>
      <pubDate>Thu, 21 Nov 2024 19:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951547#M371952</guid>
      <dc:creator>SAS241</dc:creator>
      <dc:date>2024-11-21T19:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951549#M371953</link>
      <description>&lt;P&gt;Check all CASE expressions in your code. The SAS system does not issue this NOTE without cause.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 19:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951549#M371953</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-11-21T19:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951556#M371956</link>
      <description>&lt;P&gt;There must be an issue with your syntax then. Please post your complete SAS log if you want further help.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 19:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951556#M371956</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-11-21T19:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Case statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951618#M371981</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/370627"&gt;@SAS241&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;There is already an Else in my code&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So either the ELSE is missing in a different CASE clause in your current query.&lt;/P&gt;
&lt;P&gt;Or your current query is exercising a VIEW that has the incomplete CASE clause.&amp;nbsp; Example:&lt;/P&gt;
&lt;PRE&gt;2634  proc sql;
2635  create view v1 as
2636    select *,case when sex='M' then 'Male' when sex='F' then 'Female' end as gender
2637    from sashelp.class
2638  ;
NOTE: SQL view WORK.V1 has been defined.
2639  select name,sex,gender from v1;
NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE
      expression.
&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2024 14:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-statement-error/m-p/951618#M371981</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-22T14:18:27Z</dc:date>
    </item>
  </channel>
</rss>

