SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Drill-Down Graphs in HTML
Tasks in Creating Drill-Down Graphs


In the lesson Producing HTML Output, you learned how to generate HTML output. You can combine the same method with SAS/GRAPH procedures to create drill-down graphs. You define the links that connect a chart to its drill-down locations; these links are then assigned in the HTML when ODS writes the output.

To create a drill-down graph, you write a SAS program to do the following:

  1. Create the initial chart that you want to use, using SAS/GRAPH software. This chart will become the primary chart in your linked series of graphs.

  2. Create a variable to hold HREF addresses for the linked HTML files.

  3. Define values for the new variable.

  4. Set ODS output to HTML.

  5. Attach links to the primary chart by identifying the HREF variable in the SAS/GRAPH procedure.

  6. Create the secondary, linked charts and tables.


We'll go over each of these steps on the following pages.


Data Used in Examples

This lesson builds a detailed example of a program that creates a drill-down graph. It uses the data set Finance.Prdsal2, which contains sales figures for an imaginary furniture company. Sales are tracked by region for every month from 1995 to 1998.

Description of Finance.Prdsal2
Variable Type Format Label
COUNTRY Char $CHAR10. Country
STATE Char $CHAR22. State/Province
COUNTY Char $CHAR20. County
ACTUAL Num DOLLAR12.2 Actual Sales
PREDICT Num DOLLAR12.2 Predicted Sales
PRODTYPE Char $CHAR10. Product Type
PRODUCT Char $CHAR10. Product
YEAR Num 4. Year
QUARTER Num 8. Quarter
MONTH Num MONNAME3. Month
MONYR Num MONYY. Month/Year


Note: The Prdsal2 data set is part of your SAS installation, but it is not currently stored in the Finance library. If you would like to run the program developed in this lesson, create the data set Finance.Prdsal2 by submitting the following code:
     data finance.prdsal2;
        set sashelp.prdsal2;
     run;

  back||next


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

Terms of Use & Legal Information | Privacy Statement