<?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: Dynamic Libname Path in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130202#M260555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not just use something like the following?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let choosen_year=2013;&lt;/P&gt;&lt;P&gt;%let choosen_month=3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname smfexcel excel path="C:\Users\foobar\Desktop\Monthly Report\monthly_report&amp;amp;choosen_year._M&amp;amp;choosen_month..xlsx";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2013 16:17:54 GMT</pubDate>
    <dc:creator>mlamias</dc:creator>
    <dc:date>2013-03-07T16:17:54Z</dc:date>
    <item>
      <title>Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130201#M260554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering whether it its possible to set a dynamic libname path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following example should illustrate my intention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;data _null_;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;conString = compress("C:\Users\foobar\Desktop\Monthly Report\monthly_report"||&lt;STRONG&gt;&amp;amp;choosen_year&lt;/STRONG&gt;||"_M"||&lt;STRONG&gt;&amp;amp;choosen_month&lt;/STRONG&gt;||".xlsx");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;libname smfexcel excel path=&amp;amp;conString;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I always receive something like this " .....invalid Optionsname CONSTRING".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any proposals or hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130201#M260554</guid>
      <dc:creator>hoff_sas</dc:creator>
      <dc:date>2013-03-07T16:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130202#M260555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not just use something like the following?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let choosen_year=2013;&lt;/P&gt;&lt;P&gt;%let choosen_month=3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname smfexcel excel path="C:\Users\foobar\Desktop\Monthly Report\monthly_report&amp;amp;choosen_year._M&amp;amp;choosen_month..xlsx";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130202#M260555</guid>
      <dc:creator>mlamias</dc:creator>
      <dc:date>2013-03-07T16:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130203#M260556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is exactly what I tired to do at first. But the variable was not interpreted.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;libname smfexcel excel "C:\Users\...\smf_&amp;amp;smf_year_M01.xlsx";&amp;nbsp; set up the following library: &lt;/P&gt;&lt;P&gt;physical name: C:\Users\fhoff\Desktop\Monthly Report\smf_&amp;amp;smf_year_M01.xlsx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of this i started to tinker with concatenation operators.&lt;/P&gt;&lt;P&gt;And of course....I did some %let before the mentioned step to initialize my variables. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130203#M260556</guid>
      <dc:creator>hoff_sas</dc:creator>
      <dc:date>2013-03-07T16:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130204#M260557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look closely at the suggested code, and you'll see that you omitted something from your attempt. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the name of your macro variable???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;smf&lt;/P&gt;&lt;P&gt;&amp;amp;smf_&lt;/P&gt;&lt;P&gt;&amp;amp;smf_year&lt;/P&gt;&lt;P&gt;&amp;amp;smf_year_M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many other choices are possible.&amp;nbsp; How does SAS know which one to look for?&amp;nbsp; SAS is actually looking for &amp;amp;smf_year_M01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delimit the name of your macro variable with a dot.&amp;nbsp; So it your macro variable is &amp;amp;smf, use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;smf_&amp;amp;smf._year_M01.xlsx&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 16:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130204#M260557</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-03-07T16:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130205#M260558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The last poster is correct.&amp;nbsp; It appears you are missing the dot (.) in the your code (if I interpreted your file naming conventions correctly).&amp;nbsp; I could also see the leading zero in the month being problematic.&amp;nbsp; Note that in SAS, there is a difference between:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let choosen_month=3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let choosen_month=03;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 17:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130205#M260558</guid>
      <dc:creator>mlamias</dc:creator>
      <dc:date>2013-03-07T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130206#M260559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning....wow...this community seems to work. Very nice! Thanks to you guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....the solution with the "." works. Thanks very much!&lt;/P&gt;&lt;P&gt;Here is the code and log results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;libname smfexcel excel "C:\Users\fhoff\Desktop\Monthly Report\smf_&amp;amp;smf_year._M01.xlsx";&lt;/P&gt;&lt;P&gt;Physical Name: C:\Users\fhoff\Desktop\Monthly Report\smf_2013_M01.xlsx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings from munich &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 08:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130206#M260559</guid>
      <dc:creator>hoff_sas</dc:creator>
      <dc:date>2013-03-08T08:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Libname Path</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130207#M260560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning....wow...this community seems to work. Very nice! Thanks to you guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....the solution with the "." works. Thanks very much!&lt;/P&gt;&lt;P&gt;Here is the code and log results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;libname smfexcel excel "C:\Users\fhoff\Desktop\Monthly Report\smf_&amp;amp;smf_year._M01.xlsx";&lt;/P&gt;&lt;P&gt;Physical Name: C:\Users\fhoff\Desktop\Monthly Report\smf_2013_M01.xlsx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings from munich &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 08:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-Libname-Path/m-p/130207#M260560</guid>
      <dc:creator>hoff_sas</dc:creator>
      <dc:date>2013-03-08T08:14:09Z</dc:date>
    </item>
  </channel>
</rss>

