<?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 Tables With Dates in the Table Names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644534#M192522</link>
    <description>&lt;P&gt;I think it all depends on how this referenced table is structured. Can you turn that data into macro variables that can be used to subset the data in a data step?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let cnt=8; /*number of datasets you need to combine. Assuming 1 row per table in reference table, should equal row count of reference table*/
%macro dataset_append();
%do i=1 %to &amp;amp;cnt.;
/*Create variables to be used to go table by table and subset according to criteria*/
data _null_;
set reference_table (firstobs=&amp;amp;i. obs=&amp;amp;i);
call symputx('table_name',variable_with_table_name);
call symputx('criteria1', variable_with_criteria1);
call symputx('criteria2', variable_with_criteria2);
run;
/*create temp "want" table that is single month table subsetted based on criteria from reference table*/
data want;
set &amp;amp;table_name.;
where var1=&amp;amp;criteria1. and var2=&amp;amp;criteria2.;
run;
/*append to your combined dataset*/
proc append base=my_combined_dataset data=want;
run;
%end;
%mend;
/*Run Loop*/
%dataset_append()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will loop through one table at a time, subset it first based on criteria in the reference dataset, then append it to a combined dataset. Hope this helps get going in the right direction.&lt;/P&gt;</description>
    <pubDate>Fri, 01 May 2020 14:54:31 GMT</pubDate>
    <dc:creator>bobpep212</dc:creator>
    <dc:date>2020-05-01T14:54:31Z</dc:date>
    <item>
      <title>Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644514#M192514</link>
      <description>&lt;P&gt;I have a background system that is serving up monthly table to our analytics function.&amp;nbsp; Each table is named "name_202001", "name_202002" etc.&amp;nbsp; Where 2020 is the Year and 01 is the end date of the month number of the tax year.&amp;nbsp; So 01 is 30th of April, 02 31st of June etc.&lt;/P&gt;&lt;P&gt;I am using Enterprise Guide and would like a program that appends these tables based on a start and end date Parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's a kicker, there always is.&amp;nbsp; These tables contain a huge huge number of references, and I'm aiming to be able to combine around 60 tables into one.&amp;nbsp; I have another table that contains a small list of references that is just the subset that I want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need the program to filter as it goes, rather than combining all 60 tables and then filtering them afterwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that make sense?&amp;nbsp; Anyone know how it's done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 13:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644514#M192514</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-01T13:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644520#M192518</link>
      <description>&lt;P&gt;Assuming that the 2020 is the year, do intend to combine across years?&lt;/P&gt;
&lt;P&gt;If no, then you can use a data step such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set name_202001 - name_202005;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to append sequentially numbered names. However if you need to cross years such as name_201911 to name_202003 that approach doesn't work because the list parser SAS uses requires sequential numbering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644520#M192518</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-01T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644534#M192522</link>
      <description>&lt;P&gt;I think it all depends on how this referenced table is structured. Can you turn that data into macro variables that can be used to subset the data in a data step?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let cnt=8; /*number of datasets you need to combine. Assuming 1 row per table in reference table, should equal row count of reference table*/
%macro dataset_append();
%do i=1 %to &amp;amp;cnt.;
/*Create variables to be used to go table by table and subset according to criteria*/
data _null_;
set reference_table (firstobs=&amp;amp;i. obs=&amp;amp;i);
call symputx('table_name',variable_with_table_name);
call symputx('criteria1', variable_with_criteria1);
call symputx('criteria2', variable_with_criteria2);
run;
/*create temp "want" table that is single month table subsetted based on criteria from reference table*/
data want;
set &amp;amp;table_name.;
where var1=&amp;amp;criteria1. and var2=&amp;amp;criteria2.;
run;
/*append to your combined dataset*/
proc append base=my_combined_dataset data=want;
run;
%end;
%mend;
/*Run Loop*/
%dataset_append()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will loop through one table at a time, subset it first based on criteria in the reference dataset, then append it to a combined dataset. Hope this helps get going in the right direction.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644534#M192522</guid>
      <dc:creator>bobpep212</dc:creator>
      <dc:date>2020-05-01T14:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644541#M192526</link>
      <description>&lt;P&gt;I guess that by "references" you mean some kind of key variable, for which you have a lookup dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is the case, first build the list of dataset names and store them into a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length datasets $32767; * max length;
date = &amp;amp;start_date.;
do while (date le &amp;amp;end_date.);
  datasets = catx(" ",datasets,"name_" !! put(date,yymmn6.));
  date = intnx('month',date,1,'s');
end;
call symputx('datasets',datasets);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, combine and subset in one step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set &amp;amp;datasets.;
if _n_ = 1
then do;
  declare hash l (dataset:"lookup");
  l.definekey("key");
  l.definedone();
