<?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 Syntax error while parsing WHERE clause. in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437892#M9488</link>
    <description>&lt;P&gt;I am getting this error:&amp;nbsp;Syntax error while parsing WHERE clause.&lt;/P&gt;&lt;P&gt;while running the below code, kindly help:&lt;/P&gt;&lt;P&gt;%macro abc;&lt;/P&gt;&lt;P&gt;data null;&lt;BR /&gt;set newdata;&lt;BR /&gt;%Do %until(100);&lt;BR /&gt;call symput ('SLP', SLP);&lt;BR /&gt;call execute&lt;BR /&gt;(&lt;BR /&gt;'proc imstat' || ' data = ' || ' LASRLIB.scans ' || ';' ||&lt;BR /&gt;'where ' || put(SCANDATE, date7.) || '=' || "07FEB19" || ';' ||&lt;BR /&gt;' run; ' ||&lt;BR /&gt;' deleterows / purge ;' ||&lt;BR /&gt;' run;'&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2018 06:27:11 GMT</pubDate>
    <dc:creator>jitinsethi07</dc:creator>
    <dc:date>2018-02-16T06:27:11Z</dc:date>
    <item>
      <title>Syntax error while parsing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437892#M9488</link>
      <description>&lt;P&gt;I am getting this error:&amp;nbsp;Syntax error while parsing WHERE clause.&lt;/P&gt;&lt;P&gt;while running the below code, kindly help:&lt;/P&gt;&lt;P&gt;%macro abc;&lt;/P&gt;&lt;P&gt;data null;&lt;BR /&gt;set newdata;&lt;BR /&gt;%Do %until(100);&lt;BR /&gt;call symput ('SLP', SLP);&lt;BR /&gt;call execute&lt;BR /&gt;(&lt;BR /&gt;'proc imstat' || ' data = ' || ' LASRLIB.scans ' || ';' ||&lt;BR /&gt;'where ' || put(SCANDATE, date7.) || '=' || "07FEB19" || ';' ||&lt;BR /&gt;' run; ' ||&lt;BR /&gt;' deleterows / purge ;' ||&lt;BR /&gt;' run;'&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 06:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437892#M9488</guid>
      <dc:creator>jitinsethi07</dc:creator>
      <dc:date>2018-02-16T06:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error while parsing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437917#M9489</link>
      <description>&lt;P&gt;Well, your problem lies in:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;put(SCANDATE, date7.) =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When scandate is put into text, there will be a numeric as first character, this is not valid in SAS.&amp;nbsp; Maybe you mean:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'where "' || put(SCANDATE, date7.) || '"=' || "07FEB19" || ';' ||&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Although I really don't see why you have that code at all, there really is a better way than creating SLP macro variable and generating the proc imstat code 100 times - which is all that code is doing, there is nothing changing in the code as far as I can see any of the 100 iterations.&amp;nbsp; So does not make sense in any way.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 09:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437917#M9489</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-16T09:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error while parsing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437929#M9490</link>
      <description>&lt;P&gt;As a secondary issue, there is nothing about this %DO loop that causes it to execute 100 times.&amp;nbsp; It executes once per observation in NEWDATA.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's difficult to determine what you intended here by adding the %DO loop.&amp;nbsp; Perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set newdata (obs=100);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, note the possibility to simplify by combining a few character strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'="07FEB19"; run;'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, your intention may have been to combine more than that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'proc imstat data=LASRLIB.scans; where put(SCANDATE, date7.)="07FEB19"; run;'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some issues are not clear ... where did you intend to use &amp;amp;SLP?&amp;nbsp; Where does SCANDATE come from?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 10:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Syntax-error-while-parsing-WHERE-clause/m-p/437929#M9490</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-16T10:21:19Z</dc:date>
    </item>
  </channel>
</rss>

