<?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: Where condition as a Stored process argument in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84168#M3567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ! You guessed right. It works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2012 07:59:35 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2012-10-04T07:59:35Z</dc:date>
    <item>
      <title>Where condition as a Stored process argument</title>
      <link>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84166#M3565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a stored process (SP) which contains the following proc sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;SELECT NAME&lt;/P&gt;&lt;P&gt;FROM a.TABLE&lt;/P&gt;&lt;P&gt;WHERE NAME NOT IN (&amp;amp;cond);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;cond is dynamically determined by the calling SP and passed&lt;/P&gt;&lt;P&gt;through the URL :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SASStoredProcess/do?_program=/BIP Tree/ReportStudio/StoredProcesses/my_sp&amp;amp;cond="NAME1" "NAME2"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above sql procedure is not executed because of a syntax error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, -.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the log indicates that the macrovariable cond generates "NAME1" "NAME2" as wished.&lt;/P&gt;&lt;P&gt;Moreover, when I copy/paste the resolved proc sql displayed in the log in SAS and execute it, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;SELECT NAME FROM a.TABLE WHERE NAME NOT IN ("NAME1" "NAME2");&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get this proc to work ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 15:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84166#M3565</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2012-10-03T15:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition as a Stored process argument</title>
      <link>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84167#M3566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a guess, is it worth trying to use the &lt;SPAN style="font-family: 'courier new', courier;"&gt;%unquote()&lt;/SPAN&gt; function, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE NAME NOT IN (%unquote(&amp;amp;cond))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 16:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84167#M3566</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2012-10-03T16:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition as a Stored process argument</title>
      <link>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84168#M3567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ! You guessed right. It works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 07:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Where-condition-as-a-Stored-process-argument/m-p/84168#M3567</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2012-10-04T07:59:35Z</dc:date>
    </item>
  </channel>
</rss>