end;
if l.check() = 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(assuming that your "reference" variable is called "key")&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 15:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644541#M192526</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-01T15:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644543#M192527</link>
      <description>&lt;P&gt;If you want to divide and conquer, you need to first generate a working program for one month/one file. Then you can generalize it to all your months. Once you have it built, follow the steps in the tutorial below to convert your program to a macro. Then you can execute it for every month. Usually it's more efficient to process all at once, but if you don't have enough memory or some other reason, you can use a macro to run it separately and combine the results at the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UCLA introductory tutorial on macro variables and macros&lt;BR /&gt;&lt;BR /&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;BR /&gt;&lt;BR /&gt;Tutorial on converting a working program to a macro&lt;BR /&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of common macro usage&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 15:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644543#M192527</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-01T15:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644583#M192555</link>
      <description>&lt;P&gt;Thanks Kurt, I'm just trying to get your solution to work.&amp;nbsp; I've not used date prompts in a while, it's throwing an error because when I set the Prompt up as a Day, it passes the value "31Jan2015" to the code.&amp;nbsp; I'm presuming that's not in the right format though.&amp;nbsp; How does that date need to be setup?&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 18:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644583#M192555</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-01T18:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644595#M192561</link>
      <description>&lt;P&gt;I changed &amp;amp;start_date. to "&amp;amp;start_date"d and the same for &amp;amp;end_date and that seems to have worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However it looks like the date offset I described isn't being covered - 202001 is April, 202002 is May etc:&lt;/P&gt;&lt;P&gt;I have tables up to April 2020, which is 202001, but if I put the end date as 01 April 2020, I get errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;name_20202 does not exist, name_202003 does not exist.&amp;nbsp; From the April 2020 date, nothing past 202001 should be requested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've offset my dates by a couple of months to get the right period while that problem gets sorted and it looks like I'm getting the right data, certainly the volume looks correct anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So thanks so much for getting me this far, it's a huge help as I was using a legacy system to run some old SQL to create a .csv file and then importing it into SAS, this will let me automate the process and strip a load of time out.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 19:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644595#M192561</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-01T19:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644606#M192565</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length datasets $32767; * max length;
date = intnx('month',"&amp;amp;start_date."d,-3,'s');;
do while (date le intnx('month',"&amp;amp;end_date."d,-3,'s'));
  datasets = catx(" ",datasets,"name_" !! put(date,yymmn6.));
  date = intnx('month',date,1,'s');
end;
call symputx('datasets',datasets);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 21:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644606#M192565</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-01T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644613#M192567</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110699"&gt;@paulrockliffe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I changed &amp;amp;start_date. to "&amp;amp;start_date"d and the same for &amp;amp;end_date and that seems to have worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However it looks like the date offset I described isn't being covered - 202001 is April, 202002 is May etc:&lt;/P&gt;
&lt;P&gt;I have tables up to April 2020, which is 202001, but if I put the end date as 01 April 2020, I get errors:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;name_20202 does not exist, name_202003 does not exist.&amp;nbsp; From the April 2020 date, nothing past 202001 should be requested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've offset my dates by a couple of months to get the right period while that problem gets sorted and it looks like I'm getting the right data, certainly the volume looks correct anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So thanks so much for getting me this far, it's a huge help as I was using a legacy system to run some old SQL to create a .csv file and then importing it into SAS, this will let me automate the process and strip a load of time out.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to very explicitly describe exactly how 202001 is April. In most "date" systems that is going to be January. If your "year" starts in a different month then you need to tell us that. Every SAS date manipulation tool will need to be told what the offset really really is.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 21:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644613#M192567</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-01T21:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644664#M192591</link>
      <description>I did put it in the first post. In the UK the Tax year is a fairly common concept, with month one being April and month 12 being March, though this data should have been set up using Calendar months as it's a total pain to work with, for no benefit at all.</description>
      <pubDate>Sat, 02 May 2020 08:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644664#M192591</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-02T08:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644665#M192592</link>
      <description>Thanks, I'll have a look and see how it goes.....</description>
      <pubDate>Sat, 02 May 2020 08:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644665#M192592</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-02T08:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644666#M192593</link>
      <description>&lt;P&gt;Unless each and every table used in SAS follows the standard 01 = April, a more common naming convention is to use the suffix FY when applicable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NAME_FY202001&amp;nbsp; rather than NAME_202001&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 08:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644666#M192593</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-02T08:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644668#M192594</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I have another table that contains a small list of references that is just the subset that I want&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;How small is small? How many references do you have?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the list is small enough that it can fit in a where clause, that's your best bet. If not then a hash table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %macro loop; %do i=1 %to 60; T&amp;amp;i %end; %mend; 
