Reusing V-mask Parameters for Cusum Chart

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CUSTWOS3                                            */
 /*   TITLE: Reusing V-mask Parameters for Cusum Chart           */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Cusum Charts,                                       */
 /*   PROCS: CUSUM                                               */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC: If you are using a monochrome graphics device,      */
 /*          eliminate the CINFILL and CFRAME options.           */
 /*                                                              */
 /****************************************************************/

options ps=60 ls=80;

data oil1;
   input hour @;
   do i=1 to 4;
      input weight @;
      output;
      end;
   drop i;
   cards;
 1  8.024  8.135  8.151  8.065
 2  7.971  8.165  8.077  8.157
 3  8.125  8.031  8.198  8.050
 4  8.123  8.107  8.154  8.095
 5  8.068  8.093  8.116  8.128
 6  8.177  8.011  8.102  8.030
 7  8.129  8.060  8.125  8.144
 8  8.072  8.010  8.097  8.153
 9  8.066  8.067  8.055  8.059
10  8.089  8.064  8.170  8.086
11  8.058  8.098  8.114  8.156
12  8.147  8.116  8.116  8.018
;

proc cusum data=oil1;
   xchart weight*hour /
      mu0      =8.100        /* Target mean for process     */
      sigma0   =0.050        /* Known standard deviation    */
      delta    =1            /* Shift to be detected        */
      alpha    =0.10         /* Type I error probability    */
      outlimits=mask         /* Saves V-mask parameters     */
      outindex ='hours 1-12' /* Identifies source of V-mask */
      nochart;
run;


 /* Construct Cusum Chart with the Limits Data Set */
data new;
   input hour @;
   do i=1 to 4;
      input weight @;
      output;
      end;
   drop i;
   cards;
13  8.127  8.141  8.164  8.181
14  8.109  8.107  8.144  8.125
15  8.153  8.206  8.191  8.048
;

data oil2;
  set oil1 new;
  run;


symbol1 v=dot h=0.75;
title 'Cusum Chart for Data in OIL2';

proc cusum data=oil2 limits=mask;
   xchart weight*hour /
      readlimits
      dataunits
      tablesummary
      tablechart
      tableout
      outhistory=summary
      cinfill   =yellow
      cframe    =green
      cmask     =white
      llimits   =20
      novangle;
   label weight='Cumulative Sum in Ounces';
run;

title 'Listing for Data Set Summary';
proc print data=summary;
run;

goptions reset=all;