<?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: Macro variable in filename not resolved in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932942#M366974</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39747"&gt;@Cornelis&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The outer single quotes prevent the resolution of the macro variable reference. Use double quotes instead and duplicate the existing inner double quotes:&lt;/P&gt;
&lt;PRE&gt;filename DIRLIST2 pipe &lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;dir &lt;FONT color="#00DA00"&gt;&lt;STRONG&gt;""&lt;/STRONG&gt;&lt;/FONT&gt;\\msnlgoudcp3102\nlgouddata\GLC\LZ-analyses\to be printed\&amp;amp;thisyear\vetzuur&lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;""&lt;/FONT&gt;&lt;/STRONG&gt; /s&lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 08:27:06 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-06-19T08:27:06Z</dc:date>
    <item>
      <title>Macro variable in filename not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932940#M366972</link>
      <description>&lt;P&gt;Dear SAS users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro variable "thisyear" cannot be resolved in the Filename statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let thisyear = 2024;

filename DIRLIST2 pipe 'dir "\\msnlgoudcp3102\nlgouddata\GLC\LZ-analyses\to be printed\&amp;amp;thisyear\vetzuur" /s';

data dirlist_LZ;
     length buffer $256 ;
	 format file $200. GLC_where $3.;
     infile dirlist2 length=reclen ;
     input buffer $varying256. reclen;
run;&lt;/CODE&gt;&lt;/PRE&gt;
Could you please offer a solution how to solve?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thank you,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Cornelis&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jun 2024 08:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932940#M366972</guid>
      <dc:creator>Cornelis</dc:creator>
      <dc:date>2024-06-19T08:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in filename not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932941#M366973</link>
      <description>filename DIRLIST2  pipe %sysfunc(quote(dir "\\msnlgoudcp3102\nlgouddata\GLC\LZ-analyses\to be printed\&amp;amp;thisyear\vetzuur" /s));  &lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2024 08:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932941#M366973</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-06-19T08:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in filename not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932942#M366974</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39747"&gt;@Cornelis&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The outer single quotes prevent the resolution of the macro variable reference. Use double quotes instead and duplicate the existing inner double quotes:&lt;/P&gt;
&lt;PRE&gt;filename DIRLIST2 pipe &lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;dir &lt;FONT color="#00DA00"&gt;&lt;STRONG&gt;""&lt;/STRONG&gt;&lt;/FONT&gt;\\msnlgoudcp3102\nlgouddata\GLC\LZ-analyses\to be printed\&amp;amp;thisyear\vetzuur&lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;""&lt;/FONT&gt;&lt;/STRONG&gt; /s&lt;STRONG&gt;&lt;FONT color="#00DA00"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 08:27:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932942#M366974</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-06-19T08:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in filename not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932944#M366975</link>
      <description>Thank you for your contribution. it works!</description>
      <pubDate>Wed, 19 Jun 2024 08:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932944#M366975</guid>
      <dc:creator>Cornelis</dc:creator>
      <dc:date>2024-06-19T08:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in filename not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932947#M366976</link>
      <description>Indeed, this option works also. Great to see that there are different option and of course, your prompt action.</description>
      <pubDate>Wed, 19 Jun 2024 08:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-not-resolved/m-p/932947#M366976</guid>
      <dc:creator>Cornelis</dc:creator>
      <dc:date>2024-06-19T08:35:47Z</dc:date>
    </item>
  </channel>
</rss>

