Previous Page | Next Page

Bill-of-Material Postprocessing Macros

%BOMTSAE: Same-as-Except Transaction

%bomtsae (

ROOT=root, SAMEAS=sameas, EXCEPT=except,

 

REPBY=repby, IN=SAS-data-set, PMDATA=SAS-data-set,

 

PART=variable, LEV=variable, PARENT=variable,

 

PARENID=variable, COMP=variable, QUANTITY=variable,

 

OFFSET=variable, FACTOR=variable, LEADTIME=variable,

 

ID=variables, RID=variables, OUT=SAS-data-set);

performs the same-as-except transaction, which creates a new indented bill of material for the item specified in the ROOT= parameter (referred to as the item Root), which is a clone of the bill of material for the item specified in the SAMEAS= parameter (referred to as the item Sameas). Then, it replaces the item specified in the EXCEPT= parameter (referred to as the item Except) with the item specified in the REPBY= parameter (referred to as the item Repby) in the newly created bills of material. Note that, unlike other transactional macros, the output data set of this macro contains the new bill of material for the item Root only. In addition, if the item Root is in the Indented BOM input data set, the bill of material for the item Root in the input data set may be different from the one in the output data set. The parameters for this macro are as follows:

ROOT=root

specifies the part number of the item for which the bill of material is a clone of the bill of material for the item Sameas. 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. If you do not specify this parameter or specify a null value, the macro will only perform the "replace" transaction, which replaces the item Except with the item Repby in the bill of material for the item Sameas.

SAMEAS=sameas

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

EXCEPT=except

specifies the part number of the item for which the bill of material is replaced by the bill of material for item Repby in all its uses. This item is referred to as the item Except. You must specify either a number or a quoted string for the EXCEPT= parameter, depending on the type of the Component variable. If you do not specify this parameter or specify a null value, the macro will only perform the "clone" transaction, which copies the bill of material for the item Sameas to the item Root. In other words, the indented bill of material in the output data set is identical to the indented bill of material for the item Sameas in the Indented BOM input data set.

REPBY=repby

specifies the part number of the item for which the bill of material is replacing the bill of material for item Except. 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. If you do not specify this parameter or specify a null value, the macro will remove the bill of material for the item Except in all its appearances in the new indented bill of material.

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.

PMDATA=SAS-data-set

names the Part Master input data set that contains the part master data for the item Root. The default value is the name specified by the IN= parameter. A null value is replaced by the default value. The PMDATA= parameter is ignored if you do not specify the ROOT= parameter, or specify a null value for it.

PART=variable

identifies the variable in the Part Master data set that contains the item’s part number. The default is the variable specified in the COMP= parameter. A null value is replaced by the default value.

LEV=variable

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.

PARENT=variable

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.

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 data set 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 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.

OFFSET=variable

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.

FACTOR=variable

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.

LEADTIME=variable

identifies the variable in the Indented BOM and Part Master data sets 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 Indented BOM data set that contains the lead time information.

ID=variables

identifies all ID variables in the Indented BOM and Part Master data sets that contain part master data and are not specified in the PART=, 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 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.

OUT=SAS-data-set

names the output data set that contains the new indented bill of material for the item Root. The default value is _BOMOUT_. A null value is replaced by the default value.

Input Data Sets

The input data sets of this macro are the Indented BOM and the Part Master 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 the Indented BOM data set that are required by the %BOMTSAE macro.

COMP=

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

LEV=

A numeric variable that contains the indenture level information.

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.

Unlike other transactional macros, the item Root is not necessarily defined in the Indented BOM input data set. If it is not, you must specify a Part Master data set in the PMDATA= parameter that contains the part master record for the item Root. Otherwise, you can use the Indented BOM data set as the Part Master data set. The Part Master input data set may contain one part master record for the item Root only, or contain the part master records for all items, including the item Root, that are used in the company’s product structure.

The following parameter specifies the variable in the Part Master data set that is required by the %BOMTSAE macro.

PART=

