Hello,
I might have overlooked something (summary output?), but is there a standard option which only gives me the lowest level (=raw materials) of a bom and filters out the intermediate products. Does it exist and is there an example for it?
I mean the data step at the end:
Data PS;
Input @1 Material $7. @9 Component $7. @17 Qty 8.;
Datalines;
2001234 4601234 0.3
2001234 4601235 0.2
2001234 4601236 0.4
2001234 4100001 0.05
2001234 4000000 0.15
4601234 4000123 0.5
4601234 4000124 0.5
4601235 8000123 1
4601236 4500000 0.8
4601236 4500001 0.2
;
Run;
Proc SQL;
Create Table PS_2 As
Select Distinct a.Component As Material, '' As Component Length=7, . As Qty
From PS a
Left Join PS b
On a.Component=b.Material
Where Missing (b.Material);
Quit;
Proc Append Base=PS Data=PS_2; Run;
Proc BOM Data=PS
Out=Res;
Structure / Parent=Material
Component=Component
Quantity=Qty
EndItem=('2001234');
Run;
* Standard procedure which is quicker than this ?;
Data Res;
Length Lowest $3.;
Set Res End=Eof;
If not Eof Then Set Res (Firstobs=2 Keep=_LEVEL_ Rename=(_LEVEL_=_LEVEL_SUCC_));
If _LEVEL_ ge _LEVEL_SUCC_ Then Lowest='YES';
Run;
Thanks&kind regards