Bill of Material with Scrap Factor Information

/*****************************************************************/
/*                                                               */
/*             S A S   S A M P L E   L I B R A R Y               */
/*                                                               */
/*    NAME: BOME03                                               */
/*   TITLE: Bill of Material with Scrap Factor Information       */
/*          (bome03)                                             */
/* PRODUCT: OR                                                   */
/*  SYSTEM: ALL                                                  */
/*    KEYS: OR                                                   */
/*   PROCS: BOM, SORT, PRINT                                     */
/*    DATA:                                                      */
/*                                                               */
/* SUPPORT:                             UPDATE:                  */
/*     REF:                                                      */
/*    MISC: Example 3 from the BOM Procedure chapter of the      */
/*          BOM book.                                            */
/*                                                               */
/*****************************************************************/

/* Part master records */

data PMaster3;
input Part      $8.
   Desc      $24.
   Unit      $8.
   LeadTime  8.0
   ;
datalines;
1100    Finished shaft          Each           2
1200    6-Diameter steel plate  Each           3
1300    Hub                     Each           2
1400    1/4-20 Screw            Each           1
1500    Steel holder            Each           2
1600    One-way socket          Each           2
1700    Wiring assembly         Each           1
2100    3/8 Steel tubing        Inches         3
2200    16-Gauge lamp cord      Feet           2
2210    14-Gauge lamp cord      Feet           2
2300    Standard plug terminal  Each           1
A100    Socket assembly         Each           1
B100    Base assembly           Each           1
LA01    Lamp LA                 Each           2
S100    Black shade             Each           2
;


/* Product structure records  */

data ParComp3;
format SDate EDate date9.;
input Parent    $8.
Component $8.
QtyPer    4.0
Fscrap    6.2
LTOff     4.0
SDate     date10.
EDate     date10.
;
datalines;
LA01    B100       1   .     .         .         .
        S100       1   .     .         .         .
        A100       1   .     2         .         .
B100    1100       1   .     .         .         .
        1200       1   .     .         .         .
        1300       1   .     1         .         .
        1400       4   .     3         .         .
A100    1500       1   .     .         .         .
        1600       1   .     .         .         .
        1700       1   .     .         .         .
1100    2100      26  0.2    .         .         .
1500    1400       2   .     .         .         .
1700    2200      12  0.1    .         .  7APR2001
        2210      12  0.1    .  8APR2001         .
        2300       1   .     .         .         .
;

/* Display the part master data set */

proc print data=PMaster3 noobs;
title 'ABC Lamp Company';
title3 'Part Master Records';
run;

/* Display the product structure data set */

proc print data=ParComp3 noobs;
var Parent Component QtyPer Fscrap LTOff SDate EDate;
title 'ABC Lamp Company';
title3 'Product structure Records';
run;

  /* Create the indented BOM with lead time */
proc bom data=ParComp3 pmdata=PMaster3
         out=IndBOM3 summaryout=SumBOM3;
   structure / part=Part
               leadtime=LeadTime
               parent=Parent
               component=Component
               quantity=QtyPer
               factor=Fscrap
               offset=LTOff
               id=(Desc Unit)
               rid=(SDate EDate);
run;


/* Display the indented BOM data */

proc print data=IndBOM3;
var _Level_ _Parent_ _Part_ Desc QtyPer Fscrap Qty_Prod
    Unit LeadTime Tot_Lead LTOff Tot_Off SDate EDate _Prod_;
title 'ABC Lamp Company';
title3 'Indented Bill of Material, Part LA01';
run;

/* Sort and display the summarized parts list */

proc sort data=SumBOM3;
by _Part_;
run;

proc print data=SumBOM3 noobs;
title 'ABC Lamp Company';
title3 'Summarized Parts List, Period 3';
run;