We recently did some work for a customer using Proc BOM. Now the customer is asking for the SQL so that they can do the same procedure on other packages on their own. I have looked and have not been able to find a SQL version of the BOM procedure. Any help, ideas, or pointers would be helpful.
It depends on how many layer you want to search .
Here is an example.
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;
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.