<?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 How to rename all datasets in a library at once? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/553996#M154097</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have over 100 datasets in my library and need to add a uniform prefix to each of them, let's say 'bc_25'. Could you please share your knowledge how to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 15:07:54 GMT</pubDate>
    <dc:creator>DiG</dc:creator>
    <dc:date>2019-04-25T15:07:54Z</dc:date>
    <item>
      <title>How to rename all datasets in a library at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/553996#M154097</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have over 100 datasets in my library and need to add a uniform prefix to each of them, let's say 'bc_25'. Could you please share your knowledge how to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 15:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/553996#M154097</guid>
      <dc:creator>DiG</dc:creator>
      <dc:date>2019-04-25T15:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename all datasets in a library at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/554000#M154098</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table work.control as
   /* replace 'pre' below with your prefixe*/
   select memname, catt('pre',memname) as newname
   from dictionary.tables
   /* replace JUNK below with your library 
      in capital letters
   */
   where libname='JUNK'
   ;
quit;

data _null_;
   set work.control end=lastone;
   if _n_=1 then call execute('proc datasets library=junk;');
   call execute ('change '||memname||'='||newname||';');
   if lastone then call execute('quit;');
run;&lt;/PRE&gt;
&lt;P&gt;Caution: you may have issues if the length of your prefix plus the existing name exceeds 32 characters. The generated names would not be valid and this will throw errors.&lt;/P&gt;
&lt;P&gt;if that might happen then you need to make sure that the length of the newname is not longer than 32.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 15:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/554000#M154098</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-25T15:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename all datasets in a library at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/554008#M154100</link>
      <description>&lt;P&gt;Yes, it works! Thanks a lot &lt;A class="lia-link-navigation lia-page-link lia-user-name-link" id="link_12" style="color: #009999;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_self"&gt;&lt;SPAN class="login-bold"&gt;ballardw&lt;/SPAN&gt;&lt;/A&gt; !!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 15:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-all-datasets-in-a-library-at-once/m-p/554008#M154100</guid>
      <dc:creator>DiG</dc:creator>
      <dc:date>2019-04-25T15:51:58Z</dc:date>
    </item>
  </channel>
</rss>

