Chapter Contents

Previous

Next
SAS/ACCESS Software for PC File Formats: Reference

Charting Data

PROC GCHART programs work with data that are described by view descriptors just as they do with other SAS data sets. (Using this procedure requires a SAS/GRAPH license at your site.) The following example uses the view descriptor VLIB.ALLORDR to create a vertical bar chart of the number of orders per product. VLIB.ALLORDR describes the data in the ORDERS.XLS file. You need a SAS/GRAPH license to complete this exercise.

proc access dbms=xls;
   create adlib.order.access;     
   /* create access descriptor   */
   path="c:\sasdemo\orders.xls";
   worksheet=sheet1;
   range='a1..j39';
   getnames=yes;
   scantype=5;
   mixed=yes;
   assign=yes;
   rename dateorderd = dateord
          processdby = procesby;
   format dateorderd date9.
          shipped date9.
          ordernum      5.0
          length        4.0
          stocknum      4.0
          takenby       6.0
          processdby    6.0
          fabcharges    12.2;
   list all;

   create vlib.allordr.view;      
   /* create vlib.allordr view */
   select all;
run;

proc gchart data=vlib.allordr;    
   /* example                      */
   vbar stocknum / discrete;
title 'Data Described by VLIB.ALLORDR';
run;

Vertical Bar Chart of Number of Orders per Product shows the output for this example. STOCKNUM represents each product. The number of orders for each product is represented by the height of the bar.

Vertical Bar Chart of Number of Orders per Product

[IMAGE]

For more information on the GCHART procedure, see SAS/GRAPH Software: Reference.


Chapter Contents

Previous

Next

Top of Page

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