Bill-of-Material Postprocessing Macros |
%BOMRMLW: Indented Where-Used List |
%bomrmlw ( |
ROOT=root, IN=SAS-data-set, LEV=variable, COMP=variable, |
QTYPROD=variable, QTYUSED=qtyused, OUT=SAS-data-set, |
|
DROP=variables); |
constructs an indented where-used list for a given item referred to as the item Root, which lists every parent item of the item Root and the respective quantities required, as well as each of their respective parent items, continuing until the end item is referenced (Cox and Blackstone, J. H., Jr. 1998). The parameters for this macro are as follows:
specifies the part number of the item for which the indented where-used list is constructed. 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.
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 component’s part number. This variable is also referred to as the Component variable. 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 product information. The default value is Qty_Prod. A null value tells the macro program not to look for the variable in the input data set that contains the quantity per product information.
specifies the name for the variable in the output data set that contains the quantity of the item Root used by the item identified by the Component variable. A null value tells the macro program not to calculate and write the quantity-used information to the output data set. The default value is Qty_Used. The specification of the QTYUSED= parameter is ignored if the macro program cannot find the variable in the Indented BOM data set that contains the quantity per product information. The Indented BOM data set should not contain a variable with the name specified in the QTYUSED= parameter. Otherwise, the values of the variable with the name specified in the QTYUSED= parameter will be overwritten.
names the output data set that contains indented where-used list data for the item Root. The default value is _BOMOUT_. The null value is replaced by the default value.
specifies all variables in the Indented BOM data set that you do not want to be included in the output data set. You can list the variables in any form that SAS allows. The default value is the variable that is specified in the QTYPROD= parameter. A null value tells the macro program to write all the variables in the Indented BOM data set to the output data set.
The input data set of this macro is the Indented BOM data set described in Input Data Sets.
The following parameters specify the variables in the input data set that are required by the %BOMRMLW macro.
A character or numeric variable that contains the part number of the component.
A numeric variable that contains the indenture level information.
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 quantity per product information.
Variables that you do not want to be included in the output data set.
The output data set contains the indented where-used list for the item Root. This data set has the same variables as the Indented BOM data set, except for those variables that are specified in the DROP= parameter. If both values for QTYPROD= and QTYUSED= parameters are not null, the output data set contains a new variable with the name specified by the following parameter:
A numeric variable that contains the quantity of the item Root that is used in the item identified by the Component variable.
Upon completion, this macro defines a macro variable, _BOMRMLW_, which contains a character string that indicates the status of the macro execution. See Macro Variables for the possible values of this macro variable.
The following statement constructs an indented where-used list for the item '1400' from the Indented BOM data set displayed in Figure 4.1.
%bomrmlw(root='1400', in=IndBOM, qtyused=QtyUsed, out=BomOut2, drop=Paren_ID Part_ID Qty_Prod);
The indented where-used list for the item '1400' is displayed in Figure 4.3. In this list, the variable QtyUsed contains the quantity of the item '1400' that is used in the item identified by the variable _Part_. For example, if you trace back from the item '1400' up to the end item 'A101', you will observe that the item '1500' uses units of '1400', and the item 'A101' uses unit of '1500', and hence, units of '1400'. Therefore, the value for the variable QtyUsed is on both observations and .
ABC Lamp Company |
%BOMRMLW macro |
Indented Where-Used List, Part 1400 |
Obs | _Level_ | _Parent_ | _Part_ | Desc | QtyPer | Fscrap | QtyUsed | Unit | LeadTime | Tot_Lead | LTOff | Tot_Off | SDate | EDate | _Prod_ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2 | 1500 | 1400 | 1/4-20 Screw | 2 | 0 | . | Each | 1 | 4 | 0 | 0 | . | . | A101 |
2 | 1 | A101 | 1500 | Steel holder | 1 | 0 | 2 | Each | 2 | 3 | 0 | 0 | . | . | A101 |
3 | 0 | A101 | Three-way socket assem. | . | . | 2 | Each | 1 | 1 | . | 0 | . | . | A101 | |
4 | 3 | 1500 | 1400 | 1/4-20 Screw | 2 | 0 | . | Each | 1 | 6 | 0 | 2 | . | . | LA01 |
5 | 2 | A100 | 1500 | Steel holder | 1 | 0 | 2 | Each | 2 | 5 | 0 | 2 | . | . | LA01 |
6 | 1 | LA01 | A100 | One-way socket assem. | 1 | 0 | 2 | Each | 1 | 3 | 2 | 2 | . | . | LA01 |
7 | 0 | LA01 | Lamp LA | . | . | 2 | Each | 2 | 2 | . | 0 | . | . | LA01 | |
8 | 2 | B100 | 1400 | 1/4-20 Screw | 4 | 0 | . | Each | 1 | 4 | 3 | 3 | . | . | LA01 |
9 | 1 | LA01 | B100 | Base assembly | 1 | 0 | 4 | Each | 1 | 3 | 0 | 0 | . | . | LA01 |
10 | 0 | LA01 | Lamp LA | . | . | 4 | Each | 2 | 2 | . | 0 | . | . | LA01 |
Copyright © SAS Institute, Inc. All Rights Reserved.