|
ROOT=root, REPBY=repby, IN=SAS-data-set, |
LEV=variable, PARENT=variable, PARENID=variable, |
|
COMP=variable, QUANTITY=variable, OFFSET=variable, |
|
FACTOR=variable, LEADTIME=variable, ID=variables, |
|
RID=variables, DEL=del, OUT=SAS-data-set); |
performs the multiple-replace transaction, which replaces the bill of material for the item specified in the ROOT= parameter (referred to as the item Root) with the bill of material for the item specified in the REPBY= parameter (referred to as the item Repby) in all places where the item Root is used. The parameters for this macro are as follows:
The input data set of this macro is the Indented BOM data set as described in Input Data Sets.
The following parameters specify the variables in the input data set that are required by the %BOMTREP
macro.
A character or numeric variable that contains the part number of the component.
A numeric variable that contains the indenture level information.
A numeric variable that contains the ID number for the parent record.
A character or numeric variable that contains the part number of the parent item. The type of this variable must be the same as that of the variable specified in the COMP= parameter.
The following parameters specify the variables in the Indented BOM input data set that are used by the macro, if they can be found in the data set.
A numeric variable that contains the scrap factor information.
Variables that contain part master information, except for those specified in the COMP= or LEADTIME= parameters.
A numeric variable that contains the lead time of the component.
A numeric variable that contains the lead-time offset information.
A numeric variable that contains the quantity per assembly information.
Variables that contain product structure information, except for those specified in the COMP=, FACTOR=, OFFSET=, PARENT=, or QUANTITY= parameters.
The output data set contains all the bill of material in the input data set with the bill of material for the item Root replaced by the bill of material for the item Repby. This output data set has the same variables as the Indented BOM output data set of the BOM procedure. See Indented BOM Data Set in Chapter 3 for the variables in this data set.
Upon completion, this macro defines a macro variable, _BOMTREP_
, which contains a character string that indicates the status of the macro execution. See Macro Variables for the possible values of this macro variable.
In this example, the engineers of the ABC Lamp Company want to replace the one-way socket assembly (part number 'A100
') with the three-way socket assembly (part number 'A101
') in all places where 'A100
' is used. The following code performs this multiple-replace transaction.
%bomtrep(root='A100', repby='A101', in=IndBOM, quantity=QtyPer, offset=LTOff, factor=Fscrap, leadtime=LeadTime, id=Desc Unit, rid=SDate EDate, del=1, out=BomOut9);
The data set BomOut9
displayed in Figure 4.11 contains the updated indented bill of material of the company. Note that the item 'A100
' is replaced by the item 'A101
' in the bill of material for the end item 'LA01
'. The bill of material for the item 'A100
' is removed from the company’s product structure because the parameter DEL=1 is specified in the invocation of the %BOMTREP
macro.
Figure 4.11: Indented Bill of Material Updated by the Multiple-Replace Transaction (BomOut9)
ABC Lamp Company |
%BOMTREP macro |
Indented Bill of Material |
Obs | _Level_ | _Parent_ | Paren_ID | _Part_ | Part_ID | Desc | QtyPer | Fscrap | Qty_Prod | Unit | LeadTime | Tot_Lead | LTOff | Tot_Off | SDate | EDate | _Prod_ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | . | LA01 | 8 | Lamp LA | . | . | 1 | Each | 2 | 2 | . | 0 | . | . | LA01 | |
2 | 1 | LA01 | 8 | A101 | 9 | Three-way socket assem. | 1 | 0.0 | 1 | Each | 1 | 3 | 2 | 2 | . | . | LA01 |
3 | 2 | A101 | 9 | 1500 | 10 | Steel holder | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 2 | . | . | LA01 |
4 | 3 | 1500 | 10 | 1400 | 11 | 1/4-20 Screw | 2 | 0.0 | 2 | Each | 1 | 6 | 0 | 2 | . | . | LA01 |
5 | 2 | A101 | 9 | 1601 | 12 | Three-way socket | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 2 | . | . | LA01 |
6 | 2 | A101 | 9 | 1700 | 13 | Wiring assembly | 1 | 0.0 | 1 | Each | 1 | 4 | 0 | 2 | . | . | LA01 |
7 | 3 | 1700 | 13 | 2200 | 14 | 16-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 6 | 0 | 2 | . | 07APR2001 | LA01 |
8 | 3 | 1700 | 13 | 2210 | 15 | 14-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 6 | 0 | 2 | 08APR2001 | . | LA01 |
9 | 3 | 1700 | 13 | 2300 | 16 | Standard plug terminal | 1 | 0.0 | 1 | Each | 1 | 5 | 0 | 2 | . | . | LA01 |
10 | 1 | LA01 | 8 | B100 | 17 | Base assembly | 1 | 0.0 | 1 | Each | 1 | 3 | 0 | 0 | . | . | LA01 |
11 | 2 | B100 | 17 | 1100 | 18 | Finished shaft | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 0 | . | . | LA01 |
12 | 3 | 1100 | 18 | 2100 | 19 | 3/8 Steel tubing | 26 | 0.2 | 26 | Inches | 3 | 8 | 0 | 0 | . | . | LA01 |
13 | 2 | B100 | 17 | 1200 | 20 | 6-Diameter steel plate | 1 | 0.0 | 1 | Each | 3 | 6 | 0 | 0 | . | . | LA01 |
14 | 2 | B100 | 17 | 1300 | 21 | Hub | 1 | 0.0 | 1 | Each | 2 | 5 | 1 | 1 | . | . | LA01 |
15 | 2 | B100 | 17 | 1400 | 22 | 1/4-20 Screw | 4 | 0.0 | 4 | Each | 1 | 4 | 3 | 3 | . | . | LA01 |
16 | 1 | LA01 | 8 | S100 | 23 | Black shade | 1 | 0.0 | 1 | Each | 2 | 4 | 0 | 0 | . | . | LA01 |