Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
INSET Statement

Formatting Values and Customizing Labels

See CAPINS1 in the SAS/QC Sample Library

By default, each inset statistic is identified with an appropriate label, and each numeric value is printed using an appropriate format. However, you may want to provide your own labels and formats. For example, in Figure 5.1 the default format for the standard deviation prints an excessive number of decimal places. The following statements correct this problem, as well as customizing some of the labels displayed in the inset:

   legend2 frame cframe=ligr cborder=black position=center;
   proc capability data=wire noprint;
      spec lsl=22 llsl=2  clsl=black
           usl=38 lusl=20 cusl=black;
      histogram strength / cframe = ligr
                           cfill  = bigb
                           legend = legend2;
      inset n='Sample Size' min max mean std='Std Dev' (5.2) / cfill=ywh;
   run;

The resulting histogram is displayed in Figure 5.2. You can provide your own label by specifying the keyword for that statistic followed by an equal sign (=) and the label in quotes. The label can have up to 24 characters.

The format 5.2 specified in parentheses after the keyword STD displays the standard deviation with a field width of five and two decimal places. In general, you can specify any numeric SAS format in parentheses after an inset keyword. You can also specify a format to be used for all the statistics in the INSET statement with the FORMAT= option (see the next example, "Adding a Header and Positioning the Inset"). For more information about SAS formats, refer to SAS Language Reference: Dictionary.

Note that if you specify both a label and a format for a statistic, the label must appear before the format, as with the keyword STD in the previous statements.

capigs2.gif (6927 bytes)

Figure 5.2: Formatting Values and Customizing Labels in an Inset

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.