u Chart-Known Expected Number of Nonconformities

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWUEX2                                             */
/*   TITLE: u Chart-Known Expected Number of Nonconformities    */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, u Charts,                          */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Fabric;
   input Roll Defects @@;
   datalines;
 1 12    2 11    3  9    4 15
 5  7    6  6    7  5    8 10
 9  8   10  8   11 14   12  5
13  9   14 13   15  7   16  5
17  8   18 11   19  7   20 12
;


ods graphics on;
title  'u Chart for Fabric Defects per Square Meter';
title2 'Using Data in FABRIC and Standard Value U0=.325';
proc shewhart data=Fabric;
   uchart Defects*Roll / subgroupn = 30
                         u0        = 0.325
                         usymbol   = u0
                         odstitle  = title
                         odstitle2 = title2
                         markers;
run;

data Tlimits;
   length _subgrp_ _var_ _type_ $8;
   _u_      = .325;
   _limitn_ = 30;
   _type_   = 'STANDARD';
   _subgrp_ = 'Roll';
   _var_    = 'Defects';

proc shewhart data=Fabric limits=Tlimits;
   uchart Defects*Roll / subgroupn=30
                         usymbol  =u0;
run;