<?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: Problem to sum all the info in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632332#M21065</link>
    <description />
    <pubDate>Wed, 18 Mar 2020 07:11:00 GMT</pubDate>
    <dc:creator>Yona22</dc:creator>
    <dc:date>2020-03-18T07:11:00Z</dc:date>
    <item>
      <title>Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632260#M21048</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632260#M21048</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632266#M21049</link>
      <description>&lt;P&gt;You need to combine the data into a single data set. This is either a MERGE or SET in a DATA step, or a JOIN in PROC SQL. Since we don't have your data, you will have to do this part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then to do the summing, you want PROC SUMMARY. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway data=have;
    class name;
    var payment;
    output out=sums sum=sum_payment;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Mar 2020 17:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632266#M21049</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-15T17:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632270#M21050</link>
      <description>&lt;P&gt;If you need to keep the separate datasets, create a view:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataview/view=dataview;
set
  data1201
  data1202
  data1203
  ......
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then run proc summary over that.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632270#M21050</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-15T19:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632306#M21058</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632306#M21058</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632321#M21063</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632321#M21063</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632329#M21064</link>
      <description>&lt;P&gt;Remove the semicolons between the table names. The syntax needs to be a SET statement with a list of tables name and then a single semicolon which terminates the statement.&lt;/P&gt;
&lt;P&gt;If code has errors then also please always the SAS log which shows the actual error message.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 05:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632329#M21064</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-16T05:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632332#M21065</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632332#M21065</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632334#M21066</link>
      <description>&lt;P&gt;Use call execute() in a data step to create the actual data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
period = '01mar2002'd;
call execute('data want; set');
do until (period &amp;gt; '01dec2019'd);
  call execute(' data' !! substr(put(year(period),z4.),3,2) !! put(month(period),z2.));
  period = intnx('month',period,1,'b');
end;
call execute(';run;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 06:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632334#M21066</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-16T06:38:34Z</dc:date>
    </item>
    <item>
      <title>How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632342#M21071</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632342#M21071</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632345#M21072</link>
      <description>&lt;P&gt;If all of the desired input data sets start with "tab", you can do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data comp;
    set tab:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632345#M21072</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-16T07:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632349#M21073</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632349#M21073</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632357#M21074</link>
      <description>&lt;P&gt;Please don't ask the same question twice. This only messes up discussions.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has already given you a working answer &lt;A href="https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632260#M21048" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 08:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632357#M21074</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-16T08:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632360#M21075</link>
      <description>&lt;P&gt;I merged this back into the original question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the method I posted with any prefix, and any dataset with an additional suffix will be excluded.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 08:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632360#M21075</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-16T08:17:23Z</dc:date>
    </item>
    <item>
      <title>e</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632373#M21076</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 15:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632373#M21076</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T15:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632374#M21077</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316641"&gt;@Yona22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi, I used the code but just listed out all the dataset. May I know how can I put all of them together in a new data?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you run my call execute code? It will automatically pick up all datasets in the range that follow the naming pattern.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 10:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632374#M21077</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-16T10:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop all the file and combine into 1 data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632450#M21085</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316641"&gt;@Yona22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi, I have lots of dataset and named with year and months (TAB0203, TAB0204,..... until TAB1912). I want to extract all of them. This is my code&lt;BR /&gt;&lt;BR /&gt;DATA COMB;&lt;BR /&gt;SET TAB0203&lt;BR /&gt;TAB0204&lt;BR /&gt;....&lt;BR /&gt;TAB1912;&lt;BR /&gt;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;But it only read the 3 dataset and didn't read the rest of the data from TAB0205 until TAB1911. May I know how should I write for the code in order to read all of them?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;AS was suggested before: COPY the LOG and paste the copied text into a code box opened on the Forum with the {I} or "running man" icon.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632450#M21085</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-16T14:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632549#M21093</link>
      <description />
      <pubDate>Wed, 18 Mar 2020 07:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632549#M21093</guid>
      <dc:creator>Yona22</dc:creator>
      <dc:date>2020-03-18T07:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem to sum all the info</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632559#M21094</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316641"&gt;@Yona22&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below fully working and tested code using your table names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create sample source tables */
%macro doit();
  data _null_;
    length source_dslist $2000;
    do year=0 to 20;
      do month=1 to 12;
        source_dslist=catx(' ',source_dslist, cats('tab', put(year,z2.),put(month,z2.)));
       end;
    end;
    call symputx('source_dslist', source_dslist);
    stop;
  run;
%mend;
%doit();
data &amp;amp;source_dslist tab0203_copy tab0215;
  set sashelp.class(obs=2);
run;

/* create list of source tables within desired date range.
   and store result in macro variable &amp;amp;dslist
*/
%let dslist=;
proc sql noprint;
  select cats(libname,'.',memname) into :dslist separated by ' '
  from dictionary.tables
  where libname='WORK' and substr(memname,1,3)='TAB'
    and input(compress(memname,,'kd'),yymmn4.) between '01mar2002'd and '01dec2019'd
  order by memname
  ;
quit;
%put &amp;amp;=dslist;

/* combine all source tables */
data want;
  length _inds $41;
  format payment_date yymmn4.;
  set &amp;amp;dslist indsname=_inds;
  payment_date=input(compress(_inds,,'kd'),yymmn4.);
run;

proc print data=want(obs=2);
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2020 03:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-to-sum-all-the-info/m-p/632559#M21094</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-17T03:27:58Z</dc:date>
    </item>
  </channel>
</rss>

