<?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 Reference variable in filename in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reference-variable-in-filename/m-p/793703#M254423</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am unable to properly locate my file in my directory when I use a variable in the path&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am emptying the contents on the file by doing the below:&lt;/P&gt;
&lt;PRE&gt;	filename csvfile 'C:/Logs/log.csv';
	data _null_;
  	file csvfile old;
	run;
	&lt;/PRE&gt;
&lt;P&gt;i want to pass C:/AllLogs as a variable called &amp;amp;dir&lt;/P&gt;
&lt;PRE&gt;%let dir = C:/Logs;
filename csvfile '&amp;amp;dir./log.csv';
	data _null_;
  	file csvfile old;
	run;	&lt;/PRE&gt;
&lt;P&gt;The above way I do it does not work. Please advise where I am going wrong and how to resolve it. thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2022 09:21:07 GMT</pubDate>
    <dc:creator>Citrine10</dc:creator>
    <dc:date>2022-02-01T09:21:07Z</dc:date>
    <item>
      <title>Reference variable in filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reference-variable-in-filename/m-p/793703#M254423</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am unable to properly locate my file in my directory when I use a variable in the path&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am emptying the contents on the file by doing the below:&lt;/P&gt;
&lt;PRE&gt;	filename csvfile 'C:/Logs/log.csv';
	data _null_;
  	file csvfile old;
	run;
	&lt;/PRE&gt;
&lt;P&gt;i want to pass C:/AllLogs as a variable called &amp;amp;dir&lt;/P&gt;
&lt;PRE&gt;%let dir = C:/Logs;
filename csvfile '&amp;amp;dir./log.csv';
	data _null_;
  	file csvfile old;
	run;	&lt;/PRE&gt;
&lt;P&gt;The above way I do it does not work. Please advise where I am going wrong and how to resolve it. thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 09:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reference-variable-in-filename/m-p/793703#M254423</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2022-02-01T09:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reference variable in filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reference-variable-in-filename/m-p/793707#M254424</link>
      <description>&lt;P&gt;Macro variables have to be inside double quotes to be resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename csvfile "&amp;amp;dir./log.csv";&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 09:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reference-variable-in-filename/m-p/793707#M254424</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-01T09:28:48Z</dc:date>
    </item>
  </channel>
</rss>

