<?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: concatenating with filenames in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13869#M2085</link>
    <description>SAS macro variable references must be enclosed in double-quotes, not single-quotes.  If you use the latter, then you will get the &amp;amp;whatever_variable  instead of the resolved macro variable.  So, if you can do a %PUT &amp;amp;whatever_variable;  to see your variable just prior to your DATA step, then you need only take care of the double-quote mention above.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 01 Apr 2009 12:19:55 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-04-01T12:19:55Z</dc:date>
    <item>
      <title>concatenating with filenames</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13868#M2084</link>
      <description>This might seem confusing but does anyone know how to capture a variable with a statement. For example, I have a infile that I am trying to reference but it changes daily and I need the program to work without changing the code everyday.&lt;BR /&gt;
&lt;BR /&gt;
my statement looks like :&lt;BR /&gt;
infile 'me/you/"the part that changes"|| rest of the file name'&lt;BR /&gt;
&lt;BR /&gt;
"where the part that changes could be a date"&lt;BR /&gt;
&lt;BR /&gt;
for some reason its not picking up the part that changes because I created a function and macro variable to capture the correct file daily but I just don't know how to reference it in my infile.&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance</description>
      <pubDate>Wed, 01 Apr 2009 12:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13868#M2084</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-01T12:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating with filenames</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13869#M2085</link>
      <description>SAS macro variable references must be enclosed in double-quotes, not single-quotes.  If you use the latter, then you will get the &amp;amp;whatever_variable  instead of the resolved macro variable.  So, if you can do a %PUT &amp;amp;whatever_variable;  to see your variable just prior to your DATA step, then you need only take care of the double-quote mention above.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 01 Apr 2009 12:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13869#M2085</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-04-01T12:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating with filenames</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13870#M2086</link>
      <description>cannot use assignment expression concatenation (||) in the physical file name of an infile statement. &lt;BR /&gt;
If the parts are strings, just make it one string.&lt;BR /&gt;
If some parts are macro variables, enclose all fixed strings and the macro variables in one double quoted(") string.&lt;BR /&gt;
If any parts are created in a data step variable, then you need to derive a variable holding the concatenated string like[pre]      fullName ='me/you/' || variable || 'rest of the file name' ;[/pre] and use the infile option FILEVAR= fullName.&lt;BR /&gt;
Once you have achieved this concatenation in the relevant way, another infile option FILENAME= {someVarName} will reveal the full path and filename from which the current infile buffer has been loaded.&lt;BR /&gt;
 &lt;BR /&gt;
worth playing around with. For the only example of FILENAME= at support.sas.com, see INFILE example 5 at &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000146932.htm#a000177201" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000146932.htm#a000177201&lt;/A&gt; .&lt;BR /&gt;
 &lt;BR /&gt;
 good luck&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Wed, 01 Apr 2009 20:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/concatenating-with-filenames/m-p/13870#M2086</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-01T20:41:15Z</dc:date>
    </item>
  </channel>
</rss>

