<?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: Appending data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363661#M86153</link>
    <description>I have to do the same task for 4 tables, say AB002, AB003 and AB004 and AB005, how could I pass the parametes in a macro rather than writing the code for 4 tables seperatley</description>
    <pubDate>Fri, 02 Jun 2017 00:42:12 GMT</pubDate>
    <dc:creator>SAS_INFO</dc:creator>
    <dc:date>2017-06-02T00:42:12Z</dc:date>
    <item>
      <title>Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363314#M86009</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently using the below mentioned code to append daily datasets to monthly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;****Mothly Dataset************&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;myyear = year(today());&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;last_month = month(today())-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; string $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;string = put(myyear,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;z4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) !! put(last_month,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;z2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'last_month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,string);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro combine;&lt;BR /&gt;data DATASET.AB002_&amp;amp;last_month&lt;BR /&gt;set&lt;BR /&gt;%do i=1 %to 30;&lt;BR /&gt;%if %length(&amp;amp;i) = 1 %then %let i=0&amp;amp;i;&lt;BR /&gt;dataset.AB002_201611&amp;amp;i&lt;BR /&gt;%end;&lt;BR /&gt;&amp;nbsp;;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%combine;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;TASK :&lt;/U&gt;&lt;/P&gt;&lt;P&gt;In this code i am supplying the end date of a month manually (30,31 28 or 29).&lt;/P&gt;&lt;P&gt;My requirement is i need to automate the whole code, and the last date of the month should get calculated dynamically, while appending the datasets to monthly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My input files names are like AB002_20170501,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AB002_20170502&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AB002_20170503....AB002_20170531&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 05:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363314#M86009</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-06-01T05:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363317#M86010</link>
      <description>&lt;P&gt;Look at the INTNX function to align your dates. The examples show the use of the 0 interval.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are you appending all each time? Why not create a master table and append to that each day - so only new records are added?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you shoukd use PROC APPEND since it doesn't recreate the dataset it adds on and doesn't process every line of data as you would in a dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And look at wildcards for datasets. The following are likely equivalent, but you should test it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SET AB002_201705: ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SET AB002_20170501 - AB002_20170531;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 05:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363317#M86010</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-01T05:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363318#M86011</link>
      <description>&lt;P&gt;You should just let SAS generate the dates in the form you need.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro combine(month);
%local last_month date ;
%let last_month=%sysfunc(intnx(month,%sysfunc(today()),-1,b));

data DATASET.AB002_%sysfunc(putn(&amp;amp;last_month,yymmn6));
  set
