Chapter Contents

Previous

Next
SAS/GRAPH Software: Reference

Running SAS/GRAPH Programs


Modes of Operation

There are several ways to run a SAS program. You can use

The mode you use determines whether the graphics output displays on your monitor. If you use display manager, interactive line mode, or noninteractive mode, the SAS/GRAPH program can display graphics output on your monitor as well as store the output in a catalog.

If you use batch mode, the graphics output is not displayed on your monitor. In this case, your program must send the graphics output to a hardcopy device, permanent catalog, or a graphics stream file. See SAS/GRAPH Output for more information on the destination of graphics output.

Regardless of how you run your programs, SAS/GRAPH software uses the values stored in the device entry or specified by graphics options in a GOPTIONS statement to determine how to handle the graphics output.

For more information on modes of operation, see SAS Language Reference: Concepts and the SAS documentation for your operating environment.


RUN-Group Processing

You can use RUN-group processing with the GCHART, GMAP, GPLOT, GREPLAY, and GSLIDE procedures to produce multiple graphs without restarting the procedure every time.

To use RUN-group processing, you start the procedure and then submit multiple RUN-groups. A RUN-group is a group of statements that contains at least one action statement and ends with a RUN statement. It can contain other SAS statements such as AXIS, BY, GOPTIONS, LEGEND, TITLE, or WHERE. As long as you do not end the procedure, it remains active and you do not need to resubmit the PROC statement.

To end RUN-group processing, submit a QUIT or RUN CANCEL statement, or start a new procedure.

Note:   When using SAS/GRAPH with the ODS HTML statement, it is best to use the QUIT statement after each procedure that uses RUN-group processing, rather than relying on a new procedure to end the processing.  [cautionend]

With global and local statements

Global statements and NOTE statements that are submitted in a RUN-group affect all subsequent RUN-groups until you cancel the statements or exit the procedure. For example, each of these two RUN-groups produces a plot and both plots display the title defined in the first RUN-group:

/* first run group*/
proc gplot data=sales;
   title1 'Sales Summary';
   plot sales*model_a;
run;

      /* second run group */
   plot sales*model_b;
run;
quit;

With BY statements

BY statements persist in exactly the same way. Therefore, if you submit a BY statement within a RUN-group, the BY-group processing produces a separate graph for each value of the BY variable for the RUN-group in which you submit it and for all subsequent RUN-groups until you cancel the BY statement or exit the procedure. Thus, as you submit subsequent action statements, you continue to get multiple graphs (one for each value of the BY variable). For more information, see BY Statement.

With the WHERE Statement

The WHERE statement enables you to graph only a subset of the data in the input data set. If you submit a WHERE statement with a RUN-group, the WHERE definition remains in effect for all subsequent RUN-groups until you exit the procedure or reset the WHERE definition.

Using a WHERE statement with RUN-group processing follows most of the same rules as using the WHERE statement outside of RUN-group processing with these exceptions:


Chapter Contents

Previous

Next

Top of Page

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