<?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 resolve macro variable in %include statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112939#M23313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have following codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;options symbolgen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_start =%str(%'C:\SAS\);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_end = %str(.sas\%');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let fileName&amp;nbsp;&amp;nbsp;&amp;nbsp; = MySasFile;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;directory_start;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;directory_end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;fileName;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include %str(&amp;amp;directory_start.&amp;amp;fileName.&amp;amp;directory_end.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intend is to generate the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include 'C:\SAS\MySasFile.sas\'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the macro variables are resolved ok; however, I got an error message saying that " ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What mistake have I made? Thank you for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jun 2013 22:27:06 GMT</pubDate>
    <dc:creator>abcd123</dc:creator>
    <dc:date>2013-06-19T22:27:06Z</dc:date>
    <item>
      <title>resolve macro variable in %include statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112939#M23313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have following codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;options symbolgen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_start =%str(%'C:\SAS\);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_end = %str(.sas\%');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let fileName&amp;nbsp;&amp;nbsp;&amp;nbsp; = MySasFile;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;directory_start;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;directory_end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%put &amp;amp;fileName;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include %str(&amp;amp;directory_start.&amp;amp;fileName.&amp;amp;directory_end.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intend is to generate the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include 'C:\SAS\MySasFile.sas\'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the macro variables are resolved ok; however, I got an error message saying that " ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What mistake have I made? Thank you for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 22:27:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112939#M23313</guid>
      <dc:creator>abcd123</dc:creator>
      <dc:date>2013-06-19T22:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: resolve macro variable in %include statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112940#M23314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include 'C:\SAS\MySasFile.sas\'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;Has an extra \ at the end of directory end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;What's with all the %str()? It seems easier if you avoid them in my opinion. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_start =C:\SAS\;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%let directory_end= .sas;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%letfileName=mysasfile;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;%include "&amp;amp;directory_start.&amp;amp;fileName.&amp;amp;directory_end.";&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 22:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112940#M23314</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-06-19T22:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: resolve macro variable in %include statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112941#M23315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;I thought I had to write the statement as:&amp;nbsp; %include&amp;nbsp; &lt;SPAN style="color: #003366;"&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;C:\SAS\MySasFile.sas\&lt;STRONG&gt;' ; &lt;/STRONG&gt;&lt;/SPAN&gt;I don't know I can use double quote " instead of single quote ' &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 01:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/resolve-macro-variable-in-include-statement/m-p/112941#M23315</guid>
      <dc:creator>abcd123</dc:creator>
      <dc:date>2013-06-20T01:23:37Z</dc:date>
    </item>
  </channel>
</rss>