data %loop;
   do I=1 to 1e6;
    output; 
  end;
run;

data LOOKUP; 
   do i=1 to 1e6 by 1e3;
    output; 
  end;
run;

%* where clause - macro variable - 3 seconds;
proc sql noprint; select I into :list separated by ',' from LOOKUP;
data _null_; 
  set T1-T60; 
  where I in ( &amp;amp;list );
run; 

%* where clause - dynamic - 3.5 seconds;
%macro loop; 
   %local dsid rc;
   %let dsid=%sysfunc(open(LOOKUP));
   %let rc=%sysfunc(fetch(&amp;amp;dsid));
   %do %while(&amp;amp;rc=0);
     %sysfunc(getvarn(&amp;amp;dsid,%sysfunc(varnum(&amp;amp;dsid,I))))
     %let rc=%sysfunc(fetch(&amp;amp;dsid));
   %end;
   %let rc=%sysfunc(close(&amp;amp;dsid));
%mend;
data _null_; 
  set T1-T60; 
  where I in ( 
  %loop
  );
run; 

%* hash table - 9 seconds;
data _null_; 
  set T1-T60; 
  if _N_=1 then do;
    dcl hash H(dataset:'LOOKUP');
    H.definekey('I');
    H.definedone();
  end;
  if H.check()=0;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 09:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644668#M192594</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-02T09:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644672#M192597</link>
      <description>Thanks, there's 17,000 values in my 'small' table and millions in the big table, so I think the hash table approach is the one.</description>
      <pubDate>Sat, 02 May 2020 09:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644672#M192597</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-02T09:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644674#M192599</link>
      <description>Give it a go.If the hash table is too slow, the where clause should work.SAS slows down dramatically when reading many tables at once but 60 should be alright.&lt;BR /&gt;</description>
      <pubDate>Sat, 02 May 2020 09:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644674#M192599</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-02T09:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644675#M192600</link>
      <description>Yeah, this table would have been setup decades ago, I suspect it's like this because something was simpler to integrate with another system like this. It goes back to a time when very little consideration was given to people actually wanting to access the data.&lt;BR /&gt;&lt;BR /&gt;Not something I have any control over and it's a legacy system, so it's not going to get changed to help me! I've started integrating the new system's data with this and it's at least been done properly!</description>
      <pubDate>Sat, 02 May 2020 09:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/644675#M192600</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-02T09:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648513#M194286</link>
      <description>Thanks for all the help, I've got this all up and running now and it works really well!&lt;BR /&gt;I'm using the same approach for something else and wondered if it was simple to add a couple of extra features:&lt;BR /&gt;&lt;BR /&gt;How do I modify the code so that the lookup table is joined on a key that has a different name in each table?&lt;BR /&gt;&lt;BR /&gt;How do I modify it so that rather than bringing every field from one table into the resulting table it brings only columns (from both tables) that are explicitly defined?&lt;BR /&gt;&lt;BR /&gt;I'm modifying another process to use the same approach, that was done in Query Builder where the Join was defined and columns chosen, so I want to mimic that rather than get the right output in a second step.&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Mon, 18 May 2020 10:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648513#M194286</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-18T10:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648530#M194295</link>
      <description>&lt;P&gt;I should add I modified the code to simply import from a particular table rather than stitch tables together as well.&amp;nbsp; I want to be able to add conditions to this import. New code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if _n_ = 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;declare hash l (dataset:"Server.Lookup");&lt;/P&gt;&lt;P&gt;l.definekey("Ref");&lt;/P&gt;&lt;P&gt;l.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set Server.Data;&lt;/P&gt;&lt;P&gt;if l.check() = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd also like to be able to limit the data coming in by adding where clauses to the above eg, where Date_Column &amp;gt; &amp;amp;Date then yes, otherwise no.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 12:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648530#M194295</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-18T12:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648593#M194325</link>
      <description>&lt;P&gt;You can add additional conditions to the subsetting if.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 15:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648593#M194325</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-18T15:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Appending Tables With Dates in the Table Names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648609#M194331</link>
      <description>&lt;P&gt;Thanks, I think I can work that out.&amp;nbsp; I've spent all afternoon reading about hash tables and I'm struggling with getting the output table to include variables from both the has table and the table I'm filtering.&amp;nbsp; Some pointers for that would be really helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 15:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Appending-Tables-With-Dates-in-the-Table-Names/m-p/648609#M194331</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2020-05-18T15:57:33Z</dc:date>
    </item>
  </channel>
</rss>

