<?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 Macro in base sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589397#M168583</link>
    <description>&lt;P&gt;proc sql;&lt;BR /&gt;select name into : table&lt;BR /&gt;from country.DETAIL&lt;BR /&gt;where ID = 34&lt;BR /&gt;and CD = "abc"&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select name into : table&lt;BR /&gt;from country.DETAIL&lt;BR /&gt;where ID = &amp;amp;first_id.&lt;BR /&gt;and CD = "abc"&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First query is running fine and second throwing error:&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT,&lt;BR /&gt;GE, GET, GROUP, GT, GTT, HAVING, LE, LET, LT, LTT, NE, NET, OR, ORDER, ^=, |, ||, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;can you please help why hard coding macro variable value is not giving any error but macro variable is giving error&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2019 15:26:27 GMT</pubDate>
    <dc:creator>kajal_30</dc:creator>
    <dc:date>2019-09-17T15:26:27Z</dc:date>
    <item>
      <title>Macro in base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589397#M168583</link>
      <description>&lt;P&gt;proc sql;&lt;BR /&gt;select name into : table&lt;BR /&gt;from country.DETAIL&lt;BR /&gt;where ID = 34&lt;BR /&gt;and CD = "abc"&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select name into : table&lt;BR /&gt;from country.DETAIL&lt;BR /&gt;where ID = &amp;amp;first_id.&lt;BR /&gt;and CD = "abc"&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First query is running fine and second throwing error:&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT,&lt;BR /&gt;GE, GET, GROUP, GT, GTT, HAVING, LE, LET, LT, LTT, NE, NET, OR, ORDER, ^=, |, ||, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;can you please help why hard coding macro variable value is not giving any error but macro variable is giving error&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 15:26:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589397#M168583</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2019-09-17T15:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589400#M168585</link>
      <description>&lt;P&gt;Ideally it should not give error, could you please check the if the macro variable first_id is having the values&lt;/P&gt;
&lt;P&gt;Please execute below code and check if it resolves to any value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;first_id;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 15:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589400#M168585</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-17T15:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589402#M168586</link>
      <description>&lt;P&gt;Please run the code again with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then post the&amp;nbsp;&lt;EM&gt;whole&lt;/EM&gt; log, using the {i} button.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 15:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589402#M168586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-17T15:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589408#M168587</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/259983"&gt;@kajal_30&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get this error if the macro variable &lt;EM&gt;first_id&lt;/EM&gt; exists, but is assigned an empty value. It resolves to blank in the select, and the where-statement becomes &lt;EM&gt;where ID = and CD = "abc"&lt;/EM&gt;, which is illegal syntax.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 16:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589408#M168587</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-09-17T16:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589458#M168602</link>
      <description>We can't see how &amp;amp;FIRST_ID was created.  If that was done using macro quoting functions, it may contain unprintable characters that SQL doesn't detect and remove in time.  If that's what happened,  you need to remove those characters yourself:&lt;BR /&gt;&lt;BR /&gt;where id = %unquote(&amp;amp;first_id.)</description>
      <pubDate>Tue, 17 Sep 2019 18:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-base-sas/m-p/589458#M168602</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-09-17T18:56:51Z</dc:date>
    </item>
  </channel>
</rss>

