|
Chapter Contents |
Previous |
Next |
| The BOM Procedure |
The SAS DATA step code to accomplish this is as follows:
/* Part Master data */
data PMaster1;
input Part $8.
Desc $24.
Unit $8.
LeadTime 8.0
;
datalines;
1100 Finished shaft Each 2
1200 6-Diameter steel plate Each 3
1300 Hub Each 2
1400 1/4-20 Screw Each 1
1500 Steel holder Each 2
1600 One-way socket Each 2
1700 Wiring assembly Each 1
2100 3/8 Steel tubing Inches 3
2200 16-Gauge lamp cord Feet 2
2300 Standard plug terminal Each 1
A100 Socket assembly Each 1
B100 Base assembly Each 1
LA01 Lamp LA Each 2
S100 Black shade Each 2
;
/* Part-Component relationship data */
data ParComp1;
input Part $8.
Component $8.
QtyPer 8.0 ;
datalines;
LA01 B100 1
S100 1
A100 1
B100 1100 1
1200 1
1300 1
1400 4
A100 1500 1
1600 1
1700 1
1100 2100 26
1500 1400 2
1700 2200 12
2300 1
;
/* Display the part master data */
proc print data=PMaster1 noobs;
title 'ABC Lamp Company';
title3 'Part Master Data';
run;
/* Display the part-component relationship data */
proc print data=ParComp1 noobs;
title 'ABC Lamp Company';
title3 'Part-Component Relationship Data';
run;
Output 1.1.1: Part Master Data Set
|
/* Append the Part-Component information to */
/* the part master data */
data SlBOM1;
set PMaster1 ParComp1;
run;
The following code produces the Indented BOM data set and displays it in Output 1.1.3. A new variable, Tot_Lead, has been added to the output data set. This variable denotes the total lead time accumulated from the product `LA01' to the item identified by the _Part_ variable:
/* Create the indented BOM with lead time */
proc bom data=SlBOM1 out=IndBOM1;
structure / part=Part
leadtime=LeadTime
component=Component
quantity=QtyPer
id=(Desc Unit);
run;
/* Display the indented BOM data */
proc print data=IndBOM1 noobs;
var _Level_ _Part_ Desc QtyPer Qty_Prod
Unit LeadTime Tot_Lead _Parent_ _Prod_;
title 'ABC Lamp Company';
title3 'Indented Bill of Material, Part LA01';
run;
Output 1.1.3: Indented Bill of Material with Lead Time
|
/* Prepare the data set for running NETDRAW */
data IndBOM1a(drop=Part_ID);
set IndBOM1;
Paren_ID=Part_ID;
run;
data IndBOM1b;
set IndBOM1(keep=Paren_ID Part_ID);
run;
data TreBOM1;
set IndBOM1a IndBOM1b;
LTnQP = put(LeadTime, f3.)||" "||put(QtyPer, f3.);
run;
PROC NETDRAW is invoked with the NODISPLAY option to create a data set (Layout1) that contains all the layout information for the tree structure. The OUT= option specifies the name of the layout data set:
/* Specify graphics options */
title h=1 j=c 'Multilevel Bill of Material with Lead-time Offset';
footnote h=0.5 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=TreBOM1( where=(Paren_ID NE .) )
out=Layout1 nodisplay;
actnet / act=Paren_ID succ=Part_ID id=(_Part_ LTnQP Tot_Lead)
ybetween=3 xbetween=15 tree
rectilinear nodefid nolabel;
run;
In the next invocation, PROC NETDRAW
uses a modified layout of the
nodes to produce a diagram where the nodes are aligned according
to the total lead time:
/* Lead time offset the X coordinate of each node */
data TreBOM1a;
set Layout1;
if _seq_ = 0;
drop _seq_;
_x_ = Tot_Lead;
run;
/* display the BOM tree with lead-time offset */
proc netdraw data=TreBOM1a;
actnet / id=(_Part_ LTnQP)
font=swiss ctext=black htext=3 carcs=black
align=Tot_Lead frame pcompress
xbetween=15 ybetween=3
arrowhead=0 rectilinear nodefid nolabel;
run;
Refer to "The NETDRAW Procedure" chapter in the SAS/OR User's Guide: Project Management, Version 8 for details.
The resulting tree diagram is shown in Output 1.1.4.
Output 1.1.4: BOM Tree Structure with Lead-time Offset
|
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.