<?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: SAS LIBNAME a directory containing folders with datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480550#M124209</link>
    <description>&lt;P&gt;If you do not have&amp;nbsp;many folders involved easiest might be a macro variable to hold the main part of the path common to all such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let path=C:\Directory_A\;
libname mylib ("&amp;amp;path.directory_B &amp;amp;path.directory_C &amp;amp;path.directory_D");
&lt;/PRE&gt;
&lt;P&gt;of course using appropriate syntax for your operating system and care for letter case if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last \ is just part of Windows paths. Alternatively if you like you could use&lt;/P&gt;
&lt;PRE&gt;%let path=C:\Directory_A;
libname mylib ("&amp;amp;path.\directory_B &amp;amp;path.\directory_C &amp;amp;path.\directory_D");
&lt;/PRE&gt;
&lt;P&gt;The periods are necessary to indicate the end of the macro variable value. Do not insert spaces if not in the in actual path if not there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;path.\directory_B resolves to "C:\Directory_A\directory_B"&amp;nbsp; &amp;amp;path.\ directory_B would resolve to "C:\Directory_A\ directory_B".&amp;nbsp; One of which is incorrect for your use.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jul 2018 15:24:33 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-30T15:24:33Z</dc:date>
    <item>
      <title>SAS LIBNAME a directory containing folders with datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480322#M124128</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I was wondering if I could libname a directory containing serveral folders with datasets I need.&lt;BR /&gt;&lt;BR /&gt;The directory looks like this:&lt;BR /&gt;&lt;BR /&gt;Directory_A&lt;BR /&gt;--Directory_B&lt;BR /&gt;----Dataset_1.sas7bdat&lt;BR /&gt;--Directory_C&lt;BR /&gt;----Dataset_2.sas7bdat&lt;BR /&gt;----Dataset_3.sas7bdat&lt;BR /&gt;--Directory_D&lt;BR /&gt;----Dataset_4.sas7bdat&lt;BR /&gt;&lt;BR /&gt;Cheers.</description>
      <pubDate>Mon, 23 Jul 2018 02:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480322#M124128</guid>
      <dc:creator>alex_liang</dc:creator>
      <dc:date>2018-07-23T02:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS LIBNAME a directory containing folders with datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480337#M124132</link>
      <description>&lt;P&gt;You can have multiple paths in a library but I don't know of a way to have a wildcard reference. You could crawl the parent directory and concatenate the paths into one and pass it to a libname function or statement. I don't have time to code that up, but perhaps someone else can. There are examples of finding paths/folder structures on here or search SAS 9.4 Macro Appendix for an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222418"&gt;@alex_liang&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I was wondering if I could libname a directory containing serveral folders with datasets I need.&lt;BR /&gt;&lt;BR /&gt;The directory looks like this:&lt;BR /&gt;&lt;BR /&gt;Directory_A&lt;BR /&gt;--Directory_B&lt;BR /&gt;----Dataset_1.sas7bdat&lt;BR /&gt;--Directory_C&lt;BR /&gt;----Dataset_2.sas7bdat&lt;BR /&gt;----Dataset_3.sas7bdat&lt;BR /&gt;--Directory_D&lt;BR /&gt;----Dataset_4.sas7bdat&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 02:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480337#M124132</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-23T02:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS LIBNAME a directory containing folders with datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480550#M124209</link>
      <description>&lt;P&gt;If you do not have&amp;nbsp;many folders involved easiest might be a macro variable to hold the main part of the path common to all such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let path=C:\Directory_A\;
libname mylib ("&amp;amp;path.directory_B &amp;amp;path.directory_C &amp;amp;path.directory_D");
&lt;/PRE&gt;
&lt;P&gt;of course using appropriate syntax for your operating system and care for letter case if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last \ is just part of Windows paths. Alternatively if you like you could use&lt;/P&gt;
&lt;PRE&gt;%let path=C:\Directory_A;
libname mylib ("&amp;amp;path.\directory_B &amp;amp;path.\directory_C &amp;amp;path.\directory_D");
&lt;/PRE&gt;
&lt;P&gt;The periods are necessary to indicate the end of the macro variable value. Do not insert spaces if not in the in actual path if not there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;path.\directory_B resolves to "C:\Directory_A\directory_B"&amp;nbsp; &amp;amp;path.\ directory_B would resolve to "C:\Directory_A\ directory_B".&amp;nbsp; One of which is incorrect for your use.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 15:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-LIBNAME-a-directory-containing-folders-with-datasets/m-p/480550#M124209</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-30T15:24:33Z</dc:date>
    </item>
  </channel>
</rss>

