<?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 concatenation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553553#M153952</link>
    <description>&lt;P&gt;Why split your data into yearly folders? You can date stamp your file names to indicate which year / month / day they are for. You can easily end up creating a maintenance problem by having directories for every period. It is a whole lot easier not to split SAS data by date into separate folders, but to date stamp them instead - your LIBNAME example would just be D:\Test and not change.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 08:24:57 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-04-24T08:24:57Z</dc:date>
    <item>
      <title>SAS libname concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553541#M153946</link>
      <description>&lt;P&gt;I would like to do the following: libname concatenation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname testyear ("D:\test\1998","D:\test\1999","D:\test\2000","D:\test\2001");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any better to do this as the year will increase? Please advice.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 07:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553541#M153946</guid>
      <dc:creator>scb</dc:creator>
      <dc:date>2019-04-24T07:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553544#M153948</link>
      <description>&lt;P&gt;Create the string of directory names in a data step, and store it in a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length libstring $500;
do year = 1998 to 2001;
  libstring = catx(',',libstring,quote("D:\test\" !! put(year,z4.)));
end;
call symputx('libstring',libstring);
run;

libname testyear (&amp;amp;libstring.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 07:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553544#M153948</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-24T07:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553553#M153952</link>
      <description>&lt;P&gt;Why split your data into yearly folders? You can date stamp your file names to indicate which year / month / day they are for. You can easily end up creating a maintenance problem by having directories for every period. It is a whole lot easier not to split SAS data by date into separate folders, but to date stamp them instead - your LIBNAME example would just be D:\Test and not change.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 08:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553553#M153952</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-04-24T08:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS libname concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553565#M153957</link>
      <description>&lt;P&gt;If xcmd is enabled, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "dir /b d:\test";

data _null_;
   length pathList $ 500;
   retain pathList;

   infile oscmd end=jobDone;
   input;

   pathList = catx(',', pathList, quote(cats("d:\test\", _infile_)));


   if jobdone then do;
      call execute(cats('libname testyear (', pathList, ');'));
   end;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 09:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-libname-concatenation/m-p/553565#M153957</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-04-24T09:32:58Z</dc:date>
    </item>
  </channel>
</rss>

