<?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 for libname using macros in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214866#M5158</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am getting an error with the following statement. This statement is within a macro and is recalled in the later part of the code. Here is the log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro b;&lt;/P&gt;&lt;P&gt; data out.&amp;amp;l_datasetname.;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp; ERROR 201-322: The option is not recognized and will be ignored&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;The libname out was defined as follows: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt;libname out &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt;"&amp;amp;l_lib_out."&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Based on the error , I added the quotes but I still get the message. The rest of the code in the macro has some if then and do statements which also triggers as error such as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt; The %IF statement is not valid in open code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; But, i am not sure if the data statement is root cause of the error. Any help would be appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 May 2015 13:27:19 GMT</pubDate>
    <dc:creator>dr2014</dc:creator>
    <dc:date>2015-05-14T13:27:19Z</dc:date>
    <item>
      <title>Syntax error for libname using macros</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214866#M5158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am getting an error with the following statement. This statement is within a macro and is recalled in the later part of the code. Here is the log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro b;&lt;/P&gt;&lt;P&gt; data out.&amp;amp;l_datasetname.;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace'; color: #993300;"&gt;&amp;nbsp; ERROR 201-322: The option is not recognized and will be ignored&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;The libname out was defined as follows: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt;libname out &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt;"&amp;amp;l_lib_out."&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background: none repeat scroll 0% 0% white;"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Based on the error , I added the quotes but I still get the message. The rest of the code in the macro has some if then and do statements which also triggers as error such as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt; The %IF statement is not valid in open code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; But, i am not sure if the data statement is root cause of the error. Any help would be appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 13:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214866#M5158</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-05-14T13:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for libname using macros</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214867#M5159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does &amp;amp;l_dataset. resolve to?&amp;nbsp; In the code which is causing you the trouble, you use out as the library, then &amp;amp;l_datasetname. is being resolved to what text?&amp;nbsp; Use options mlogic, mprint, symbolgen and see what the value is.&amp;nbsp; Maybe your missing a parameter to the macro, or maybe your macro variable's scope is not in that macro call, or maybe that variable is not present or invalid.&amp;nbsp; It should resolve to a valid SAS dataset name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 13:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214867#M5159</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-14T13:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for libname using macros</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214868#M5160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;The %IF statement is not valid in open code&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Appears when the code containing %if is NOT within a %macro %mend construct. This may point to one of those statements missing or being treated incorrectly due to a number of reasons such as an unclosed quote .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 14:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214868#M5160</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-14T14:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for libname using macros</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214869#M5161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Sorry, I had commented out a few statements before and it had accidentally included the macro statement and that cause the error message. Thanks much for both your useful suggestions. @RW9 , I had used symbolgen before posting and that helped correct the syntax.&lt;/P&gt;&lt;P&gt;Thanks ! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 14:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Syntax-error-for-libname-using-macros/m-p/214869#M5161</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-05-14T14:56:36Z</dc:date>
    </item>
  </channel>
</rss>

