<?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: Rename data set in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188590#M2326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you clarify why you need to use a macro, and why you would need to rename a dataset?&lt;/P&gt;&lt;P&gt;data new_dataset; set old_dataset; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If following a pattern then:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.vtable (where=(libname="XYZ" and substr(memname ,1,3)="ABC"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call exexcute('data DEF_'||strip(memname,4)||'; set ABC_'||strip(memname,4)||'; run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will rename every dataset in XYZ with the prefix ABC to have the prefix DEF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 09:29:44 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-01-19T09:29:44Z</dc:date>
    <item>
      <title>Rename data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188589#M2325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to rename more then two data sets in work Library by using macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reagrds,&lt;/P&gt;&lt;P&gt;Rajasekhar Reddy&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188589#M2325</guid>
      <dc:creator>RajasekharReddy</dc:creator>
      <dc:date>2015-01-19T09:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rename data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188590#M2326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you clarify why you need to use a macro, and why you would need to rename a dataset?&lt;/P&gt;&lt;P&gt;data new_dataset; set old_dataset; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If following a pattern then:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.vtable (where=(libname="XYZ" and substr(memname ,1,3)="ABC"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call exexcute('data DEF_'||strip(memname,4)||'; set ABC_'||strip(memname,4)||'; run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will rename every dataset in XYZ with the prefix ABC to have the prefix DEF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188590#M2326</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-19T09:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rename data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188591#M2327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need Macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data _null_;
 set sashelp.vmember(where=(libname='WORK' and memtype='DATA')) end=last;
if _n_ eq 1 then call execute('proc datasets library='||libname||' nolist nodetails; change ');
call execute(strip(memname)||'=want'||strip(_n_));
if last then call execute(';quit;');
run;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 10:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Rename-data-set/m-p/188591#M2327</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-19T10:00:29Z</dc:date>
    </item>
  </channel>
</rss>

