<?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 statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-statement/m-p/343665#M272935</link>
    <description>&lt;P&gt;Use double quotes. Single quotes prevent the resolution of macro triggers (% and &amp;amp;).&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 11:21:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-23T11:21:30Z</dc:date>
    <item>
      <title>Macro variable in filename statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-statement/m-p/343660#M272934</link>
      <description>&lt;P&gt;I have an ETL-job that runs each day. It creates&amp;nbsp;a csv-file that needs to be deleted at the end of the job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can delete a specific file using this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	filename delfile 'c:\temp\file_2017_03_23.csv';
	rc = fdelete('delfile');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However I don't want to indicate one specific file, because the filename will vary each day.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to be able to do something like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	filename delfile 'c:\temp\file_&amp;amp;datestamp..csv';
	rc = fdelete('delfile');
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;/*the &amp;amp;datestamp would always refer to the current day*/&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the filename statement doesn't accept macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any advice on how I can resolve this?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 11:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-statement/m-p/343660#M272934</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2017-03-23T11:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable in filename statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-statement/m-p/343665#M272935</link>
      <description>&lt;P&gt;Use double quotes. Single quotes prevent the resolution of macro triggers (% and &amp;amp;).&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 11:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-in-filename-statement/m-p/343665#M272935</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-23T11:21:30Z</dc:date>
    </item>
  </channel>
</rss>

