<?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: Write Case Expression to recode variable values into a new column in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175240#M13462</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use IN operator.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CASE &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n IN ('Miscellaneous' , 'State Miscellaneous' , 'State Industrial') then 'Non-Safety'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; ELSE 'Safety'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;END&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2015 17:56:52 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-02-19T17:56:52Z</dc:date>
    <item>
      <title>Write Case Expression to recode variable values into a new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175239#M13461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm have a question on syntax here.&lt;/P&gt;&lt;P&gt;I want to classify each of seven variable values into one of two values and place the new values in a new column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have success with the following syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n = 'Miscellaneous' then 'Non-Safety'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n = 'State Miscellaneous' then 'Non-Safety'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n = 'State Industrial' then 'Non-Safety'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ELSE 'Safety'&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.5pt; font-family: 'Microsoft Sans Serif','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can I roll the conditions into one WHEN statement and one THEN statement, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n = ('Miscellaneous' or 'State Miscellaneous' or 'State Industrial') then 'Non-Safety'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ELSE 'Safety'&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work, but could it work with different syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Dru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 17:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175239#M13461</guid>
      <dc:creator>Dru</dc:creator>
      <dc:date>2015-02-19T17:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Write Case Expression to recode variable values into a new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175240#M13462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use IN operator.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CASE &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; WHEN t1.'MEMBER CATEGORY DESC'n IN ('Miscellaneous' , 'State Miscellaneous' , 'State Industrial') then 'Non-Safety'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; ELSE 'Safety'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;END&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 17:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175240#M13462</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-19T17:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Write Case Expression to recode variable values into a new column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175241#M13463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom, it worked perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 18:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Write-Case-Expression-to-recode-variable-values-into-a-new/m-p/175241#M13463</guid>
      <dc:creator>Dru</dc:creator>
      <dc:date>2015-02-19T18:06:49Z</dc:date>
    </item>
  </channel>
</rss>

