<?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: Proc BOM base SQL in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573145#M12454</link>
    <description>There isn't one and BOM problems usually need recursion which SQL doesn't do well at all. There is a macro in the library here (sub_graph_macro) that uses hash tables to accomplish similar solutions - usually similar to traversing a tree - mathematically speaking.</description>
    <pubDate>Fri, 12 Jul 2019 15:33:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-07-12T15:33:20Z</dc:date>
    <item>
      <title>Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573142#M12453</link>
      <description>&lt;P&gt;We recently did some work for a customer using Proc BOM.&amp;nbsp; Now the customer is asking for the SQL so that they can do the same procedure on other packages on their own.&amp;nbsp; I have looked and have not been able to find a SQL version of the BOM procedure.&amp;nbsp; Any help, ideas, or pointers would be helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 15:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573142#M12453</guid>
      <dc:creator>TBarney</dc:creator>
      <dc:date>2019-07-12T15:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573145#M12454</link>
      <description>There isn't one and BOM problems usually need recursion which SQL doesn't do well at all. There is a macro in the library here (sub_graph_macro) that uses hash tables to accomplish similar solutions - usually similar to traversing a tree - mathematically speaking.</description>
      <pubDate>Fri, 12 Jul 2019 15:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573145#M12454</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T15:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573149#M12455</link>
      <description>Thank you, the mathematician I am working with is aware of the macro, however the group asking the question is non-SAS and very SQL.  &lt;BR /&gt;Thank you for the quick response.</description>
      <pubDate>Fri, 12 Jul 2019 15:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573149#M12455</guid>
      <dc:creator>TBarney</dc:creator>
      <dc:date>2019-07-12T15:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573159#M12460</link>
      <description>It's possible there's a SQL solution, it depends on the data complexity.</description>
      <pubDate>Fri, 12 Jul 2019 16:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573159#M12460</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T16:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573288#M12470</link>
      <description>&lt;P&gt;It depends on how many layer you want to search .&lt;/P&gt;
&lt;P&gt;Here is an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input from to;
cards;
1 2
1 4
2 6
2 8
6 9
;

proc sql;
/*first layer*/
create table first as
 select a.*,b.to as to1
  from have as a left join have as b
   on a.to=b.from;

/*second layer*/
create table second as
 select a.*,b.to as to2
  from first as a left join have as b
   on a.to1=b.from;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Jul 2019 12:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573288#M12470</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-07-13T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc BOM base SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573303#M12478</link>
      <description>And if you know the number of layers ahead of time, which is often the actual issue...you don't know the depth of the tree ahead of time.</description>
      <pubDate>Sat, 13 Jul 2019 18:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-BOM-base-SQL/m-p/573303#M12478</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-13T18:25:24Z</dc:date>
    </item>
  </channel>
</rss>