A character or numeric variable that contains the part number of the 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.

ID=

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

LEADTIME=

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

The Output Data Set

The output data set of this macro contains the bill of material for the item Root, which is a clone of the bill of material for the item Sameas, except the item Except, which is replaced by the item Repby in all its uses. The 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. Note that if the item Root is in the Indented BOM data set specified by the IN= parameter, the bill of material for the item Root in the input data set may be different from the one in this output data set.

Macro Variable _BOMTSAE_

Upon completion, this macro defines a macro variable, _BOMTSAE_, 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, the engineers of the ABC Lamp Company need to create a new product, a lamp with three-way socket (part number 'LA03'), which is the same as the lamp 'LA01' except that the new product has a three-way socket assembly (part number 'A101'), instead of a one-way socket assembly (part number 'A100'). They first create a part master record for the new product 'LA03'. The Part Master input data set, PMaster1, displayed in Figure 4.12, contains this part master record.

proc print data=PMaster1 noobs;
title 'ABC Lamp Company';
title3 'Part Master Record; Part LA03';
run;

Figure 4.12 Part Master Record for Item LA03 (PMaster1)
ABC Lamp Company
 
Part Master Record; Part LA03

Part Desc Unit LeadTime
LA03 Lamp LA w/ 3-way socket Each 2

The following SAS code invokes the %BOMTSAE macro to perform the transaction.

%bomtsae(root='LA03', sameas='LA01', except='A100', repby='A101', 
in=IndBOM, pmdata=PMaster1, part=Part, quantity=QtyPer,
offset=LTOff, factor=Fscrap, leadtime=LeadTime, 
id=Desc Unit, rid=SDate EDate, out=BomOut10);

The data set BomOut10 that contains the indented bill of material for the new item 'LA03' is displayed in Figure 4.13.

Figure 4.13 Indented Bill of Material for Item LA03 (BomOut10)
ABC Lamp Company
%BOMTSAE macro
Indented Bill of Material, Part LA03

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   . LA03 8 Lamp LA w/ 3-way socket . . 1 Each 2 2 . 0 . . LA03
2 1 LA03 8 A101 9 Three-way socket assem. 1 0.0 1 Each 1 3 2 2 . . LA03
3 2 A101 9 1500 10 Steel holder 1 0.0 1 Each 2 5 0 2 . . LA03
4 3 1500 10 1400 11 1/4-20 Screw 2 0.0 2 Each 1 6 0 2 . . LA03
5 2 A101 9 1601 12 Three-way socket 1 0.0 1 Each 2 5 0 2 . . LA03
6 2 A101 9 1700 13 Wiring assembly 1 0.0 1 Each 1 4 0 2 . . LA03
7 3 1700 13 2200 14 16-Gauge lamp cord 12 0.1 12 Feet 2 6 0 2 . 07APR2001 LA03
8 3 1700 13 2210 15 14-Gauge lamp cord 12 0.1 12 Feet 2 6 0 2 08APR2001 . LA03
9 3 1700 13 2300 16 Standard plug terminal 1 0.0 1 Each 1 5 0 2 . . LA03
10 1 LA03 8 B100 17 Base assembly 1 0.0 1 Each 1 3 0 0 . . LA03
11 2 B100 17 1100 18 Finished shaft 1 0.0 1 Each 2 5 0 0 . . LA03
12 3 1100 18 2100 19 3/8 Steel tubing 26 0.2 26 Inches 3 8 0 0 . . LA03
13 2 B100 17 1200 20 6-Diameter steel plate 1 0.0 1 Each 3 6 0 0 . . LA03
14 2 B100 17 1300 21 Hub 1 0.0 1 Each 2 5 1 1 . . LA03
15 2 B100 17 1400 22 1/4-20 Screw 4 0.0 4 Each 1 4 3 3 . . LA03
16 1 LA03 8 S100 23 Black shade 1 0.0 1 Each 2 4 0 0 . . LA03


Previous Page | Next Page | Top of Page