Computing Process Capability Indices

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: SHWXEX4                                             */
/*   TITLE: Computing Process Capability Indices                */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Shewhart Charts, Process Standard Deviation,        */
/*   PROCS: SHEWHART                                            */
/*    DATA:                                                     */
/*                                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*                                                              */
/****************************************************************/

data Partgaps;
   input Sample @;
   do i=1 to 5;
      input Partgap @;
      output;
   end;
   drop i;
   label Partgap='Gap Width'
         Sample ='Sample Index';
   datalines;
 1 255 270 268 290 267
 2 260 240 265 262 263
 3 238 236 260 250 256
 4 260 242 281 254 263
 5 268 260 279 289 269
 6 270 249 265 253 263
 7 280 260 256 256 243
 8 229 266 250 243 252
 9 250 270 245 273 262
10 248 258 247 266 256
11 280 251 252 270 287
12 245 253 243 279 245
13 268 260 289 275 273
14 264 286 275 271 279
15 271 257 263 247 247
16 291 250 273 265 266
17 228 253 240 260 264
18 270 260 269 245 276
19 259 257 246 271 257
20 252 244 230 266 248
21 254 251 239 233 263
;



title 'Control Limits and Capability Indices';
proc shewhart data=Partgaps;
   xchart Partgap*Sample / outlimits = Gaplim2
                           usl       = 270
                           lsl       = 240
                           nochart;
run;

title 'Control Limits with Capability Indices for Gap Width Measurements';
proc print data=Gaplim2 noobs;
run;