Associating URLs with Subgroups in HTML

You can use the Output Delivery System (ODS) to produce an HTML file containing a control chart created by the SHEWHART procedure. The HTML= option provides a way to associate Uniform Resource Locators (URLs) with subgroups plotted on a control chart. It specifies a variable in the input data set containing HTML syntax providing the URLs to be associated with different subgroups. The HTML= variable can be a character variable or a numeric variable with an associated character format.

The following statements generate an chart that is saved to a GIF file and included in an HTML file. The formatted values of the numeric HTML= variable Web specify URLs that link subgroups in the input data set to various web pages.

goptions target = gif;
ods html body = "example1.html";
proc format;
   value webfmt
   1='href="http://www.sas.com/"'
   2='href="http://www.sas.com/service/techsup/faq/qc/shewproc.html"'
   3='href="http://www.sas.com/rnd/app/qc.html"'
   4='href="http://www.sas.com/rnd/app/qc/qcnew.html"'
   5='href="http://www.sas.com/rnd/app/qc/qc.html"'
   ;

data wafers;
   format Web webfmt.;
   input Batch Web @;
   do i=1 to 5;
      input Diameter @;
      output;
      end;
   drop i;
datalines;
 1  1  35.00 34.99 34.99 34.98 35.00
 2  1  35.00 34.99 34.99 34.98 35.00
 3  1  34.99 34.99 35.00 34.99 35.00
 4  1  35.00 35.00 34.99 34.99 35.00
 5  2  35.00 34.99 34.98 34.99 35.00
 6  2  34.99 34.99 35.00 35.00 35.00
 7  2  35.01 34.98 35.00 35.00 34.99
 8  2  35.00 35.00 34.99 34.98 34.99
 9  3  34.99 34.98 34.99 35.01 35.00
10  3  34.99 35.00 35.00 34.99 35.00
11  3  35.01 35.00 35.00 34.98 34.99
12  3  34.99 34.99 35.00 34.98 35.01
13  4  35.01 34.99 34.98 34.99 34.99
14  4  35.00 35.00 34.99 35.00 34.99
15  4  34.98 35.00 34.99 35.00 34.99
16  4  34.99 35.00 35.00 35.01 35.00
17  5  34.98 34.98 34.98 34.99 34.98
18  5  35.01 35.02 35.00 34.98 35.00
19  5  34.99 34.98 35.00 34.99 34.98
20  5  34.99 35.00 35.00 34.99 34.99
;

symbol1 v=square;
proc shewhart data=wafers;
   xchart Diameter*Batch / html = ( Web );
run;

ods html close;
run;

In this example five different URLs are each associated with a set of four subgroup values. When you view the ODS HTML output with a browser, you can click on a subgroup data point and the browser will bring up the page specified by the subgroup’s URL. These URLs happen to point to pages at SAS Institute’s web site which may be of interest to SAS/QC users.

Note: The value of the HTML= variable must be the same for each observation belonging to a given subgroup.