Previous Page | Next Page

Bill-of-Material Postprocessing Macros

%BOMTCNP: Copy-and-Paste Transaction

%bomtcnp (

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:

ROOT=root

specifies the part number of the item for which the bill of material is copied. 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.

ATTACH=attach

specifies the part number of the parent item to which the copied bill of material is attached. This item is referred to as the item Attach. You must specify either a number or a quoted string for the ATTACH= parameter, depending on the type of the Component variable.

IN=SAS-data-set

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.

PSDATA=SAS-data-set

names the Product Structure input data set that contains the product structure record for the relationship between the parent item Attach and the component Root. The default value is _BOMPS_. A null value is replaced by the default value. If the data set specified in the PSDATA= parameter does not exist, the macro will create a data set _BOMPS_ which contains the product structure record for the relationship between the item Attach and the item Root only. In this product structure record, the quantity per assembly is , and both the lead-time offset and the scrap factor are . The values of all RID variables for the product structure record are missing.

PARENT=variable

identifies the variable in the Indented BOM and the Product Structure data sets that contains the parent item’s part number. The default value is _Parent_. A null value is replaced by the default value.

PARENID=variable

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.

COMP=variable

identifies the variable in the Indented BOM and the Product Structure data sets that contains the component’s part number. This variable is referred to as the Component variable. The default value is _Part_. A null value is replaced by the default value.

QUANTITY=variable

identifies the variable in the Indented BOM and the Product Structure data sets that contains the quantity per assembly information. A null value tells the macro program not to look for the variable in both the Indented BOM and the Product Structure data sets that contains the quantity per assembly information. The default value is Qty_Per.

OFFSET=variable

identifies the variable in the Indented BOM and the Product Structure data sets that contains the lead-time offset information. A null value tells the macro program not to look for the variable in both the Indented BOM and the Product Structure data sets that contains the lead-time offset information. The default value is L_Offset.

FACTOR=variable

identifies the variable in the Indented BOM and the Product Structure data sets that contains the scrap factor information. A null value tells the macro program not to look for the variable in both the Indented BOM and the Product Structure data sets that contains the scrap factor information. The default value is S_Factor.

LEADTIME=variable

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.

ID=variables

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.

RID=variables

identifies all RID variables in the Indented BOM and Product Structure data sets 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 both the Indented BOM and the Product Structure data sets contain no RID variables.

OUT=SAS-data-set

names the output data set that contains the modified indented bills of material. The default value is _BOMOUT_. A null value is replaced by the default value.

The Input Data Sets

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 bills 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.

COMP=

A character or numeric variable that contains the part number of the component.

PARENID=

A numeric variable that contains the ID number for the parent record.

PARENT=

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.

FACTOR=

A numeric variable that contains the scrap factor information.

ID=

Variables that contain part master information, except for those specified in the COMP= or LEADTIME= parameters.

LEADTIME=

A numeric variable that contains the lead time of the component.

OFFSET=

A numeric variable that contains the lead-time offset information.

QUANTITY=

A numeric variable that contains the quantity per assembly information.

RID=

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.

COMP=

A character or numeric variable that contains the part number of the component.

PARENT=

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.

FACTOR=

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 .

OFFSET=

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 .

QUANTITY=

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 .

RID=

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

The output data set of this macro contains all the bills 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 bills 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.

Macro Variable _BOMTCNP_

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.

An Example

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 bills 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 bills of material. Note that the item '1400' is now used by the item '1700' in the bills of material for both end items 'A101' and 'LA01'.

Figure 4.9 Indented Bills of Material Updated by the Copy-And-Paste Transaction (BomOut7)
ABC Lamp Company
%BOMTCNP macro
Indented Bills 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

Previous Page | Next Page | Top of Page