<?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: Converting SQL code in to SAS 9.4 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548027#M151924</link>
    <description>&lt;P&gt;When mkt_name is null, then it also is not in ('TBC','Web')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your query is not doing something reasonable, and probably needs to be modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, the SAS syntax is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Case When mkt_name Is Null and mkt_name NOT In ('TBC','Web')&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 Apr 2019 19:48:14 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-04-02T19:48:14Z</dc:date>
    <item>
      <title>Converting SQL code in to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548025#M151922</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to re-work this Case When statement from SQL&amp;nbsp;for use in SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL / Example:&amp;nbsp; Sum(Case When IsNull(mkt_name,'') not in ('TBC', 'Web') then 1 else 0 end) as Cnt_Received_Branch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I think it should read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS / Solution:&amp;nbsp; Sum(Case When mkt_name Is Null and NOT In ('TBC','Web') then 1 else 0 end) as Cnt_Received&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However it is erroring out.&amp;nbsp; Any suggestions would be much appreciated.&amp;nbsp; I simply need the SAS equivalent&amp;nbsp;&amp;nbsp;for this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL / Example:&amp;nbsp; Sum(Case When IsNull(mkt_name,'') not in ('TBC', 'Web') then 1 else 0 end) as Cnt_Received_Branch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you SAS community,&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 19:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548025#M151922</guid>
      <dc:creator>15GreyGoose</dc:creator>
      <dc:date>2019-04-02T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQL code in to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548027#M151924</link>
      <description>&lt;P&gt;When mkt_name is null, then it also is not in ('TBC','Web')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your query is not doing something reasonable, and probably needs to be modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, the SAS syntax is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Case When mkt_name Is Null and mkt_name NOT In ('TBC','Web')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 19:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548027#M151924</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-02T19:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQL code in to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548030#M151927</link>
      <description>ISNULL() Is more like COALESCE() but not sure exactly how that's working here, but SQL dbs do differentiate between null and missing, whereas SAS does not, so you may want to clarify the logic around that function.</description>
      <pubDate>Tue, 02 Apr 2019 19:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548030#M151927</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-02T19:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQL code in to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548034#M151930</link>
      <description>&lt;P&gt;If this gives you the correct answer, it would certainly be easier to understand:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sum(Case When mkt_name in ('TBC', 'Web') then 0 else 1 end) as Cnt_Received_Branch&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 20:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-SQL-code-in-to-SAS-9-4/m-p/548034#M151930</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-02T20:05:05Z</dc:date>
    </item>
  </channel>
</rss>

