<?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: IS NULL Syntax Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258621#M49857</link>
    <description>It's simply a syntax error. IS  NULL is not a function, it's a kind of operator. &lt;BR /&gt;I'm guessing that you might want the result that the coalesce function offers.</description>
    <pubDate>Wed, 23 Mar 2016 20:26:47 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-03-23T20:26:47Z</dc:date>
    <item>
      <title>IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258615#M49855</link>
      <description>&lt;P&gt;I am running the following proc sql code within base SAS 9.3. &amp;nbsp;However, I keep getting the error mentioned below. &amp;nbsp;Can someone offer some suggestions to fix the code in question please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;drop table AWM.temp4;&lt;BR /&gt;create table AWM.temp4 as&lt;BR /&gt;SELECT&lt;BR /&gt;DISTINCT r.*&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '35' THEN IS NULL(c.CreditScore,'0') END) AS TS&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '24' THEN IS NULL(c.CreditScore,'0') END) AS EX2&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '32' THEN IS NULL(c.CreditScore,'0') END) AS HF18&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '12' THEN IS NULL(c.CreditScore,'0') END) AS XPN1&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '20' THEN IS NULL(c.CreditScore,'0') END) AS JM1&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = '34' THEN IS NULL(c.CreditScore,'0') END) AS DMS2&lt;BR /&gt;FROM AWM.temp3 r&lt;BR /&gt;LEFT JOIN Portrevw.VwCreditScoreFact c&lt;BR /&gt;ON r.AccountDimId = c.AccountDimId&lt;BR /&gt;AND c.ScoreModelDimId IN (35,24,32,12,20,34)&lt;BR /&gt;AND c.ValidCalc = '1'&lt;BR /&gt;AND c.ScoreDt = (SELECT MAX(c1.ScoreDt)&lt;BR /&gt;FROM Portrevw.VwCreditScoreFact c1&lt;BR /&gt;JOIN AWM.Temp3 j1&lt;BR /&gt;ON c1.AccountDimId = j1.AccountDimId&lt;BR /&gt;WHERE c1.AccountDimId = c.AccountDimId&lt;BR /&gt;AND c1.ScoreModelDimId = c.ScoreModelDimId)&lt;BR /&gt;GROUP BY&lt;BR /&gt;r.debtdimid&lt;BR /&gt;,r.AccountDimId&lt;BR /&gt;,r.FDROpenDt;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR MESSAGE FROM LOG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;68 ,SUM(CASE WHEN ScoreModelDimId = '35' THEN IS NULL(c.CreditScore,'0') END) AS TS&lt;BR /&gt;----&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, /, &amp;lt;, &amp;lt;=,&lt;BR /&gt;&amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, BETWEEN, CONTAINS, ELSE, EQ, EQT, GE, GET, GT, GTT, LE, LET,&lt;BR /&gt;LIKE, LT, LTT, NE, NET, OR, WHEN, ^=, |, ||, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 20:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258615#M49855</guid>
      <dc:creator>awmeyertimmy</dc:creator>
      <dc:date>2016-03-23T20:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258621#M49857</link>
      <description>It's simply a syntax error. IS  NULL is not a function, it's a kind of operator. &lt;BR /&gt;I'm guessing that you might want the result that the coalesce function offers.</description>
      <pubDate>Wed, 23 Mar 2016 20:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258621#M49857</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-23T20:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258711#M49891</link>
      <description>&lt;P&gt;I guess you'll want to replace&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SUM(CASE WHEN ScoreModelDimId = '35' THEN IS NULL(c.CreditScore,'0') END) AS TS&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with either&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SUM( (ScoreModelDimId = '35') * coalesce(c.CreditScore, 0) ) AS TS

/* Or */

SUM(CASE WHEN ScoreModelDimId = '35' THEN c.CreditScore ELSE . END) AS TS&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would go for the CASE expression.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 02:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258711#M49891</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-24T02:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258821#M49939</link>
      <description>&lt;P&gt;GREAT! &amp;nbsp;Thanks much! &amp;nbsp; -Adam&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258821#M49939</guid>
      <dc:creator>awmeyertimmy</dc:creator>
      <dc:date>2016-03-24T14:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258912#M49979</link>
      <description>&lt;P&gt;My code just runs and runs when I use the following. &amp;nbsp;It should take less than a minute. &amp;nbsp;Any ideas why this keeps spinning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;Drop Table AWM.temp4;&lt;BR /&gt;create table AWM.temp4 as&lt;BR /&gt;SELECT&lt;BR /&gt;r.DebtDimId&lt;BR /&gt;,r.AccountDimId&lt;BR /&gt;,r.FDROpenDt&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 35 THEN c.CreditScore ELSE . END) AS TS&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 24 THEN c.CreditScore ELSE . END) AS EX2&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 32 THEN c.CreditScore ELSE . END) AS HF18&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 12 THEN c.CreditScore ELSE . END) AS XPN1&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 20 THEN c.CreditScore ELSE . END) AS JM1&lt;BR /&gt;,SUM(CASE WHEN ScoreModelDimId = 34 THEN c.CreditScore ELSE . END) AS DMS2&lt;BR /&gt;FROM AWM.temp3 r&lt;BR /&gt;LEFT JOIN Portrevw.VwCreditScoreFact c ON r.AccountDimId = c.AccountDimId&lt;BR /&gt;AND c.ScoreModelDimId IN (35,24,32,12,20,34)&lt;BR /&gt;AND c.ValidCalc = 1&lt;BR /&gt;AND c.scoredt = (SELECT MAX(c1.scoredt)&lt;BR /&gt;FROM Portrevw.VwCreditScoreFact c1&lt;BR /&gt;JOIN AWM.temp3 j1 ON c1.AccountDimId = j1.AccountDimId&lt;BR /&gt;WHERE c1.accountdimid = c.accountdimid&lt;BR /&gt;AND c1.ScoreModelDimId = c.ScoreModelDimId)&lt;BR /&gt;GROUP BY r.DebtDimId, r.AccountDimId, r.FDROpenDt;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/258912#M49979</guid>
      <dc:creator>awmeyertimmy</dc:creator>
      <dc:date>2016-03-24T18:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: IS NULL Syntax Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/259012#M50030</link>
      <description>&lt;P&gt;Without having your tables and data it is near impossible to precisely pinpoint your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having said that, if I was faced with a similar problem I would try removing parts of the query until it works to isolate where the problem. I'd start by taking out the SUM/CASE lines and put in a COUNT(*) instead. If that doesn't help I'd remove your sub-query which is where I suspect your problem could lie.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 03:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IS-NULL-Syntax-Error/m-p/259012#M50030</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-03-25T03:01:00Z</dc:date>
    </item>
  </channel>
</rss>

