<?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: Using wildcard when joining tables on several variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127158#M25915</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;KoMartin66&lt;/SPAN&gt;, thank you very much for taking time to make this script. I am totally unaware of hash tables so I need to analyze deeply what you sent then to test it on the real table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll come back to you with comments/results next week (I am leaving in few hours for a 3-day week-end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Oct 2013 16:12:47 GMT</pubDate>
    <dc:creator>ntro</dc:creator>
    <dc:date>2013-10-31T16:12:47Z</dc:date>
    <item>
      <title>Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127152#M25909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't figure how to solve the following issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a reference table named A in which I list combinations of, say, vegetables and fruits. To each combination corresponds a value (Variable result). The keyword "ANY" stands for any occurence of vegetable/fruit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data A;&lt;/P&gt;&lt;P&gt;input Vegetables $ Fruits $ Result;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;Carrot Apple 1&lt;/P&gt;&lt;P&gt;Carrot Pear 2&lt;/P&gt;&lt;P&gt;Tomato Melon 3&lt;/P&gt;&lt;P&gt;Tomato ANY 4&lt;/P&gt;&lt;P&gt;Tomato Banana 5&lt;/P&gt;&lt;P&gt;ANY Apple 6&lt;/P&gt;&lt;P&gt;Potato Banana 7&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have table B which contains pairs of vegetables and fruits for which I need to retrieve the variable result (even if missing):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data B;&lt;/P&gt;&lt;P&gt;input Vegetables $ Fruits $ ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;Tomato Apple&lt;/P&gt;&lt;P&gt;Cuncumber Mango&lt;/P&gt;&lt;P&gt;Potato Banana&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result should look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vegetable Fruit Result&lt;/P&gt;&lt;P&gt;Tomato Apple 4&lt;/P&gt;&lt;P&gt;Tomato Apple 6&lt;/P&gt;&lt;P&gt;Cuncumber Mango .&lt;/P&gt;&lt;P&gt;Potato Banana 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the past, I used to burst(*) the records having the value "ANY" into the different possibilities of vegetables/fruits so my LEFT JOIN worked just fine. But I am now encountering data size issue (Table A has indeed 300 millions of lines) so I would like to keep A lighter which lead me to the above question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ntro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(*): sorry for my english&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 14:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127152#M25909</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-29T14:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127153#M25910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After more thinking and more searches, it seems like the following code works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table B as&lt;/P&gt;&lt;P&gt;select B.*, A.result&lt;/P&gt;&lt;P&gt;from B left join A&lt;/P&gt;&lt;P&gt;on B.Vegetables=TRANWRD(A.Vegetables,"ANY",B.Vegetables)&lt;/P&gt;&lt;P&gt;and&amp;nbsp; B.Fruits=TRANWRD(A.Fruits,"ANY",B.Fruits);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was it so easy? I am missing something?! Can't wait to test it on my large dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone comes with an alternate solution, please do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 15:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127153#M25910</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-29T15:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127154#M25911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am answering to myself for the 2nd time but don't think I am fool!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the TRANWRD solution but I am amazed by the time it takes:&lt;/P&gt;&lt;P&gt;- with table A, totally burst, having 40 millions of combinations, the join on table B (which have about 90k lines) takes 2 minutes;&lt;/P&gt;&lt;P&gt;- with table A, reduced with the "ANY" wildcard, having only 450k of combinations, the join on the same table B with TRANWRD function takes more than 15 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like I am making a cartesian product (the log says so). I think that anytime it finds the wildcard "ANY" in table A, then it joins on all records of table B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So issue is stille there...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: the join is made on 7 variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 16:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127154#M25911</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-29T16:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127155#M25912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?:smileyconfused:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 10:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127155#M25912</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-31T10:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127156#M25913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could tackle the problem with hash tables.&amp;nbsp; The attached script works nicely on your small sample data files, you may need to tweak your system memory settings if table A does indeed have 300 million unique records though.&amp;nbsp; Look at bumping up the MEMSIZE option&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 15:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127156#M25913</guid>
      <dc:creator>KoMartin66</dc:creator>
      <dc:date>2013-10-31T15:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127157#M25914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe tranwrd or custom format to translate 'any' into a sql wildcard '%' then use 'like' in the join instead of '='.&amp;nbsp; The wildcard should match any veg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127157#M25914</guid>
      <dc:creator>asdfghjkl__lpoi87654ewasxcv</dc:creator>
      <dc:date>2013-10-31T16:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127158#M25915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;KoMartin66&lt;/SPAN&gt;, thank you very much for taking time to make this script. I am totally unaware of hash tables so I need to analyze deeply what you sent then to test it on the real table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll come back to you with comments/results next week (I am leaving in few hours for a 3-day week-end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127158#M25915</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-31T16:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127159#M25916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use your smaller list to write CODE.&lt;/P&gt;&lt;P&gt;That would prevent having to do a JOIN of the big table with the smaller table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;select * &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;where &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vegetables in ("ANY","Tomato"&amp;nbsp; ) and fruits in ("ANY","Apple"&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; or &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vegetables in ("ANY","Cucumber") and fruits in ("ANY","Mango"&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; or &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;vegetables in ("ANY","Potato"&amp;nbsp; ) and fruits in ("ANY","Banana"&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127159#M25916</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-10-31T16:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127160#M25917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Tom, this is another solution I am thinking of, and this is why precisely why I open the thread about the "infile". &lt;A _jive_internal="true" href="https://communities.sas.com/thread/50491"&gt;https://communities.sas.com/thread/50491&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 17:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127160#M25917</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2013-10-31T17:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard when joining tables on several variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127161#M25918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't know if this will help when VEG and FRUIT extend to 7 columns, but have a look&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; A;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Vegetables $ Fruits $ Result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Carrot Apple 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Carrot Pear 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Tomato Melon 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Tomato ANY 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Tomato Banana 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;ANY Apple 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Potato Banana 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* pairs of vegetables and fruits for which I need to retrieve the variable result (even if missing):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: green; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Vegetables $ Fruits $ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Tomato Apple&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Cuncumber Mango&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;Potato Banana&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; _METHOD ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;b.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;*, a.result&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.vegetables eq&amp;nbsp;&amp;nbsp; b.vegetables&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.vegetables ne &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.fruits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;SPAN style="color: #008000; font-family: 'Courier New'; font-size: 12px; background-color: #ffffff;"&gt;/*these are joined just on vegetable */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;union&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;b.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;*, a.result &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.fruits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq&amp;nbsp; b.fruits&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.fruits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ne &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.vegetables eq &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; background: white; font-size: 12px; background-color: #ffffff; font-family: 'Courier New';"&gt;/*these are joined just on fruit */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;union&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;b.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;*, a.result &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.fruits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eq&amp;nbsp; b.fruits&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.vegetables EQ&amp;nbsp; b.vegetables&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.fruits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ne &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.vegetables NE &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ANY'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; background: white; font-size: 12px; background-color: #ffffff; font-family: 'Courier New';"&gt;/*these are joined on both so must exclude those "ANY" */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; background: white; font-size: 12px; background-color: #ffffff; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; background: white; font-size: 12px; background-color: #ffffff; font-family: 'Courier New';"&gt;/*not bring together with original */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SORT&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;= B; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Vegetables Fruits&amp;nbsp; ; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SORT&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=A1; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Vegetables Fruits&amp;nbsp; ; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; A2 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;MERGE&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; B A1 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Vegetables Fruits&amp;nbsp; ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Nov 2013 18:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-wildcard-when-joining-tables-on-several-variables/m-p/127161#M25918</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-11-10T18:28:43Z</dc:date>
    </item>
  </channel>
</rss>

