Hello, 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). 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 alternative #1 says that product 200 0000 can be made either of 40 % material 400 0000 and 60 % intermediate product 4600000. Product 200 0000 could be made as well with 40 % raw material 4000009 and 60 % intermediate product 4600000 <- this is alternative #2, and so on. * this is a list of potential bill-of-materials, actually there could be many final more products like 200 0000; Data ProductStructure; Input @1 Parent $7. @9 Component $7. @17 Alternative $2. Percentage_Quantity; 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 ; Run; * the goal is a complete list, this is a "permutation", of all possible BoM-combinations; /* BoM #1: 2000000 4000000 01 0.4 -> alternative 01 of 2000000 consists of 0.4 units 4000000 2000000 4600000 01 0.6 -> alternative 01 of 2000000 consists of 0.6 units 4600000 4600000 4500000 01 1 -> alternative 01 of 4600000 (!!) consists of 1 unit 4500000 BoM #2: 2000000 4000000 01 0.4 -> alternative 01 of 2000000 consists of 0.4 units 4000000 2000000 4600000 01 0.6 -> alternative 01 of 2000000 consists of 0.6 units 4600000 4600000 4500000 02 0.8 -> alternative 02 of 4600000 (!!) consists of 0.8 units 4500000 4600000 4500001 02 0.2 -> alternative 02 of 4600000 (!! )consists of 0.2 units 4500001 BoM #3: 2000000 4000000 01 0.4 2000000 4600000 01 0.6 4600000 4500001 03 0.5 4600000 4500004 03 0.5 .. BoM #x: 2000000 4000000 03 0.3 2000000 4600000 03 0.7 4600000 4500001 03 0.5 4600000 4500004 03 0.5 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. Thanks&kind regards
... View more