<?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 Get a full list of possible combinations of an asymmetric tree in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176490#M302296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to get a full list of possible combinations af an asymmetric tree (which I think is the most general description of my problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my particular case, I am dealing with different recipies to produce certain products, this is the same product can be made combining various, but descrete sets of components. For example, bill-of-materials &lt;STRONG style="color: #ff00ff;"&gt;alternative #1&lt;/STRONG&gt; says that product 200 0000 can be made either of&lt;STRONG style="color: #ff00ff;"&gt; 40 % material 400 0000&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;SPAN style="color: #ff00ff;"&gt;60 % intermediate product 4600000&lt;/SPAN&gt;. &lt;/STRONG&gt;Product 200 0000 could be made&amp;nbsp; as well with &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;40 % raw material 4000009&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;60 % intermediate product 4600000&lt;/STRONG&gt;&lt;/SPAN&gt; &amp;lt;- this is &lt;SPAN style="color: #99cc00;"&gt;&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;alternative #2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt; &lt;/SPAN&gt;and so on.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;* this is a list of potential bill-of-materials, actually there could be many final more products like 200 0000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;Data ProductStructure;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; Input @1 Parent $7. @9 Component $7. @17 Alternative $2. Percentage_Quantity;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; Datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000000 01 0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 01 0.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000009 02 0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 02 0.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000000 03 0.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 03 0.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500000 01 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500000 02 0.8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500001 02 0.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500001 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500004 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG style="color: #339966;"&gt;* the goal is a complete list, this is a "permutation", of all possible BoM-combinations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;/* &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;BoM #1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.4 units 4000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.6 units 4600000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500000 01 1&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; alternative 01 of 4600000 (!!)&amp;nbsp; consists of 1 unit 4500000&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.4 units 4000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.6 units 4600000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500000 02 0.8&amp;nbsp; -&amp;gt; alternative 02 of 4600000 (!!) consists of 0.8 units 4500000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 02 0.2&amp;nbsp; -&amp;gt; alternative 02 of 4600000 (!! )consists of 0.2 units 4500001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 03 0.5&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500004 03 0.5&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #x:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 03 0.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 03 0.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500004 03 0.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current approach would be to carry out a couple of merges to get to the wanted result. My question is, if there is a better/quicker way - in the best case a standard SAS-function (Proc BOM will only work for single product-component relationships) - to achieve this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2014 15:01:33 GMT</pubDate>
    <dc:creator>user24feb</dc:creator>
    <dc:date>2014-10-08T15:01:33Z</dc:date>
    <item>
      <title>Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176490#M302296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to get a full list of possible combinations af an asymmetric tree (which I think is the most general description of my problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my particular case, I am dealing with different recipies to produce certain products, this is the same product can be made combining various, but descrete sets of components. For example, bill-of-materials &lt;STRONG style="color: #ff00ff;"&gt;alternative #1&lt;/STRONG&gt; says that product 200 0000 can be made either of&lt;STRONG style="color: #ff00ff;"&gt; 40 % material 400 0000&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;SPAN style="color: #ff00ff;"&gt;60 % intermediate product 4600000&lt;/SPAN&gt;. &lt;/STRONG&gt;Product 200 0000 could be made&amp;nbsp; as well with &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;40 % raw material 4000009&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;60 % intermediate product 4600000&lt;/STRONG&gt;&lt;/SPAN&gt; &amp;lt;- this is &lt;SPAN style="color: #99cc00;"&gt;&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;alternative #2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt; &lt;/SPAN&gt;and so on.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;* this is a list of potential bill-of-materials, actually there could be many final more products like 200 0000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;Data ProductStructure;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; Input @1 Parent $7. @9 Component $7. @17 Alternative $2. Percentage_Quantity;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; Datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000000 01 0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 01 0.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000009 02 0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 02 0.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4000000 03 0.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;2000000 4600000 03 0.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500000 01 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500000 02 0.8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500001 02 0.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500001 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;4600000 4500004 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-family: courier new,courier;"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG style="color: #339966;"&gt;* the goal is a complete list, this is a "permutation", of all possible BoM-combinations;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;/* &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;BoM #1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.4 units 4000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.6 units 4600000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500000 01 1&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; alternative 01 of 4600000 (!!)&amp;nbsp; consists of 1 unit 4500000&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.4 units 4000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; -&amp;gt; alternative 01 of 2000000 consists of 0.6 units 4600000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500000 02 0.8&amp;nbsp; -&amp;gt; alternative 02 of 4600000 (!!) consists of 0.8 units 4500000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 02 0.2&amp;nbsp; -&amp;gt; alternative 02 of 4600000 (!! )consists of 0.2 units 4500001&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 01 0.4&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 01 0.6&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 03 0.5&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500004 03 0.5&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;BoM #x:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4000000 03 0.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;2000000 4600000 03 0.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500001 03 0.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;4600000 4500004 03 0.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current approach would be to carry out a couple of merges to get to the wanted result. My question is, if there is a better/quicker way - in the best case a standard SAS-function (Proc BOM will only work for single product-component relationships) - to achieve this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 15:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176490#M302296</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-10-08T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176491#M302297</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 table want as&lt;/P&gt;&lt;P&gt;select * from ProductStructure,ProductStructure(rename=(parent=_parent component=_component&lt;/P&gt;&lt;P&gt;Alternative=_Alternative Percentage_Quantity=_Percentage_Quantity));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 15:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176491#M302297</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-08T15:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176492#M302298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! I'm afraid it's a bit more complicated. The desired dataset is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;Product Component Quantity BoM_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4000000 0.4 2000000_01_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500000 0.6 2000000_01_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 8pt;"&gt;2000000 4000000 0.4 2000000_01_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 8pt;"&gt;2000000 4500000 0.48 2000000_01_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 8pt;"&gt;2000000 4500001 0.12 2000000_01_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4000000 0.4 2000000_01_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500001 0.3 2000000_01_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500004 0.3 2000000_01_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 8pt;"&gt;2000000 4000009 0.4 2000000_02_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 8pt;"&gt;2000000 4500000 0.6 2000000_02_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4000009 0.4 2000000_02_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500000 0.48 2000000_02_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500001 0.12 2000000_02_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 8pt;"&gt;2000000 4000009 0.4 2000000_02_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 8pt;"&gt;2000000 4500001 0.3 2000000_02_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 8pt;"&gt;2000000 4500004 0.3 2000000_02_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4000000 0.3 2000000_03_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500000 0.7 2000000_03_4600000_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;2000000 4000000 0.3 2000000_03_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;2000000 4500000 0.56 2000000_03_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;2000000 4500001 0.14 2000000_03_4600000_02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4000000 0.3 2000000_03_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500001 0.35 2000000_03_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399; font-size: 8pt;"&gt;2000000 4500004 0.35 2000000_03_4600000_03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code - which unfortunately has its limitations - that gets me there is in the attached files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 08:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176492#M302298</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-10-09T08:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176493#M302299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works only if one component belongs to one parent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data ProductStructure;&lt;BR /&gt;&amp;nbsp; Input @1 Parent $7. @9 Component $7. @17 Alternative $2. Percentage_Quantity;&lt;BR /&gt;&amp;nbsp; dummy=Parent!!"_"!!Component!!"_"!!Alternative;&lt;BR /&gt;&amp;nbsp; Datalines;&lt;BR /&gt;2000000 4000000 01 0.4&lt;BR /&gt;2000000 4600000 01 0.6&lt;BR /&gt;2000000 4000009 02 0.4&lt;BR /&gt;2000000 4600000 02 0.6&lt;BR /&gt;2000000 4000000 03 0.3&lt;BR /&gt;2000000 4600000 03 0.7&lt;BR /&gt;4600000 4500000 01 1&lt;BR /&gt;4600000 4500000 02 0.8&lt;BR /&gt;4600000 4500001 02 0.2&lt;BR /&gt;4600000 4500001 03 0.5&lt;BR /&gt;4600000 4500004 03 0.5&lt;BR /&gt;3000000 4000000 01 0.5&lt;BR /&gt;3000000 4700000 01 0.5&lt;BR /&gt;3000000 4000009 02 0.6&lt;BR /&gt;3000000 4700000 02 0.4&lt;BR /&gt;4700000 4500000 01 1&lt;BR /&gt;4700000 4500000 02 0.8&lt;BR /&gt;4700000 4500001 02 0.2&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table int as (&lt;BR /&gt;select x.parent, coalesce(y.inicomp, x.component) as component,x.alternative, coalesce(Percentage_Quantity*iniperc,x.Percentage_Quantity) as percent, x.component as subcomp&lt;BR /&gt;from ProductStructure (drop=dummy) x &lt;BR /&gt;left join&lt;BR /&gt;(&lt;BR /&gt;select b.parent as inipar,b.component as inicomp, b.alternative as inialt, b.Percentage_Quantity as iniperc&lt;BR /&gt;from ProductStructure a , ProductStructure b&lt;BR /&gt;where a.component=b.parent and a.alternative=b.alternative) y&lt;BR /&gt;on x.component=y.inipar&lt;/P&gt;&lt;P&gt;where x.parent not in &lt;BR /&gt;(select b.parent&lt;BR /&gt;from ProductStructure a , ProductStructure b&lt;BR /&gt;where a.component=b.parent and a.alternative=b.alternative))&lt;BR /&gt;order by parent, alternative, inialt&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data want; &lt;BR /&gt;retain&amp;nbsp; Perc_Ini Comp_Ini Perc_Ini ;*keep initial values;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;set int;&lt;BR /&gt;by parent alternative;*data already from sorted from the sql syntax;&lt;/P&gt;&lt;P&gt;BoM_ID=catx("_",parent,alternative,subcomp,alternative);&lt;/P&gt;&lt;P&gt;output;*write the current record to data set;&lt;BR /&gt;percsum+percent;&lt;/P&gt;&lt;P&gt;if first.alternative then /*set initial values;*/&lt;BR /&gt; do;&lt;BR /&gt;&amp;nbsp; Comp_Ini=component;&lt;BR /&gt;&amp;nbsp; Perc_Ini=percent;&lt;BR /&gt;&amp;nbsp; percsum=Perc_Ini;&lt;BR /&gt; end;&lt;/P&gt;&lt;P&gt;if round(percsum,0.1)=1 and not last.alternative then /*write a second line to data set if sum of percents is 1 and not the last record within group*/&lt;BR /&gt; do;&lt;BR /&gt;&amp;nbsp; component=Comp_Ini;&lt;BR /&gt;&amp;nbsp; percent=Perc_Ini;&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp; percsum=Perc_Ini;&lt;BR /&gt; end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop Perc_Ini Comp_Ini Perc_Ini percsum subcomp;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176493#M302299</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-10-09T13:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176494#M302300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there just two Prouct (Parent) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;Data ProductStructure;
