GOPTIONS Statement

Temporarily sets default values for many graphics attributes and device parameters used by SAS/GRAPH procedures.
Used by: all statements and procedures in a SAS session
Type: Global

Syntax

GOPTIONS <options-list> ;

Optional Argument

options-list
can be one or more options as listed and described in the Graphics Options and Device Parameters Dictionary.

Details

Description: GOPTIONS Statement

The GOPTIONS statement specifies values for graphics options. Graphics options control characteristics of the graph, such as size, colors, type fonts, fill patterns, and symbols. If GOPTIONS are specified, they override the default style. In addition, they affect the settings of device parameters, which are defined in the device entry. Device parameters control such characteristics as the appearance of the display, the type of output produced, and the destination of the output.
The GOPTIONS statement enables you to change these settings temporarily, either for a single graph or for the duration of your SAS session. You can use the GOPTIONS statement to do the following tasks:
  • override default values for graphics options that control either graphics attributes or device parameters for a single graph or for an entire SAS session
  • reset individual graphics options or all graphics options to their default values
  • cancel definitions for AXIS, FOOTNOTE, PATTERN, SYMBOL, and TITLE statements
To change device parameters permanently, you must use the GDEVICE procedure to modify the appropriate device entry or to create a new one. See the GDEVICE Procedure for details.
To review the current settings of all graphics options, use the GOPTIONS procedure. See the GOPTIONS Procedure for details.

Using the GOPTIONS Statement

GOPTIONS statements are global and can be located anywhere in your SAS program. However, for the graphics options to affect the output from a procedure, the GOPTIONS statement must execute before the procedure.
With the exception of the RESET= option, graphics options can be listed in any order in a GOPTIONS statement. The RESET= option should be the first option in the GOPTIONS statement.
A graphics option remains in effect until you specify the option in another GOPTIONS statement, use the RESET= option to reset the values, or end the SAS session. When a session ends, the values of the graphics options return to their default values.
Graphics options are additive. That is, the value of a graphics option remains in effect until the graphics option is explicitly changed or reset or until your SAS session ends. Graphics options remain in effect even after you submit additional GOPTIONS statements specifying different options.
To reset an individual option to its default value, submit the option without a value (a null graphics option.) You can use a comma (but it is not required) to separate a null graphics option from the next one. For example, this GOPTIONS statement sets the values for the background color, the text height, and the text font:
goptions cback=blue htext=6 pct ftext=albany;
To reset only the background color specification to the default and keep the remaining values, use this GOPTIONS statement:
goptions cback=;
To reset all graphic options to their default values, specify RESET=GOPTIONS:
goptions reset=goptions;
Alternatively, you can use RESET=ALL, but it also cancels any global statement definitions in addition to resetting all graphics options to default values.

Graphics Option Processing

You can control many graphics attributes through statement options, graphics options, device parameters, or a combination of these. SAS/GRAPH searches these places to determine the value to use, stopping at the first place that gives it an explicit value:
  1. statement options
  2. the value of the corresponding graphics option
  3. the value of a device parameter found in the catalog entry for your device driver
Note: Not every graphics attribute can be set in all three places. See the statement and procedure chapters for the options that can be used with each.
Some graphics options are supported for specific devices or operating environments only. See the SAS Help facility for SAS/GRAPH or the SAS companion for your operating environment for more information.