|
ROOT=root, ATTACH=attach, IN=SAS-data-set, |
PSDATA=SAS-data-set, PARENT=variable, PARENID=variable, |
|
COMP=variable, QUANTITY=variable, OFFSET=variable, |
|
FACTOR=variable, LEADTIME=variable, ID=variables, |
|
RID=variables, OUT=SAS-data-set); |
performs the copy-and-paste transaction, which copies the bill of material for the item specified in the ROOT= parameter (referred to as the item Root), and attaches it to the parent item specified in the ATTACH= parameter (referred to as the item Attach). The parameters for this macro are as follows:
The input data sets of this macro are the Indented BOM and the Product Structure data sets described in Input Data Sets. The Indented BOM data set contains the bill of material for all end items of the product line, plant, or company.
The following parameters specify the variables in the Indented BOM input data set that are required by the %BOMTCNP
macro.
A character or numeric variable that contains the part number of the component.
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 copy-and-paste transaction creates a new parent-component relationship with the item Attach as the parent item and the item Root as the component. The product structure data for this new relationship usually cannot be found in the Indented BOM input data set. Therefore, this macro needs a Product Structure input data set that contains the product structure record for the new relationship.
The following parameters specify the variables in the Product Structure data set that are required by the %BOMTCNP
macro.
A character or numeric variable that contains the part number of the component.
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 Product Structure 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. If the macro cannot find this variable in the Product Structure data set, it assumes the scrap factor of the new relationship is .
A numeric variable that contains the lead-time offset information. If the macro cannot find this variable in the Product Structure data set, it assumes the lead-time offset of the new relationship is .
A numeric variable that contains the quantity per assembly information. If the macro cannot find this variable in the Product Structure data set, it assumes the quantity per assembly of the new relationship is .
Variables that contain product structure information, except for those specified in the COMP=, FACTOR=, OFFSET=, PARENT=, or QUANTITY= parameters. If the macro cannot find an RID variable in the Product Structure data set, but it is in the Indented BOM data set, it assumes the value of this variable is missing.
The output data set of this macro contains all the bill of material in the input data set, with the bill of material for the item Root that is copied and attached to the parent item Attach. This transaction is done by extracting the Product Structure data from the Indented BOM input data set. Thereafter, the product structure record for the new relationship with the item Attach as the parent item and the item Root as the component is added to this data set. The product structure record for this new relationship should be contained in the input data set with the name specified by the PSDATA= parameter. The BOM procedure is then invoked with the new Product Structure data set to create the new indented bill of material. Therefore, the output data set of this macro 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, _BOMTCNP_
, 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, we assume the engineers of the ABC Lamp Company decide that the wiring assembly (part number '1700
') also needs one 1/4-20 screw (part number '1400
'). To modify the company’s bill of material data, they need to create a new product structure record for the relationship
of the parent item '1700
' and the component '1400
'. The Product Structure input data set, ParComp1
, displayed in Figure 4.8, provides the product structure record for this new relationship.
proc print data=ParComp1 noobs; var _Parent_ _Part_ QtyPer Fscrap LTOff SDate EDate; title 'ABC Lamp Company'; title3 'Product Structure Record; Parent 1700, Component 1400'; run;
Figure 4.8: Product Structure Record for the Relationship 1700-1400 (ParComp1)
ABC Lamp Company |
Product Structure Record; Parent 1700, Component 1400 |
_Parent_ | _Part_ | QtyPer | Fscrap | LTOff | SDate | EDate |
---|---|---|---|---|---|---|
1700 | 1400 | 1 | . | . | . | . |
The following SAS code invokes the %BOMTCNP
macro to perform the transaction.
%bomtcnp(root='1400', attach='1700', in=IndBOM, psdata=ParComp1, quantity=QtyPer, offset=LTOff, factor=Fscrap, leadtime=LeadTime, id=Desc Unit, rid=SDate EDate, out=BomOut7);
The data set BomOut7
displayed in Figure 4.9 contains the new indented bill of material. Note that the item '1400
' is now used by the item '1700
' in the bill of material for both end items 'A101
' and 'LA01
'.
Figure 4.9: Indented Bill of Material Updated by the Copy-And-Paste Transaction (BomOut7)
ABC Lamp Company |
%BOMTCNP 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 | . | A101 | 0 | Three-way socket assem. | . | . | 1 | Each | 1 | 1 | . | 0 | . | . | A101 | |
2 | 1 | A101 | 0 | 1500 | 1 | Steel holder | 1 | 0.0 | 1 | Each | 2 | 3 | 0 | 0 | . | . | A101 |
3 | 2 | 1500 | 1 | 1400 | 2 | 1/4-20 Screw | 2 | 0.0 | 2 | Each | 1 | 4 | 0 | 0 | . | . | A101 |
4 | 1 | A101 | 0 | 1601 | 3 | Three-way socket | 1 | 0.0 | 1 | Each | 2 | 3 | 0 | 0 | . | . | A101 |
5 | 1 | A101 | 0 | 1700 | 4 | Wiring assembly | 1 | 0.0 | 1 | Each | 1 | 2 | 0 | 0 | . | . | A101 |
6 | 2 | 1700 | 4 | 2200 | 5 | 16-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 4 | 0 | 0 | . | 07APR2001 | A101 |
7 | 2 | 1700 | 4 | 2210 | 6 | 14-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 4 | 0 | 0 | 08APR2001 | . | A101 |
8 | 2 | 1700 | 4 | 2300 | 7 | Standard plug terminal | 1 | 0.0 | 1 | Each | 1 | 3 | 0 | 0 | . | . | A101 |
9 | 2 | 1700 | 4 | 1400 | 8 | 1/4-20 Screw | 1 | 0.0 | 1 | Each | 1 | 3 | 0 | 0 | . | . | A101 |
10 | 0 | . | LA01 | 9 | Lamp LA | . | . | 1 | Each | 2 | 2 | . | 0 | . | . | LA01 | |
11 | 1 | LA01 | 9 | A100 | 10 | One-way socket assem. | 1 | 0.0 | 1 | Each | 1 | 3 | 2 | 2 | . | . | LA01 |
12 | 2 | A100 | 10 | 1500 | 11 | Steel holder | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 2 | . | . | LA01 |
13 | 3 | 1500 | 11 | 1400 | 12 | 1/4-20 Screw | 2 | 0.0 | 2 | Each | 1 | 6 | 0 | 2 | . | . | LA01 |
14 | 2 | A100 | 10 | 1600 | 13 | One-way socket | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 2 | . | . | LA01 |
15 | 2 | A100 | 10 | 1700 | 14 | Wiring assembly | 1 | 0.0 | 1 | Each | 1 | 4 | 0 | 2 | . | . | LA01 |
16 | 3 | 1700 | 14 | 2200 | 15 | 16-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 6 | 0 | 2 | . | 07APR2001 | LA01 |
17 | 3 | 1700 | 14 | 2210 | 16 | 14-Gauge lamp cord | 12 | 0.1 | 12 | Feet | 2 | 6 | 0 | 2 | 08APR2001 | . | LA01 |
18 | 3 | 1700 | 14 | 2300 | 17 | Standard plug terminal | 1 | 0.0 | 1 | Each | 1 | 5 | 0 | 2 | . | . | LA01 |
19 | 3 | 1700 | 14 | 1400 | 18 | 1/4-20 Screw | 1 | 0.0 | 1 | Each | 1 | 5 | 0 | 2 | . | . | LA01 |
20 | 1 | LA01 | 9 | B100 | 19 | Base assembly | 1 | 0.0 | 1 | Each | 1 | 3 | 0 | 0 | . | . | LA01 |
21 | 2 | B100 | 19 | 1100 | 20 | Finished shaft | 1 | 0.0 | 1 | Each | 2 | 5 | 0 | 0 | . | . | LA01 |
22 | 3 | 1100 | 20 | 2100 | 21 | 3/8 Steel tubing | 26 | 0.2 | 26 | Inches | 3 | 8 | 0 | 0 | . | . | LA01 |
23 | 2 | B100 | 19 | 1200 | 22 | 6-Diameter steel plate | 1 | 0.0 | 1 | Each | 3 | 6 | 0 | 0 | . | . | LA01 |
24 | 2 | B100 | 19 | 1300 | 23 | Hub | 1 | 0.0 | 1 | Each | 2 | 5 | 1 | 1 | . | . | LA01 |
25 | 2 | B100 | 19 | 1400 | 24 | 1/4-20 Screw | 4 | 0.0 | 4 | Each | 1 | 4 | 3 | 3 | . | . | LA01 |
26 | 1 | LA01 | 9 | S100 | 25 | Black shade | 1 | 0.0 | 1 | Each | 2 | 4 | 0 | 0 | . | . | LA01 |