<?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: copy multiple datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472801#M121263</link>
    <description>&lt;P&gt;Then there's no way to reduce the set statement. Unless you have some criteria that helps you in selecting your datasets from dictionary.tables and putting all dataset names (including the library) into a macro variable.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jun 2018 18:02:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-06-24T18:02:38Z</dc:date>
    <item>
      <title>copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472795#M121259</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to shorten the below code since all "have" files are from the same lib?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set libname.have1&amp;nbsp;&lt;SPAN&gt;libname.have2&amp;nbsp;libname.have3&amp;nbsp;libname.have4;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 17:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472795#M121259</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-06-24T17:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472799#M121261</link>
      <description>&lt;P&gt;Use a wildcard:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set libname.have:;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Jun 2018 17:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472799#M121261</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-24T17:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472800#M121262</link>
      <description>oh, my example is a bit mis-leading.&lt;BR /&gt;the file I have are not all share the same name.&lt;BR /&gt;it is random, say ab1 cd3 dxyz22&lt;BR /&gt;Hoang</description>
      <pubDate>Sun, 24 Jun 2018 17:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472800#M121262</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-06-24T17:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472801#M121263</link>
      <description>&lt;P&gt;Then there's no way to reduce the set statement. Unless you have some criteria that helps you in selecting your datasets from dictionary.tables and putting all dataset names (including the library) into a macro variable.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 18:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472801#M121263</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-24T18:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472802#M121264</link>
      <description>&lt;P&gt;Thanks for your info.&lt;/P&gt;
&lt;P&gt;I hope it could be something like libname.( list of datasets...);&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 18:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472802#M121264</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-06-24T18:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472803#M121265</link>
      <description>&lt;P&gt;Yes, this should be achieved, because you already have the data sets which are in numbered range lists. You can try below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data want; 
   set libname.have1-libname.have4;
run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Jun 2018 18:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472803#M121265</guid>
      <dc:creator>pjpnk</dc:creator>
      <dc:date>2018-06-24T18:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472805#M121266</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp; Try to read the dataset names from dictionary tables and create a list macrovar. Then call the macrovar in your set statement. This can help you avoid typing&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 18:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472805#M121266</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-24T18:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: copy multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472811#M121267</link>
      <description>&lt;P&gt;Following up on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let myLib=WORK;

proc sql noprint;
select catx(".", "&amp;amp;myLib",  memname) into :name_list separated by " "
from sashelp.vtable
where libname=upcase("&amp;amp;myLib.");
quit;


data want;
set &amp;amp;name_list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This approach works if you have less than 1500+ variables due to the length restrictions of a SAS macro variable.&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/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to shorten the below code since all "have" files are from the same lib?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set libname.have1&amp;nbsp;&lt;SPAN&gt;libname.have2&amp;nbsp;libname.have3&amp;nbsp;libname.have4;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 19:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/copy-multiple-datasets/m-p/472811#M121267</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-24T19:33:50Z</dc:date>
    </item>
  </channel>
</rss>

