%BOMTREP: Multiple-Replace Transaction |
%bomtrep ( |
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:
specifies the part number of the item for which the bill of material is replaced with the one for the item Repby in all places where it is used. This item is referred to as the item Root. You must specify either a number or a quoted string for the ROOT= parameter, depending on the type of the Component variable.
specifies the part number of the item for which the bill of material is replacing the one for the item Root in all places it is used. This item is referred to as the item Repby. You must specify either a number or a quoted string for the REPBY= parameter, depending on the type of the Component variable.
names the Indented BOM input data set. The default value is the most recently created SAS data set. A null value is replaced by the default value.
identifies the variable in the Indented BOM data set that contains the indenture level information. The default value is _Level_. A null value is replaced by the default value.
identifies the variable in the Indented BOM data set that contains the parent item’s part number. The default value is _Parent_. A null value is replaced by the default value.
identifies the variable in the Indented BOM data set that contains the ID number for the parent record. The default value is Paren_ID. A null value is replaced by the default value.
identifies the variable in the Indented BOM data set that contains the component’s part number. The default value is _Part_. A null value is replaced by the default value.
identifies the variable in the Indented BOM data set that contains the quantity per assembly information. A null value tells the macro program not to look for the variable that contains the quantity per assembly information. The default value is Qty_Per.
identifies the variable in the Indented BOM data set that contains the lead-time offset information. A null value tells the macro program not to look for the variable that contains lead-time offset information. The default value is L_Offset.
identifies the variable in the Indented BOM data set that contains the scrap factor information. A null value tells the macro program not to look for the variable that contains the scrap factor information. The default value is S_Factor.
identifies the variable in the Indented BOM data set that contains the lead time information. If you do not specify this parameter or specify a null value, the macro program will not look for the variable in the input data set that contains the lead time information.
identifies all ID variables in the Indented BOM data set that contain part master data and are not specified in the COMP= or LEADTIME= parameters. See Part Master Data Set and STRUCTURE Statement, both in Chapter 3 for details about the part master data and the ID variables. If you do not specify this parameter or specify a null value, the macro program assumes the Indented BOM data set contains no ID variables.
identifies all RID variables in the Indented BOM data set that contain product structure data and are not specified in the PARENT=, COMP=, QUANTITY=, FACTOR=, or OFFSET= parameters. See Product Structure Data Set and STRUCTURE Statement, both in Chapter 3 for details about the product structure data and the RID variables. If you do not specify this parameter or specify a null value, the macro program assumes the Indented BOM data set contains no RID variables.
specifies either or to indicate whether or not the bill of material for the item Root should be removed after the replace transaction is done. The value indicates that the bill of material should not be removed; any other value indicates that the bill of material should be removed. The default value is . A null value is replaced with the default value.
names the output data set that contains the modified indented bill of material. The default value is _BOMOUT_. A null value is replaced by this default value.
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.
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 |