Specifying a Known Proportion for np Charts

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWNP3                                              */
/*   TITLE: Specifying a Known Proportion for np Charts         */
/* 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 Circuits;
   input Batch Fail @@;
   datalines;
1    5   2   6   3  11   4   6    5   4
6    9   7  17   8  10   9  12   10   9
11   8  12   7  13   7  14  15   15   8
16  18  17  12  18  16  19   4   20   7
21  17  22  12  23   8  24   7   25  15
26   6  27   8  28  12  29   7   30   9
;


ods graphics on;
title1 'np Chart for Failing Circuits';
title2 'Using Data in CIRCUITS and Standard Value P0=0.02';
proc shewhart data=Circuits;
   npchart Fail*Batch / subgroupn = 500
                        p0        = 0.02
                        npsymbol  = np0
                        nolegend
                        needles
                        odstitle  = title
                        odstitle2 = title2;
   label Batch ='Batch Number'
         Fail  ='Fraction Failing';
run;

data Climits;
   length _var_ _subgrp_ _type_ $8;
   _p_      = 0.02;
   _subgrp_ = 'Batch';
   _var_    = 'Fail';
   _type_   = 'STANDARD';
   _limitn_ = 500;

proc shewhart data=Circuits limits=Climits;
   npchart Fail*Batch / subgroupn = 500
                        npsymbol  = np0
                        nolegend
                        needles;
   label Batch ='Batch Number'
         Fail  ='Fraction Failing';
run;