np Charts with Unequal Subgroup Sample Sizes

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWNP4                                              */
/*   TITLE: np Charts with Unequal Subgroup Sample Sizes        */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, np Charts,                         */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Battery;
   length Lot $3;
   input Lot nFailed Sampsize @@;
   label nFailed ='Number Failed'
         Lot     = 'Lot Number'
         Sampsize='Number Sampled';
   datalines;
AE3  6  151     AE4  5  142     AE9  6  145
BR3  9  149     BR7  3  150     BR8  0  156
BR9  4  150     DB1  9  158     DB2  4  152
DB3  0  162     DB5  9  140     DB6  7  161
DS4  6  154     DS6  1  144     DS8  5  154
JG1  3  151     MC3  8  148     MC4  2  143
MK6  4  150     MM1  4  147     MM2  0  150
RT5  2  154     RT9  8  149     SP1  3  160
SP3  9  153
;

ods graphics on;
title 'Number of Battery Failures';
proc shewhart data=Battery;
   npchart nFailed*Lot / subgroupn = Sampsize
                         outlimits = Batlim
                         odstitle  = title;
   label nFailed='Number Failed';
run;

title 'Control Limits for Battery Failures';
proc print data=Batlim noobs;
run;

title 'Number of Battery Failures';
proc shewhart data=Battery;
   npchart nFailed*Lot / subgroupn = Sampsize
                         limitn    = 150
                         odstitle  = title
                         alln;
   label nFailed='Number Failed';
run;