SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Bar and Pie Charts
Viewing and Storing Charts


Specifying a Storage Location for Your Graphs

By default, the charts and other graphs that you create using SAS/GRAPH software are stored as entries in a temporary SAS catalog named Work.Gseg. When you create a graph, it is appended to the catalog. Each stored graph is known as a catalog entry and has the type GRSEG. You can access a stored graph by its four-level name:

libref.catalog.name.grseg

To save graphs in a SAS catalog other than the default catalog, you use the GOUT= option in the PROC statement for the step that creates your graph. So, when you create charts, you specify GOUT= in the PROC GCHART statement.


General form, GOUT= option:

     GOUT=<libref.>output-catalog

where

  • libref is the name of the SAS library where the catalog is (or will be) stored.

  • output-catalog is the name of a catalog that either exists or is created when the procedure runs. If the catalog specified in the GOUT= option already exists, the procedure simply adds a catalog entry to the catalog.
Note: If you omit the libref in the GOUT= option, SAS/GRAPH software looks for the catalog in the temporary library called Work and creates the catalog if it does not exist.


Examples

The following program creates two vertical bar charts in the temporary catalog Work.Newcat.

     symbol1 interpol=spline value=none color=red;
     symbol2 interpol=spline value=none color=blue;
     proc gchart data=clinic.therapy1999 gout=newcat;
        vbar month / sumvar=swim type=sum;
        vbar month / sumvar=aerclass type=sum;
        where swim>35 and aerclass>35;
     run;

This program creates a pie chart in the permanent catalog Mylib.Permcat in the Windows environment.

     libname mylib 'd:\reports\permfiles';
     symbol1 interpol=spline value=none color=red;
     symbol2 interpol=spline value=none color=blue;
     proc gchart data=clinic.admit
          gout=mylib.permcat;
        pie actlevel / fill=s;
        where sex='F';
     run;

back||next


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

Terms of Use & Legal Information | Privacy Statement