&amp;nbsp; Input @1 Parent $7. @9 Component $7. @17 Alternative $2. Percentage_Quantity;
&amp;nbsp; Datalines;
2000000 4000000 01 0.4
2000000 4600000 01 0.6
2000000 4000009 02 0.4
2000000 4600000 02 0.6
2000000 4000000 03 0.3
2000000 4600000 03 0.7
4600000 4500000 01 1
4600000 4500000 02 0.8
4600000 4500001 02 0.2
4600000 4500001 03 0.5
4600000 4500004 03 0.5
&amp;nbsp; ;
Run;
proc sort data=ProductStructure(keep=Parent Alternative) out=temp nodupkey; by Parent Alternative ;run;
data key(drop= n);
 set temp end=last nobs=nobs;
 retain n;
 if parent ne lag(parent) then n=_n_;
 if last then do;
&amp;nbsp; do i=1 to n-1;
&amp;nbsp;&amp;nbsp; do j=n to nobs;
&amp;nbsp;&amp;nbsp;&amp;nbsp; bom+1;
&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp point=i; output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp point=j; output;
&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; end;
end;
run;
data want(drop=rc);
 if _n_ eq 1 then do;
&amp;nbsp; if 0 then set ProductStructure;
&amp;nbsp; declare hash ha(dataset:'ProductStructure',multidata:'y');
&amp;nbsp;&amp;nbsp; ha.definekey('Parent', 'Alternative');
&amp;nbsp;&amp;nbsp; ha.definedata(all:'y');
&amp;nbsp;&amp;nbsp; ha.definedone();
end;
set key;
rc=ha.find();
do while(rc=0);
 output;
 rc=ha.find_next();
