Reading Spec Limits from an Input Data Set

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: CAPSPEC2                                            */
/*   TITLE: Reading Spec Limits from an Input Data Set          */
/* PRODUCT: QC                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Capability Analysis, Specification Limits,          */
/*   PROCS: CAPABILITY                                          */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: saswgr                                              */
/*     REF: SAS/QC Software:  Usage and Reference, Version 6,   */
/*          First Edition, Volume 1 and Volume 2                */
/*    MISC:                                                     */
/*                                                              */
/*  Examples in the documentation were created using the        */
/*    statement:  ods listing style=statistical;                */
/*                                                              */
/****************************************************************/

data Cans;
   label Weight = "Fluid Weight (ounces)";
   input Weight @@;
   datalines;
12.07  12.02  12.00  12.01  11.98  11.96  12.04  12.05  12.01  11.97
12.03  12.03  12.00  12.04  11.96  12.02  12.06  12.00  12.02  11.91
12.05  11.98  11.91  12.01  12.06  12.02  12.05  11.90  12.07  11.98
12.02  12.11  12.00  11.99  11.95  11.98  12.05  12.00  12.10  12.04
12.06  12.04  11.99  12.06  11.99  12.07  11.96  11.97  12.00  11.97
12.09  11.99  11.95  11.99  11.99  11.96  11.94  12.03  12.09  12.03
11.99  12.00  12.05  12.04  12.05  12.01  11.97  11.93  12.00  11.97
12.13  12.07  12.00  11.96  11.99  11.97  12.05  11.94  11.99  12.02
11.95  11.99  11.91  12.06  12.03  12.06  12.05  12.04  12.03  11.98
12.05  12.05  12.11  11.96  12.00  11.96  11.96  12.00  12.01  11.98
;
data Cans1a;
   label Cweight = "Can Weight (ounces)";
   input Cweight @@;
   datalines;
1.07 0.86 1.06 1.08 1.02 0.98 1.04 1.08 1.03 1.03
0.96 1.04 1.00 0.92 0.95 0.93 0.99 1.01 1.00 1.08
1.09 0.98 0.96 0.94 0.90 1.01 0.99 1.12 1.08 1.03
0.97 0.99 1.01 1.12 0.99 0.96 1.00 0.92 0.91 1.04
0.90 1.11 1.01 0.98 0.97 1.10 1.07 1.13 0.96 0.95
1.02 1.15 1.08 1.09 0.90 1.04 1.05 1.00 0.90 1.04
1.00 1.00 1.03 0.88 0.98 1.01 0.97 0.90 1.02 0.95
1.03 1.00 1.08 0.91 0.97 0.98 1.03 0.94 1.07 0.98
1.07 0.98 0.93 0.99 0.91 1.02 0.95 1.05 0.88 1.04
1.04 1.04 1.03 1.08 0.99 0.96 1.05 0.92 1.08 1.07
;
data Can2;
   merge Cans Cans1a;
run;

proc print data=Can2(obs=5);
run;

data Limits;
   length _var_ $8;
   _var_    = 'Weight';
   _lsl_    = 11.95;
   _target_ = 12;
   _usl_    = 12.05;
   output;
   _var_    = 'Cweight';
   _lsl_    = 0.90;
   _target_ = 1;
   _usl_    = 1.10;
   output;
run;

title 'Process Capability Analysis of Drink Can Data';
proc capability data=Can2 specs=Limits;
   var Cweight;
run;