%do date=&amp;amp;last_month %to %sysfunc(intnx(month(&amp;amp;last_month,0,e));
 dataset.AB002_%sysfunc(putn(&amp;amp;date,yymmddn8))
%end;
  ;
run;
%mend combine;
%combine;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 05:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363318#M86011</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-01T05:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363319#M86012</link>
      <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;My input files are originally txt files , from which I build datasets daily,somehow, the daily files doesn't have todays data, and sometimes a day's data will appear after 2 days.&lt;BR /&gt;&lt;BR /&gt;So I couldnot create monthly dataset and let the daily files to append ther directly.&lt;BR /&gt;my plan is to find a way to calculate the end date of a month(30,31, 28 or 29) and automate and schedule the whole process on 5th of every month, by that I am giving enough time to all the daily data to appear and then after a day or 2 I need to delete the daily datasets and preserve only monthly datasets.</description>
      <pubDate>Thu, 01 Jun 2017 05:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363319#M86012</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-06-01T05:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363320#M86013</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32726"&gt;@SAS_INFO&lt;/a&gt; wrote:&lt;BR /&gt;Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;My input files are originally txt files , from which I build datasets daily,somehow, the daily files doesn't have todays data, and sometimes a day's data will appear after 2 days.&lt;BR /&gt;&lt;BR /&gt;So I couldnot create monthly dataset and let the daily files to append ther directly.&lt;BR /&gt;my plan is to find a way to calculate the end date of a month(30,31, 28 or 29) and automate and schedule the whole process on 5th of every month, by that I am giving enough time to all the daily data to appear and then after a day or 2 I need to delete the daily datasets and preserve only monthly datasets.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So then do it in one data step without macro logic, only using macro variables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let libname=dataset;
%let basename=ab002_;

data _null_;
length ds_names $1300 ds_name $43;
lastmonth_start = intnx('month',today(),-1,'begin');
lastmonth_end = intnx('month',lastmonth_start,0,'end');
do curdate = lastmonth_start to lastmonth_end;
  ds_name = "&amp;amp;libname..&amp;amp;basename" !! put(curdate,yymmddn8.);
  ds_names = catx(' ',trim(ds_names),ds_name);
end;
call symput('ds_names',trim(ds_names));
run;

%put &amp;amp;ds_names; /* for control */

data want;
set &amp;amp;ds_names;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 06:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363320#M86013</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-01T06:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363321#M86014</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32726"&gt;@SAS_INFO&lt;/a&gt; wrote:&lt;BR /&gt;Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;My input files are originally txt files , from which I build datasets daily,somehow, the daily files doesn't have todays data, and sometimes a day's data will appear after 2 days.&lt;BR /&gt;&lt;BR /&gt;So I couldnot create monthly dataset and let the daily files to append ther directly.&lt;BR /&gt;my plan is to find a way to calculate the end date of a month(30,31, 28 or 29) and automate and schedule the whole process on 5th of every month, by that I am giving enough time to all the daily data to appear and then after a day or 2 I need to delete the daily datasets and preserve only monthly datasets.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are several things wrong with this logic but it's past my bedtime.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wouls strongly suggest you pseudocode your process. Look at what is done daily and monthly and what needs to happen where. There's a coding philosophy called DRY - don't repeat yourself. I suspect you have a lot of repetition in your current process. This is pretty basic data management concepts so it may be worth reading up on some that if that's your current role. I know IT/Analyst roles can be fluid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm pretty sure I've also linked you to my post about how to read all text files at once using wildcards and avoid these loops. It would still be applicable here. Note with the wildcard method you don't need to know how many days are in the month. It'll read all files with the correct year month prefix.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 06:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363321#M86014</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-01T06:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363323#M86015</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I checked the code with some dummy datasets.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;26 %macro combine(month);&lt;BR /&gt;27 %local last_month date ;&lt;BR /&gt;28 %let last_month=%sysfunc(intnx(month,%sysfunc(today()),-1,b));&lt;BR /&gt;29&lt;BR /&gt;30 data DATASET.AB002_%sysfunc(putn(&amp;amp;last_month,yymmn6));&lt;BR /&gt;31 set&lt;BR /&gt;32 %do date=&amp;amp;last_month %to %sysfunc(intnx(month(&amp;amp;last_month,0,e));&lt;BR /&gt;33 dataset.AB002_%sysfunc(putn(&amp;amp;date,yymmddn8))&lt;BR /&gt;34 %end;&lt;BR /&gt;35 ;&lt;BR /&gt;36 run;&lt;BR /&gt;37 %mend combine;&lt;BR /&gt;38 %combine;&lt;BR /&gt;MPRINT(COMBINE): data DATASET.AB002_201705;&lt;BR /&gt;ERROR: Expected close parenthesis after macro function invocation not found.&lt;BR /&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;BR /&gt;ERROR: The %TO value of the %DO DATE loop is invalid.&lt;BR /&gt;ERROR: The macro COMBINE will stop executing.&lt;BR /&gt;MPRINT(COMBINE): set&lt;BR /&gt;39&lt;BR /&gt;40 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;ERROR: File WORK.GOPTIONS.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.NOACCESSIBLE.DATA does not exist.&lt;BR /&gt;41 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;42 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;43 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;44 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;45 %LET _SASPROGRAMFILE=;&lt;BR /&gt;46&lt;BR /&gt;47 ;*';*";*/;quit;run;&lt;BR /&gt;____&lt;BR /&gt;180&lt;BR /&gt;2 The SAS System 16:12 Thursday, June 1, 2017&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set DATASET.AB002_201705 may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;BR /&gt;WARNING: Data set DATASET.AB002_201705 was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds</description>
      <pubDate>Thu, 01 Jun 2017 06:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363323#M86015</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-06-01T06:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363325#M86017</link>
      <description>So did you try fixing the syntax mistake and seeing if the logic works then?&lt;BR /&gt;One is pretty obvious looking at the log you posted.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Jun 2017 06:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363325#M86017</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-01T06:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363327#M86018</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(intnx(month(&amp;amp;last_month,0,e))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;three opening, but only two closing parentheses.&lt;/P&gt;
&lt;P&gt;Hint: one of the opening parentheses needs to be replaced by a comma.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 06:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363327#M86018</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-01T06:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363328#M86019</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro append_simple_code();

%let YMonth = %sysfunc(INTNX (month, %sysfunc(today()), -1, end), yymmn6);

Data AB002_&amp;amp;Ymonth;
   Set AB002_&amp;amp;Ymonth: ;
Run;

%mend;

%append_simple_code;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 06:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363328#M86019</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-01T06:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363334#M86021</link>
      <description>Awesome Reeza, its working great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 01 Jun 2017 07:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363334#M86021</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-06-01T07:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363338#M86023</link>
      <description>&lt;P&gt;Erm, maybe I am missing something here, but if you have a set of files with prefix AB0002 and you want to combine them all, just do:&lt;/P&gt;
&lt;PRE&gt;data master;
  set master ab002:;
run;&lt;/PRE&gt;
&lt;P&gt;In the above, you would keep a dataset called master, this one is the master dataset, and then copy in your new files called ab002_.... and the above will set anything with the prefix onto master.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 08:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363338#M86023</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-01T08:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363661#M86153</link>
      <description>I have to do the same task for 4 tables, say AB002, AB003 and AB004 and AB005, how could I pass the parametes in a macro rather than writing the code for 4 tables seperatley</description>
      <pubDate>Fri, 02 Jun 2017 00:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363661#M86153</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-06-02T00:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363668#M86157</link>
      <description>&lt;P&gt;Add a parameter for the prefix.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try and let us know if you have issues.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See a basic short macro tutorial here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I suggest reading all of it, but the primary focus would be under the heading.&lt;/P&gt;
&lt;P&gt;A macro program for repeating a procedure multiple times&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 02:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363668#M86157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-02T02:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Appending data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363709#M86172</link>
      <description>&lt;P&gt;If you present your problem in full it saves this going back and forth. &amp;nbsp;You can simply:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  do i=1 to 4;
    call execute(cats('data master',put(i,1.),'; set master',put(i,1.),' ab00',put(i,1.),':; run;'));
  end;
run;&lt;/PRE&gt;
&lt;P&gt;This will create master1 to 4 concatenating all ab00i datasets - where i is 1-4 - into the master.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 08:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-data/m-p/363709#M86172</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-02T08:16:52Z</dc:date>
    </item>
  </channel>
</rss>

