<?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: PROC APPEND FROM MULTIPLE TABLE in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416283#M67611</link>
    <description>&lt;P&gt;First off, don't write all in upper case - I will change the subject.&lt;/P&gt;
&lt;P&gt;Secondly why do you have 3000 datasets all the same, sounds like your running some procedure over data and outputting to separate datasets - this is not an efficient methodology and then leads to questions like yours.&amp;nbsp; Look up by group processing.&amp;nbsp; In your original data create a grouping variable, then do your procedure with the by group - it is faster, less coding, less disk space, and simpler to work with.&amp;nbsp; E.g. I want to do means on all groups of age 1-10, 11-20, 20+&lt;/P&gt;
&lt;PRE&gt;data inter;
  set have;
  length group $20;
  if 1 &amp;lt;= age &amp;lt;= 10 then group="Group 1";
  else if 11 &amp;lt;= age &amp;lt;= 20 then group="Group 2";
  else group="Group 3";
run;

proc means data=inter;
  by group;     /* key line */
  var weight;
  output out=want n=n mean=mean;
run;&lt;/PRE&gt;
&lt;P&gt;This will process one dataset, by the given group, and produce one dataset with all the output needed.&lt;/P&gt;
&lt;P&gt;If you have another point, please give full details.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 09:02:19 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-27T09:02:19Z</dc:date>
    <item>
      <title>Proc append from multiple tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416269#M67609</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a datasets 3000 lets say test0001 to test3000 and the variable names are same in all the datasets. I want to append all 3000 files in to one file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please suggest me any short simple way to do this task.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Anil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 09:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416269#M67609</guid>
      <dc:creator>anilgvdbm</dc:creator>
      <dc:date>2017-11-27T09:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: PROC APPEND FROM MULTIPLE TABLE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416280#M67610</link>
      <description>&lt;P&gt;proc append can only handle one dataset to append.&lt;/P&gt;
&lt;P&gt;But you can use a datastep with wildcards:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data basetest;
input x;
cards;
1
;
run;

data add0001;
input x;
cards;
2
;
run;

data add0002;
input x;
cards;
3
;
run;

data basetest;
set
  basetest
  add:
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2017 08:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416280#M67610</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-27T08:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC APPEND FROM MULTIPLE TABLE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416283#M67611</link>
      <description>&lt;P&gt;First off, don't write all in upper case - I will change the subject.&lt;/P&gt;
&lt;P&gt;Secondly why do you have 3000 datasets all the same, sounds like your running some procedure over data and outputting to separate datasets - this is not an efficient methodology and then leads to questions like yours.&amp;nbsp; Look up by group processing.&amp;nbsp; In your original data create a grouping variable, then do your procedure with the by group - it is faster, less coding, less disk space, and simpler to work with.&amp;nbsp; E.g. I want to do means on all groups of age 1-10, 11-20, 20+&lt;/P&gt;
&lt;PRE&gt;data inter;
  set have;
  length group $20;
  if 1 &amp;lt;= age &amp;lt;= 10 then group="Group 1";
  else if 11 &amp;lt;= age &amp;lt;= 20 then group="Group 2";
  else group="Group 3";
run;

proc means data=inter;
  by group;     /* key line */
  var weight;
  output out=want n=n mean=mean;
run;&lt;/PRE&gt;
&lt;P&gt;This will process one dataset, by the given group, and produce one dataset with all the output needed.&lt;/P&gt;
&lt;P&gt;If you have another point, please give full details.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 09:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-append-from-multiple-tables/m-p/416283#M67611</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-27T09:02:19Z</dc:date>
    </item>
  </channel>
</rss>

