<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750440#M236051</link>
    <description>&lt;P&gt;You need to put a comma after the *.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 14:11:57 GMT</pubDate>
    <dc:creator>tarheel13</dc:creator>
    <dc:date>2021-06-25T14:11:57Z</dc:date>
    <item>
      <title>case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750386#M236033</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * case when sex='F' then  'Female'
else   'Male'  end as newvar from sashelp.class;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jun 2021 07:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750386#M236033</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-06-25T07:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750389#M236035</link>
      <description>&lt;P&gt;And your question is ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * case when sex='F' then  'Female'
else   'Male'  end as newvar from sashelp.class;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 08:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750389#M236035</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-25T08:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750390#M236036</link>
      <description>&lt;P&gt;Well, the OP has already posted a query...&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 08:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750390#M236036</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-06-25T08:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750393#M236038</link>
      <description>&lt;P&gt;Well, the syntax error is obvious (at least it must be for a poster with 400+ posts here), so it can't be that.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 08:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750393#M236038</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-06-25T08:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750440#M236051</link>
      <description>&lt;P&gt;You need to put a comma after the *.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 14:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750440#M236051</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-25T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750458#M236055</link>
      <description>&lt;P&gt;It just needs a comma after the asterisk.&amp;nbsp; Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     proc sql;
         select *, case when sex='F' then  'Female'
         else   'Male'  end as newvar from sashelp.class;
     quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;NOTE: PROCEDURE SQL used (Total process time):
      real time           0:00:00.04
      cpu time            0:00:00.03
      Timestamp           June 25, 2021 10:22:46&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;is quite correct in his assessment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 15:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750458#M236055</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-25T15:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750481#M236072</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * case when sex='F' then  'Female'
else   'Male'  end as newvar from sashelp.class;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You did read the log that clearly points out the error didn't you?&lt;/P&gt;
&lt;PRE&gt;215  proc sql;
216  select * case when sex='F' then  'Female'
              ----
              22
              76
ERROR 22-322: Syntax error, expecting one of the following: ',', FROM, INTO.

ERROR 76-322: Syntax error, statement will be ignored.

217  else   'Male'  end as newvar from sashelp.class;
218  quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

&lt;/PRE&gt;
&lt;P&gt;The underscores under CASE show &lt;STRONG&gt;where&lt;/STRONG&gt; the problem is and the error text says you are missing something like a comma.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/case-statement/m-p/750481#M236072</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-25T16:13:02Z</dc:date>
    </item>
  </channel>
</rss>

