<?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 Help with SAS case when condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149447#M11739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case when strip(col1) then "DIGIT" &lt;/P&gt;&lt;P&gt;when anyalpha( strip(col1)) then "ALPHA" &lt;/P&gt;&lt;P&gt;else "DIGIT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused about the first statement. Under what condition will it evaluate to 'DIGIT'? When col1 = null? I understand the second case....if col1 has an alphabet, it will evaluate to "ALPHA"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2014 19:17:42 GMT</pubDate>
    <dc:creator>eagles_dare13</dc:creator>
    <dc:date>2014-05-07T19:17:42Z</dc:date>
    <item>
      <title>Help with SAS case when condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149447#M11739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case when strip(col1) then "DIGIT" &lt;/P&gt;&lt;P&gt;when anyalpha( strip(col1)) then "ALPHA" &lt;/P&gt;&lt;P&gt;else "DIGIT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused about the first statement. Under what condition will it evaluate to 'DIGIT'? When col1 = null? I understand the second case....if col1 has an alphabet, it will evaluate to "ALPHA"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 19:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149447#M11739</guid>
      <dc:creator>eagles_dare13</dc:creator>
      <dc:date>2014-05-07T19:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS case when condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149448#M11740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eagles,&lt;/P&gt;&lt;P&gt;The Strip(function) works on character variables.&amp;nbsp; If you were to assume that any value that does not have an alpha, is a numeric, then this code should work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when&amp;nbsp; anyalpha( strip(col1)) then "ALPHA"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else "DIGIT" end as variable_type&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 19:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149448#M11740</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2014-05-07T19:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS case when condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149449#M11741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It makes very little sense to me. You don't say whether col1 is character or numeric, but when I try it with a numeric variable it fails with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Function STRIP requires a character expression as argument 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so we'll assume that col1 is character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's anything other than blank, the first when clause will be satisfied, and the result will be "DIGIT". If it's blank, the second when clause won't be satisfied, and it will fall through to the else clause, and the result will be "DIGIT".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't figure out how to get a result of "ALPHA"!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 21:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Help-with-SAS-case-when-condition/m-p/149449#M11741</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2014-05-07T21:24:32Z</dc:date>
    </item>
  </channel>
</rss>

