Bill of Material with Lead Time Information (bom2)
/**************************************************************/
/* */
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: BOM2 */
/* TITLE: Bill of Material with Lead Time Information (bom2)*/
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: OR PPLOT */
/* PROCS: BOM, PRINT, SORT, NETDRAW */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: Example 2 from the BOM Procedure chapter of the */
/* BOM book. */
/* */
/**************************************************************/
/* Product Structure and Part Master data */
data SlBOM2;
input Parent $8.
Component $8.
Desc $24.
Unit $8.
LeadTime 4.0
QtyPer 4.0
Gros_Req 4.0
On_Hand 4.0
;
datalines;
LA01 Lamp LA Each 2 . 50 20
LA01 B100 Base assembly Each 1 1 . 50
LA01 S100 Black shade Each 2 1 . .
LA01 A100 Socket assembly Each 1 1 . .
B100 1100 Finished shaft Each 2 1 . .
B100 1200 6-Diameter steel plate Each 3 1 . .
B100 1300 Hub Each 2 1 . .
B100 1400 1/4-20 Screw Each 1 4 . .
A100 1500 Steel holder Each 2 1 . .
A100 1600 One-way socket Each 2 1 . .
A100 1700 Wiring assembly Each 1 1 . .
1100 2100 3/8 Steel tubing Inches 3 26 . .
1500 1400 1/4-20 Screw Each 1 2 . .
1700 2200 16-Gauge lamp cord Feet 2 12 . .
1700 2300 Standard plug terminal Each 1 1 . .
;
/* Display the input data set */
proc print data=SlBOM2 noobs;
title 'ABC Lamp Company';
title3 'PROC BOM Input Data Set';
run;
/* Create the indented BOM and the summarized parts list */
proc bom data=SlBOM2 out=IndBOM2 summaryout=SumBOM2;
structure / part=Component
leadtime=LeadTime
parent=Parent
component=Component
quantity=QtyPer
qtyonhand=On_hand
requirement=Gros_Req
id=(Desc Unit);
run;
/* Display the indented BOM data */
proc print data=IndBOM2 noobs;
var _Level_ _Parent_ _Part_ Desc QtyPer Qty_Prod
Unit LeadTime Tot_Lead _Prod_;
title 'ABC Lamp Company';
title3 'Indented Bill of Material, Part LA01';
run;
/* Sort and display the summarized parts list */
proc sort data=SumBOM2;
by _Part_;
run;
proc print data=SumBOM2 noobs;
title 'ABC Lamp Company';
title3 'Summarized Parts List, Period 2';
run;
/* Prepare the data set for running NETDRAW */
data IndBOM2a(drop=Part_ID);
set IndBOM2;
Paren_ID=Part_ID;
run;
data IndBOM2b;
set IndBOM2(keep=Paren_ID Part_ID);
run;
data TreBOM2;
set IndBOM2a IndBOM2b;
LTnQP = put(LeadTime, f3.)||" "||put(QtyPer, f3.);
run;
/* Specify graphics options */
title h=4pct j=c 'Multilevel Bill of Material with Lead-time Offsetting';
footnote h=3pct j=l
'Node shows Part Number, Lead-time, and Quantity Required';
pattern1 v=e c=blue;
/* Get the layout information for the BOM tree */
proc netdraw data=TreBOM2( where=(Paren_ID NE .) )
out=Layout2 nodisplay;
actnet / act=Paren_ID succ=Part_ID id=(_Part_ LTnQP Tot_Lead)
ybetween=3 xbetween=15 tree
rectilinear nodefid nolabel;
run;
/* Lead time offset the X coordinate of each node */
data TreBOM2a;
set Layout2;
if _seq_ = 0;
drop _seq_;
_x_ = Tot_Lead;
run;
/* Display the BOM tree with lead-time offsetting */
proc netdraw data=TreBOM2a out=NetOUT;;
actnet / id=(_Part_ LTnQP)
ctext=black htext=3 carcs=black
align=Tot_Lead frame pcompress
xbetween=15 ybetween=3
arrowhead=0 rectilinear nodefid nolabel;
run;