%BOMRSLB: Single-Level Bill of Material

%bomrslb (

ROOT=root, IN=SAS-data-set, PARENT=variable,

 

COMP=variable, OUT=SAS-data-set, DROP=variables);

constructs a single-level bill of material for a given item referred to as the item Root, which lists all components that are directly used in the item Root. The parameters for this macro are as follows:

ROOT=root

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

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.

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.

COMP=variable

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.

OUT=SAS-data-set

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

DROP=variables

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 list of variables _Level_, Paren_ID, Part_ID, _Prod_, Qty_Prod, Tot_Lead, and Tot_Off, if they are in the Indented BOM data set. A null value tells the macro program to write all variables in the Indented BOM data set to the output data set.

The Input 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 %BOMRSLB 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 parameter specifies the variables in the Indented BOM input data set that are used by the macro, if they can be found in the data set.

DROP=

Variables that you do not want to be included in the output data set.

The Output Data Set

The output data set contains the single-level bill of material 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.

Macro Variable _BOMRSLB_

Upon completion, this macro defines a macro variable, _BOMRSLB_, 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

The following statement constructs a single-level bill of material for the item 'B100' from the Indented BOM data set displayed in Figure 4.1.

%bomrslb(root='B100', in=IndBOM, out=BomOut3);

The single-level bill of material for the item 'B100' is displayed in Figure 4.4.

Figure 4.4: Single-Level Bill of Material for Item B100 (BomOut3)

ABC Lamp Company
%BOMRSLB macro
Single-Level Bill of Material, Part B100

_Parent_ _Part_ Desc QtyPer Fscrap Unit LeadTime LTOff SDate EDate
B100 1100 Finished shaft 1 0 Each 2 0 . .
B100 1200 6-Diameter steel plate 1 0 Each 3 0 . .
B100 1300 Hub 1 0 Each 2 1 . .
B100 1400 1/4-20 Screw 4 0 Each 1 3 . .