end;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176494#M302300</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-09T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176495#M302301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow.&lt;/P&gt;&lt;P&gt;You know a lot more than me and I am afraid I don't fully understand what the hash-part of the program does. Could you please explain?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(drop=rc);&lt;/P&gt;&lt;P&gt; if _n_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if 0 then set ProductStructure; * what is eqal to 0 ?;&lt;/P&gt;&lt;P&gt;&amp;nbsp; declare hash ha(dataset:'ProductStructure',multidata:'y'); * allow multiple observations;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ha.definekey('Parent', 'Alternative'); *&amp;nbsp; why 2 keys?;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ha.definedata(all:'y'); * ?;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ha.definedone();&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;set key;&lt;/P&gt;&lt;P&gt;rc=ha.find();&lt;/P&gt;&lt;P&gt;do while(rc=0); * why if 0 - zero means nothing was found;&lt;/P&gt;&lt;P&gt; output;&lt;/P&gt;&lt;P&gt; rc=ha.find_next(); &lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 16:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176495#M302301</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-10-09T16:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176496#M302302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is just simply pick up the corresponding Obs from dataset &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ProductStructure&lt;/SPAN&gt; ,according to the key(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Parent&lt;/SPAN&gt; and &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Alternative&lt;/SPAN&gt;) value of dataset KEY .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; * what is eqal to 0 ?;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;It is just to initial the variable which used for Hash Table , otherwise you can't build a Hash Table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;*&amp;nbsp; why 2 keys?;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;The reason is I make all of combination based on these two variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ha.definedata(all:'y'); * ?;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Include all of variable in dataset &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ProductStructure&lt;/SPAN&gt; be the DATA field of Hash Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; * why if 0 - zero means nothing was found;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Means if I find one (=0), I will continue to find next (&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;rc=ha.find_next();&lt;/SPAN&gt;) . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 11:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176496#M302302</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-10T11:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176497#M302303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;attached is a program, that has no restrictions on the product sturcture (Of course do avoid cycles! &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;P&gt;Sorry, it is not very well documented, and maybe it is easyer to write this program, than to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important:&lt;/P&gt;&lt;P&gt;You will need one additional pass through the results, because if a component is included on multiple products paths, it will appeare multiple times in the result. (You have no such cases in the attached product stucture.) I think you can easily aggregate them. (I didn't want to complicate this program any further.)&lt;/P&gt;&lt;P&gt;Also in my program BOM_id is simply a number. If you have multiple levels in the product tree, it makes no more sense to include this info in an ID field. Is it? Anyway, you can consturct a (very long) character variable that can include the "path" of the product decomposition.&lt;/P&gt;&lt;P&gt;Look at this formula in my program: &lt;STRONG&gt;bom_quant*Percentage_Quantity&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; Similarly you can constuct a variable like this: &lt;STRONG&gt;bom_path || Parent || Alternative&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;I have changed your input data a bit: I included more levels.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Currently this program reads a dataset called Parts. The program could be easily exteded to handle more parts, but right now it expands only 1 row (=1 Part).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Be carefull with big product trees. The result can become quickly huge. (I guess you know that.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Algorithm:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;We maintain a list of BOMs in an internal table (&lt;/SPAN&gt;bom_list&lt;SPAN style="font-size: 10pt;"&gt;). We initialize this table with one row: the unexpanded part list (unexpanded BOM).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;We go through this list again and again and when we find a &lt;STRONG&gt;Part&lt;/STRONG&gt;, that can be expanded (i.e. it is in the &lt;STRONG&gt;productStucture&lt;/STRONG&gt; table as &lt;STRONG&gt;Parent&lt;/STRONG&gt;), we expand it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Expanding means &lt;SPAN style="text-decoration: line-through;"&gt;simply&lt;/SPAN&gt; copying all the entries (rows) of a BOM &lt;STRONG&gt;numAlternatives&lt;/STRONG&gt; times. While copying, we keep all entries as they are, except the entry, that should be expanded. That entry is replaced and sometimes also doubled/tripled/etc., depenting how many &lt;STRONG&gt;Children&lt;/STRONG&gt; (Components) the &lt;STRONG&gt;Parent&lt;/STRONG&gt; has.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;The rest is just technical (not algorithmical) thing: I am dynamically adding and removing from this internal (hash) table. I am using an iterator to "walk" through it. Also I am using some more hash tables, and iterators to make my life easier. See inline comments in the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Technically I don't re-read the &lt;STRONG&gt;bom_list&lt;/STRONG&gt; table, I am reading it only once. But while reading I am appending new entries to the end of the list(table).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 09:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176497#M302303</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2014-10-13T09:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176498#M302304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ksharp and Gergely Batho!! The Hash-idea is the key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 06:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176498#M302304</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-10-16T06:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176499#M302305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;simple cartesian join with a wrapping select criteria?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct * from&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt; select&lt;/P&gt;&lt;P&gt; a.key, a.var1, a.var2...&lt;/P&gt;&lt;P&gt; b.key as b.key_, b.var1, b.var2&lt;/P&gt;&lt;P&gt; from table1 a, table2 b&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;where (a.key = b.key_);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;provided you have enough space/memory/ etc. to do this all in one step?&lt;/P&gt;&lt;P&gt;or maybe it's not this simple?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 14:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176499#M302305</guid>
      <dc:creator>weigel_s</dc:creator>
      <dc:date>2015-04-13T14:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get a full list of possible combinations of an asymmetric tree</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176500#M302306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood your program correctly, it is not what I was up to. In fact, my final code was very similar to Xia Keshan's (will set his answer to correct shortly). I hope the following code demonstrates, why I did not choose proc sql but a hash table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data A;&lt;BR /&gt;&amp;nbsp; Input Prod Comp;&lt;BR /&gt;&amp;nbsp; Datalines;&lt;BR /&gt;1 33&lt;BR /&gt;1 44&lt;BR /&gt;2 11&lt;BR /&gt;2 55&lt;BR /&gt;2 66&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Data B;&lt;BR /&gt;&amp;nbsp; Input Comp Subcomp;&lt;BR /&gt;&amp;nbsp; Datalines;&lt;BR /&gt;33 111&lt;BR /&gt;33 222&lt;BR /&gt;55 666&lt;BR /&gt;55 777&lt;BR /&gt;55 888&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;BR /&gt;&amp;nbsp; Select A.Prod, A.Comp, B.Subcomp From A, B Where A.Comp eq B.Comp;&lt;BR /&gt;Quit;&lt;/P&gt;&lt;P&gt;Data Want (Drop=rc);&lt;BR /&gt;&amp;nbsp; Length Comp 8. Subcomp 8.;&lt;BR /&gt;&amp;nbsp; If _N_ eq 1 Then Do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Declare Hash H (Dataset:'B',Multidata:'y');&lt;BR /&gt; H.Definekey('Comp');&lt;BR /&gt; H.Definedata('Subcomp');&lt;BR /&gt; H.Definedone();&lt;BR /&gt; Call Missing (Comp, Subcomp);&lt;BR /&gt;&amp;nbsp; End;&lt;BR /&gt;&amp;nbsp; Do While (not Eof);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set A End=Eof;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=H.Find();&lt;BR /&gt; If (rc) Then Do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call Missing (Subcomp);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Output;&lt;BR /&gt; End;&lt;BR /&gt; Do While (not rc);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rc=H.Find_next();&lt;BR /&gt; End;&lt;BR /&gt;&amp;nbsp; End;&lt;BR /&gt;Run;&lt;BR /&gt;Proc Print Data=Want; Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 06:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-a-full-list-of-possible-combinations-of-an-asymmetric-tree/m-p/176500#M302306</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2015-04-14T06:20:16Z</dc:date>
    </item>
  </channel>
</rss>

