<?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: Joining multiple data sets in a library with conditions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156830#M41111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply Kurt and RW.&lt;/P&gt;&lt;P&gt;I will try to apply your code to this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although just to make sure I give a clear picture of my situation here is an example of the tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;table_A_201310 &lt;/EM&gt;&lt;/SPAN&gt;(all the table_X_20yymm tables are in this form)&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="border: 1px solid #000000; width: 529px; height: 57px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ID_NO&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Date&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1231231&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12OCT2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200.63&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Hardware&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3453123&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;29OCT2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;99.95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Digital&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;table_ID &lt;/EM&gt;&lt;/SPAN&gt;is a table of specific ID-numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;table_ID &lt;/EM&gt;(Extracted ID numbers which I want to an analysis on)&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 122px; height: 55px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID_NO&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1231231&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3237132&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;3453123&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a lot of &lt;EM&gt;&lt;STRONG&gt;table_A_20yymm&lt;/STRONG&gt; tables&lt;/EM&gt; and also a lot of &lt;EM&gt;&lt;STRONG&gt;table_B_20yymm&lt;/STRONG&gt; tables&lt;/EM&gt; but I only want to match a couple of the &lt;STRONG&gt;&lt;EM&gt;table_A_20yymm&lt;/EM&gt;&lt;/STRONG&gt; tables to the &lt;STRONG&gt;&lt;EM&gt;Table_ID&lt;/EM&gt;&lt;/STRONG&gt; table and also then I want to exclude all the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;&lt;STRONG&gt;table_B_20yymm&lt;/STRONG&gt; tables.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially what I'm trying to do is to &lt;STRONG&gt;combine&lt;/STRONG&gt; all the table_A_201301, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201302, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201303,...., &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201312 tables which contains all the observations of the ID_NO's in the Table_ID table. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Does this make sense ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 13:51:06 GMT</pubDate>
    <dc:creator>mjheever</dc:creator>
    <dc:date>2015-02-06T13:51:06Z</dc:date>
    <item>
      <title>Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156827#M41108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings everyone !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this issue where I want to join multiple data sets in a specific library together.&lt;/P&gt;&lt;P&gt;Say you have library &lt;EM&gt;LibExample &lt;/EM&gt;which consists of a number of tables by date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;LibExample:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201310&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_B_201310&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201311&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_B_201311&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201312&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_B_201312&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201401&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_B_201401&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201402&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;table_A_201412&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;All the tables are in the same format and have the same attributes.&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Say I have a different table consisting of a selection of specific ID's, call this &lt;EM&gt;table_ID.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I want to get all the observations from the date tables which matches the ID's in the &lt;/SPAN&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;table_ID.&lt;/EM&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of my current&amp;nbsp; code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%macro get() ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select ID_No into :accnts separated by ", " from &lt;EM&gt;table_ID&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;proc contents data = &lt;EM style="font-size: 13.3333330154419px;"&gt;LibExample&lt;/EM&gt;._all_ out = All_tables noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;proc sort data = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;All_tables&lt;/SPAN&gt; nodupkey;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by descending memname ;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data All_Tables_Names(drop=i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &lt;SPAN style="font-size: 13.3333330154419px;"&gt;All_tables&lt;/SPAN&gt;(keep=MEMNAME);&lt;/P&gt;&lt;P&gt;&amp;nbsp; where memname like "Table_A_%";&lt;/P&gt;&lt;P&gt;&amp;nbsp; i = monotonic();&lt;/P&gt;&lt;P&gt;&amp;nbsp; if i &amp;lt;= 13 then output; /*takes the latest year's table*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &lt;SPAN style="font-size: 13.3333330154419px;"&gt;All_Tables_Names&lt;/SPAN&gt; END = EOF;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by descending memname ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;file "&amp;amp;work./Tables.sas";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format putstr $1000.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ = 1 then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'data Combined_Tables; set ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.memname then do;&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; putstr = "Libexample." || compress(memname) ||;&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; put putstr ;&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; end;&lt;/P&gt;&lt;P&gt;&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; if EOF then do;&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; put ";";&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; &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&amp;nbsp; putstr = "where ID_No in (&amp;amp;accnts.);";&lt;/EM&gt; &lt;/SPAN&gt;&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; put putstr ;&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; put "run;";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%include "&amp;amp;work./&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Tables&lt;/SPAN&gt;.sas";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%get();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The underlined part is where presume the problem is, since I'm getting an the follow error message: ERROR: Syntax error while parsing WHERE clause. &lt;/P&gt;&lt;P&gt;I'm not sure if there is a 'better' or more efficient way to pair&amp;nbsp; the 'where' clause with, regarding an array of values.&lt;/P&gt;&lt;P&gt;I've tried to play around with put and input functions to resolve the issue but had no luck.&lt;/P&gt;&lt;P&gt;Please note that ID_No is a numeric variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 12:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156827#M41108</guid>
      <dc:creator>mjheever</dc:creator>
      <dc:date>2015-02-06T12:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156828#M41109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create tables all_tables as select trim (libname)!!'.'!!trim(memname) as memname from dictionary.tables where libname = "LIBEX";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;proc sort data=all_tables;&lt;/P&gt;&lt;P&gt;by descending memname;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data all_tables;&lt;/P&gt;&lt;P&gt;set all_tables (obs=12);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select memname into :tables separated by " " from all_tables;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set &amp;amp;tables;&lt;/P&gt;&lt;P&gt;if _n_ = 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length ID_No 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; declare hash h(dataset:"table_id");&lt;/P&gt;&lt;P&gt;&amp;nbsp; h.definekey("ID_No");&lt;/P&gt;&lt;P&gt;&amp;nbsp; h.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp; call missing (ID_No);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;rc = h.find();&lt;/P&gt;&lt;P&gt;if rc = 0 then output;&lt;/P&gt;&lt;P&gt;drop rc;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did it without testing, so you may have to fiddle with the hash object definition and usage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: did some corrections, should work now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 12:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156828#M41109</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-02-06T12:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156829#M41110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming I understand your logic:&lt;/P&gt;&lt;P&gt;data table_a_201310 table_b_201310 table_a_201311 table_b_201311;&lt;BR /&gt;&amp;nbsp; id="001"; a="a"; output;&lt;BR /&gt;&amp;nbsp; id="002"; a="b"; output;&lt;BR /&gt;&amp;nbsp; id="003"; a="c"; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data ids;&lt;BR /&gt;&amp;nbsp; id="001"; output;&lt;BR /&gt;&amp;nbsp; id="003"; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; create table WANT &lt;BR /&gt;&amp;nbsp; ( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id char(8),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a char(8)&lt;BR /&gt;&amp;nbsp; );&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; set sashelp.vtable (where=(libname="WORK" and substr(memname,1,5)="TABLE"));&lt;BR /&gt;&amp;nbsp; call execute('proc sql;&lt;BR /&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; insert into WANT&lt;BR /&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; select&amp;nbsp; *&lt;BR /&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; from&amp;nbsp;&amp;nbsp;&amp;nbsp; WORK.'||strip(memname)||'&lt;BR /&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; where&amp;nbsp;&amp;nbsp; ID in (select distinct ID from WORK.IDS);&lt;BR /&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; quit;');&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156829#M41110</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-06T13:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156830#M41111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply Kurt and RW.&lt;/P&gt;&lt;P&gt;I will try to apply your code to this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although just to make sure I give a clear picture of my situation here is an example of the tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;table_A_201310 &lt;/EM&gt;&lt;/SPAN&gt;(all the table_X_20yymm tables are in this form)&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="border: 1px solid #000000; width: 529px; height: 57px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ID_NO&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Date&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1231231&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12OCT2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200.63&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Hardware&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3453123&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;29OCT2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;99.95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Digital&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;EM&gt;table_ID &lt;/EM&gt;&lt;/SPAN&gt;is a table of specific ID-numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;table_ID &lt;/EM&gt;(Extracted ID numbers which I want to an analysis on)&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 122px; height: 55px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID_NO&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;1231231&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3237132&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;3453123&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a lot of &lt;EM&gt;&lt;STRONG&gt;table_A_20yymm&lt;/STRONG&gt; tables&lt;/EM&gt; and also a lot of &lt;EM&gt;&lt;STRONG&gt;table_B_20yymm&lt;/STRONG&gt; tables&lt;/EM&gt; but I only want to match a couple of the &lt;STRONG&gt;&lt;EM&gt;table_A_20yymm&lt;/EM&gt;&lt;/STRONG&gt; tables to the &lt;STRONG&gt;&lt;EM&gt;Table_ID&lt;/EM&gt;&lt;/STRONG&gt; table and also then I want to exclude all the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;&lt;STRONG&gt;table_B_20yymm&lt;/STRONG&gt; tables.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially what I'm trying to do is to &lt;STRONG&gt;combine&lt;/STRONG&gt; all the table_A_201301, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201302, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201303,...., &lt;SPAN style="font-size: 13.3333330154419px;"&gt;table_A_201312 tables which contains all the observations of the ID_NO's in the Table_ID table. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Does this make sense ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156830#M41111</guid>
      <dc:creator>mjheever</dc:creator>
      <dc:date>2015-02-06T13:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156831#M41112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just need a suitable where condition when reading dictionary.tables (or sashelp.vtables in a data step).&lt;/P&gt;&lt;P&gt;The hash method is quite robust with large lookup tables and works without sorting any of the tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156831#M41112</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-02-06T13:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining multiple data sets in a library with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156832#M41113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes thank you Kurt, so far that seems like the best option in this situation.&lt;/P&gt;&lt;P&gt;I haven't use hash method yet so I'm trying to figure it out just now - I will keep you updated on my progress &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 14:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Joining-multiple-data-sets-in-a-library-with-conditions/m-p/156832#M41113</guid>
      <dc:creator>mjheever</dc:creator>
      <dc:date>2015-02-06T14:03:30Z</dc:date>
    </item>
  </channel>
</rss>

