SAS Graph
SAS Graph
1 Reference
®
Volume 1
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS/GRAPH® 9.1 Reference,
Volumes 1 and 2. Cary, NC: SAS Institute Inc.
SAS/Graph® 9.1 Reference, Volumes 1 and 2
SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.
SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software
to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit
the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228.
®
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
Contents
Chapter 21 Macro Arguments for the DS2CONST, DS2TREE, DS2CSF, and META2HTM
Macros 535
Macro Arguments 535
Examples 768
Examples 1228
Overview 1401
GASK Routines 1404
GDRAW Functions 1446
GRAPH Functions 1457
GSET Functions 1462
Return Codes for DSGI Routines and Functions 1501
See Also 1502
References 1503
Glossary 1549
Index 1561
xii
xiii
What’s New
Overview
It’s easier than ever to produce enhanced and detailed, informative graphics for your
Web presentations. New features in SAS/GRAPH include:
3 three new procedures: GAREABAR, GBARLINE, and MAPIMPORT
3 new options in the GCHART procedure for producing standard pie or donut charts
with a detailed, inner pie overlay
3 new options in the GRADAR procedure for adjusting how a chart looks and for
specifying annotation
3 support for the new DOCUMENT procedure for the Output Delivery System (ODS)
3 the new SAS Maps Online application
3 server-side rendering using the ACTXIMG and JAVAIMG devices
3 client support for annotation
3 client support for ODS styles
3 ActiveX support for creating graphs interactively
3 ActiveX support for radar charts produced with the GRADAR procedure
3 the new Java Constellation Applet
3 user interface enhancements for the client graphs, such as redesigned dialogs.
Note:
3 This section describes the features of SAS/GRAPH that are new or enhanced since
SAS 8.2.
3 z/OS is the successor to the OS/390 operating system. SAS/GRAPH 9.1 is
supported on both OS/390 and z/OS operating systems and, throughout this
document, any reference to z/OS also applies to OS/390, unless otherwise stated.
4
xiv What’s New
Details
Procedures
The following procedures are new or enhanced:
3 The GAREABAR procedure generates bar graphs in which the width of the bars
are proportional to a characteristic of the data element that is represented by the
bars. Area bar charts are supported only when you specify device=activex or
device=actximg. For more information, see Chapter 27, “The GAREABAR
Procedure,” on page 725.
3 The new GBARLINE procedure enables you to create vertical bar charts that have
line plot overlays.
Note: The GBARLINE procedure is not supported for Java. 4
For more information, see Chapter 28, “The GBARLINE Procedure,” on page 739.
3 The new MAPIMPORT procedure enables you to import ESRI Shapefiles into SAS/
GRAPH map data sets. For more information, see Chapter 48, “The MAPIMPORT
Procedure,” on page 1347.
3 The new DOCUMENT procedure for ODS enables you to re-arrange or to
duplicate reports—including graphs—without having to rerun your analysis. You
can display output to any ODS output format without executing your SAS
programs again. For more information, see the DOCUMENT procedure in SAS
Output Delivery System: User’s Guide.
3 New options in the PIE statement in the GCHART procedure enable you to create
detail pie charts that have an inner pie overlay. The slices in the overlay align
with the slices in the outer pie and show detailed information about the major
components that comprise the outer slice. The new options are DETAIL=,
DETAIL_PERCENT=, DETAIL_RADIUS=, DETAIL_SLICE=,
DETAIL_THRESHOLD=, and DETAIL_VALUE=. For more information, see
Chapter 29, “The GCHART Procedure,” on page 773.
3 The GRADAR procedure has the following new options:
3 ANNOTATE= specifies an annotate data set.
3 INBORDER requests a border around plots.
3 INHEIGHT= specifies the height in percent screen units of text used inside
the frame of the chart.
3 LAST= specifies that the spoke that corresponds to the category is displayed
to the left of the start angle.
3 MAXNVERT= specifies the maximum number of vertices.
3 MISSING accepts a missing value as a valid midpoint for the chart variable.
3 NOFRAME suppresses the frame that is drawn around the chart by default.
3 NOZEROREF turns off the zero reference line when negative values are
plotted.
3 OTHER= specifies a new category that merges all categories that are not
selected because of the MAXNVERT= option.
3 ORDERACROSS= specifies the display order for the values of the ACROSS=
variable.
3 SPIDER draws lines on a radar chart that connect the spokes instead of the
default tick marks. The resulting lines look similar to a “spider web.”
What’s New xv
SYMBOL Statement
The SINGULAR= option tunes the algorithm that is used to check for singularities.
Graphics Options
The following graphics options are new:
USERINPUT
determines whether user input is enabled for the device. For more information,
see “USERINPUT” on page 359.
SWFONTRENDER
specifies the method used to render software fonts. For more information, see
“SWFONTRENDER ”on page 353.
Server-Side Rendering
The ACTXIMG and JAVAIMG devices generate images on the server that match the
look of the client graphs. These devices are especially useful when you do not need the
xvi What’s New
interactivity that is provided by the client graphs. ACTXIMG is only available for
Windows. For more information, see “ACTXIMG and JAVAIMG Device Drivers
Compared to GIF, JPEG, and PNG Device Drivers” on page 440.
ActiveX Control
The following are enhancements for the ActiveX Control:
3 The ActiveX control now supports creating graphs interactively. You can import
data from SAS data sets, Microsoft Excel files, or Microsoft Access files.
Note: To create graphs interactively, you must have Enterprise Guide 2.0 HotFix
11 or higher installed.
3 The ActiveX control now supports radar charts that are produced by using the
GRADAR procedure.
3 The ActiveX control menus now enable the following additional languages:
Chinese, Japanese, Korean, and Russian. (The following languages were also
available in SAS 8.2: French, German, Hebrew, Hungarian, Italian, Polish, and
Spanish.
User-Defined Formats
The Java and ActiveX devices now support user-defined formats, except for nested
user-defined formats. For information about defining formats, see the documentation
for the FORMAT procedure in the Base SAS Procedures Guide.
Colors
Color names can now be a maximum of 64 characters in length.
Fonts
The following fonts have been added:
3 Davidb (Hebraic)
3 Fsong (Chinese)
3 Hebrewb
xviii What’s New
3 Hei (Chinese)
3 Mincho (Japanese)
1
P A R T
SAS/GRAPH Concepts
CHAPTER
1
Introduction to SAS/GRAPH
Software
Overview 4
Generating Graphs 4
Charts 4
Block charts 4
Horizontal bar charts 5
Vertical bar charts 5
Pie charts, 3-D Pie charts, and Donut charts 6
Star charts 6
Two-Dimensional Plots 6
Two-dimensional scatter plots 7
Simple line plots 7
Regression plots 7
High-low plots 8
Bubble plots 8
Three-Dimensional Plots 9
Surface plots 9
Scatter plots 9
Contour plots 10
Maps 11
Block maps 11
Choropleth maps 11
Prism maps 11
Surface maps 12
Creating Text Slide and Presentation Graphics 12
Text Slides 13
Combining Output into One Slide 13
Enhancing Graphics Output (graphs and text slides) 14
SAS/GRAPH Statements 14
The Annotate Facility 14
Creating Custom Graphics 15
The DATA Step Graphics Interface 15
Graph-N-Go 15
About this Book 16
Audience 16
Prerequisites 16
Conventions Used in This Book 16
Syntax Conventions 17
Conventions for Examples and Output 19
Information You Should Know 20
Support Personnel 20
Sample Programs 21
4 Overview Chapter 1
Overview
SAS/GRAPH software is the data visualization and presentation (graphics)
component of the SAS System. As such, SAS/GRAPH software:
3 organizes the presentation of your data and visually represents the relationship
between data values as two- and three-dimensional graphs, including charts, plots,
and maps.
3 enhances the appearance of your output by allowing you to select text fonts, colors,
patterns, and line styles, and control the size and position of many graphics
elements.
3 creates presentation graphics. SAS/GRAPH software can create text slides, display
several graphs at one time, combine graphs and text in one display, and create
automated presentations.
3 generates a variety of graphics output that you can display on your screen or in a
Web browser, store in catalogs, review, or send to a hardcopy graphics output
device such as a laser printer, plotter, or slide camera.
3 provides utility procedures and statements to manage the output.
This chapter describes the graphs that are produced by SAS/GRAPH software and
explains some of the parts and features of SAS/GRAPH programs.
Generating Graphs
SAS/GRAPH software produces many kinds of charts, plots, and maps in both two-
and three-dimensional versions. In addition to helping you understand the variety of
graphs that are available to you, these descriptions will also help you choose the correct
type of graph for your data and point you to the appropriate chapter.
Charts
SAS/GRAPH software uses the GCHART procedure to produce charts that
graphically represent the value of a statistic for one or more variables in a SAS data
set. See Chapter 29, “The GCHART Procedure,” on page 773 for a complete description.
Block charts
Block charts use three-dimensional blocks to graphically represent values of
statistics. Block charts are useful for emphasizing relative magnitudes and differences
among data values.
Introduction to SAS/GRAPH Software Charts 5
Star charts
Star charts use the length of spines to graphically represent the value of a statistic
for a data range. Star charts are useful for analyzing where data are out of balance.
Two-Dimensional Plots
SAS/GRAPH software uses the GPLOT procedure to produce two-dimensional
graphs that plot one or more dependent variables against an independent variable
within a set of coordinate axes. GPLOT can display the data points as individual
symbols (as in a scatter plot), or use interpolation methods specified by the SYMBOL
statement to join the points, request spline interpolation or regression analysis, produce
various high-low plots, or generate several other types of plots.
GPLOT can also display data as bubble plots in which circles of different sizes
represent the values of a third variable.
Plots are useful for demonstrating the relationship between two or more variables and
frequently compare trends or data values or depict movements of data values over time.
See Chapter 37, “The GPLOT Procedure,” on page 1081 for a complete description.
Introduction to SAS/GRAPH Software Two-Dimensional Plots 7
Regression plots
Regression plots specify that the plot is a regression analysis. You can specify one of
three types of regression equation – linear, quadratic, or cubic – and optionally display
confidence limits for mean predicted values or individual predicted values.
8 Two-Dimensional Plots Chapter 1
High-low plots
High-low plots show how several values of one variable relate to one value of another
variable. Typically, each variable value on the horizontal axis has several corresponding
values on the vertical axis. High-low plots include box, needle, and stock market plots.
Bubble plots
Bubble plots show the relative magnitude of one variable in relation to two other
variables. The values of two variables determine the position of the bubble on the plot,
and the value of a third variable determines the size of the bubble.
Introduction to SAS/GRAPH Software Three-Dimensional Plots 9
Three-Dimensional Plots
SAS/GRAPH software uses the G3D procedure to produce three-dimensional surface
and scatter plots that examine the relationship among three variables. Variable values
are plotted on a set of three coordinate axes.
See Chapter 46, “The G3D Procedure,” on page 1295 for a complete description.
Surface plots
Surface plots are three-dimensional plots that display the relationship of three
variables as a continuous surface. Surface plots examine the three-dimensional shape
of data.
Scatter plots
Scatter plots enable you to examine three-dimensional data points instead of surfaces
and to classify your data using size, color, shape, or a combination of these features.
10 Three-Dimensional Plots Chapter 1
Contour plots
SAS/GRAPH software uses the GCONTOUR procedure to examine
three-dimensional data in two dimensions. Lines or areas in a contour plot represent
levels of magnitude (z) corresponding to a position on a plane (x,y).
See Chapter 30, “The GCONTOUR Procedure,” on page 885 for a complete
description.
Contour plots are two-dimensional plots that show three-dimensional relationships.
These plots use contour lines or patterns to represent levels of magnitude of a contour
variable plotted on the horizontal and vertical axes.
When you need to interpolate or smooth data values that are used by the G3D and
GCONTOUR procedures, use the G3GRID procedure. The G3GRID procedure does not
produce graphics output but processes existing data sets to create data sets that the
G3D or GCONTOUR procedure can use to produce three-dimensional surface or contour
plots. See Chapter 47, “The G3GRID Procedure,” on page 1327 for a complete
description.
Introduction to SAS/GRAPH Software Maps 11
Maps
SAS/GRAPH software uses the GMAP procedure to produce two- and
three-dimensional maps that can show an area or represent values of response
variables for subareas.
SAS/GRAPH software includes data sets to produce geographic maps. In addition,
you can create your own map data sets.
See Chapter 35, “The GMAP Procedure,” on page 995 for a complete description.
Block maps
Block maps are three-dimensional maps that represent data values as blocks of
varying height rising from the middle of the map areas.
Choropleth maps
Choropleth maps are two-dimensional maps that display data values by filling map
areas with combinations of patterns and color that represent the data values.
Prism maps
Prism maps are three-dimensional maps that display data by raising the map areas
and filling them with combinations of patterns and colors.
12 Creating Text Slide and Presentation Graphics Chapter 1
Surface maps
Surface maps are three-dimensional maps that represent data values as spikes of
varying heights.
SAS/GRAPH software also provides several utility procedures for handling map data.
The GPROJECT procedure lets you choose how geographic maps are projected. This
is particularly important for large areas because producing a map of any large area on
the Earth involves distorting some areas in the process of projecting the spherical
surface of the Earth onto a flat plane. You can use the procedure to select the projection
method that least distorts your map.
Map areas are constructed of joined data points. Each data point represents an
observation in a SAS data set. For large maps, the amount of data can be prohibitively
expensive (in terms of computing resources or time to process); the GREDUCE
procedure enables you to reduce the number of points in the data set. The GREMOVE
procedure enables you to remove boundary lines within a map.
3 automatically or manually replay your graphs and text slides with the GREPLAY
procedure.
Text Slides
Use the GSLIDE procedure to create text slides in which you can specify a variety of
colors, fonts, sizes, angles, overlays, and other modifications as well as drawing lines
and boxes on the output.
See Chapter 44, “The GSLIDE Procedure,” on page 1277 for a complete description.
Text slides display text as graphics output. Text slides can be used as title slides for
presentations, or to produce certificates, signs, or other display text.
Use the GPRINT procedure to display as a graphic SAS procedure output that has
been saved in a text file. With GPRINT, you bring the text file into SAS/GRAPH and
then add titles, notes, and footnotes, and select colors for the output.
See Chapter 38, “The GPRINT Procedure,” on page 1147 for a complete description.
SAS/GRAPH Statements
You also can use global statements and graphics options in SAS/GRAPH programs.
With global statements, you can add titles and footnotes and control the appearance of
axes, symbols, patterns, and legends. With graphics options, you can control the
appearance of graphics elements by specifying default colors, fill patterns, fonts, text
height, and so on.
Graph-N-Go
To generate presentation graphs without writing any SAS/GRAPH code, you can use
Graph-N-Go (not available on mainframes). You can start Graph-N-Go in several ways:
3 from the menus in any SAS window, select
Solutions Reporting Graph-N-Go
graphngo
Audience
This book is written for users who are experienced in using SAS System software.
You should understand the concepts of programming in the SAS language, and you
should have an idea of the tasks you want to perform with SAS/GRAPH software.
Prerequisites
The following table summarizes the SAS System concepts that you need to
understand in order to use SAS/GRAPH software:
Syntax Conventions
Type styles have special meanings when used in the presentation of SAS/GRAPH
software syntax in this book. The following list explains the style conventions for the
syntax sections:
UPPERCASE identifies SAS keywords such as the names of statements and
procedures (for example, PROC GCHART). Also identifies
arguments and values that are literals, (for example, NOLEGEND
and LABEL=NONE).
italic identifies arguments or values that you supply. Items in italic can
represent user-supplied values that are either
3 nonliteral values assigned to an argument (for example,
axis-color in COLOR=axis-color)
3 nonliteral arguments (for example, VBAR chart-variable. . . ; ).
In addition, an item in italics can be the generic name for a list of
arguments or parameters from which the user can choose (for
example, appearance-options).
The following symbols are used to indicate other syntax conventions:
< > (angle identify optional arguments. Any argument not enclosed in angle
brackets) brackets is required.
| (vertical bar) indicates that you can choose one value from a group. Values
separated by bars are mutually exclusive.
. . . (ellipsis) indicates that the argument following the ellipsis can be repeated
any number of times (plot-request <. . . plot-request-n>, for
example). If the ellipsis and the following argument are enclosed in
angle brackets, they are optional. In SAS/GRAPH software, an
ellipsis also indicates a range from which a value is selected
(LINE=1 . . . 46, for example).
The following examples illustrate the syntax conventions described in this section.
These examples contain selected syntax elements, not complete syntax.
PROC GANNO ANNOTATE=Annotate-data-set
<DATASYS>;
18 Syntax Conventions Chapter 1
font names, color names, and variable names. Consider the following four syntax
samples:
FONT=font
COLOR=color
COLOR=text-color
3 Font must be a valid SAS font name. (See Chapter 5, “SAS/GRAPH Fonts,” on
page 75 for details.)
3 Color and text-color must be valid SAS/GRAPH colors. (See Chapter 6, “SAS/
GRAPH Colors and Images,” on page 91 for details.)
3 Chart-variable must be a valid SAS variable name. (See SAS Language Reference:
Dictionary for details.)
These HSIZE= and VSIZE= settings are not shown in the example code and are not
necessary for generating the output, but you may want to use similar settings if your
output looks different from the output that is shown in the book.
The examples use explicit color specifications, and the example code contains the
names of colors that approximate the colors you see in this book. The colors displayed
on your device may differ from those shown in the examples because of differences in
device capabilities.
20 Information You Should Know Chapter 1
The examples in this book do not specify actual names for the file structures used for
SAS data libraries or for external files. This is because different operating environments
and different computing installations use different conventions for naming files and
directories. Instead, the examples refer to storage locations generically. For example, a
LIBNAME statement to assign the libref STORE is shown as
libname store ’SAS-data-library’;
For SAS-data-library, you should supply the complete specification for the storage
location (for example, directory or z/OS data set) of the data library, using the form
required by your operating environment.
Similarly, a FILENAME statement to assign the fileref MYFILE is shown as
filename myfile ’external-file’;
For external-file, you should supply a fully qualified filename, using the form required
for your operating environment.
If you are unsure of the requirements at your site, see your SAS Software Consultant
for more information.
Some examples explicitly specify the font and height for text, the units, and border in
procedure statements. For those examples that do not include explicit specifications,
the following graphics options were used to produce uniform output:
RESET=GLOBAL cancels all currently defined AXIS, LEGEND, FOOTNOTE, TITLE,
PATTERN, and SYMBOL definitions.
GUNIT=PCT specifies the unit specification for options is in percent, unless
explicitly specified in another SAS statement.
FTEXT=SWISSB specifies that all text uses the SWISSB font, unless explicitly
specified in another SAS statement.
HTITLE=6 specifies that the first title line is 6 percent of the height of the
graphics output area, unless explicitly specified in another SAS
statement.
HTEXT=3 specifies that text is 3 percent of the height of the graphics output
area, unless explicitly specified.
BORDER causes a border to be drawn around the graphics output area. The
border, which appears in most output, represents the boundaries of
the graphics output area, whether or not a border is drawn by the
program.
Note: The way that output is presented on your device depends on the environment
in which you are running SAS/GRAPH software. 4
Support Personnel
Most sites have personnel available to help users learn to run SAS System software.
Record the name of the SAS Software Consultant, SAS Software Representative, and
Introduction to SAS/GRAPH Software Sample Programs 21
system administrator at your site. Also record the names of anyone else you regularly
turn to for help with running SAS/GRAPH software.
Sample Programs
Most of the chapters in this book provide examples that demonstrate some of the
major features of SAS/GRAPH software. To minimize the typing you must do to run the
sample code yourself, the code is delivered to you through the SAS Sample Library.
Depending on your operating environment, there are up to three ways that you can
access the code that is in the sample library:
3 if you are viewing the sample code in SAS OnlineDoc, you can copy the code out of
the OnlineDoc and paste it into the Program Editor in your SAS session. This
alternative is not available if you do not have access to a Web browser in the
operating environment where you are running your SAS session.
3 in most operating environments (excluding mainframe environments), you can
access the sample code through the SAS Help facility. For example, from a SAS
window’s Help menu, you can choose SAS System Help to enter the help system.
You can then choose the link for Sample SAS Programs and Applications, which
takes you to the help page for the SAS Sample Library.
3 in most operating environments (excluding Windows), the SAS Sample Library
may have been installed in your file system. If the SAS Sample Library has been
installed at your site, ask your SAS Software Consultant where it is located.
To access the sample programs through SAS System Help or through your file
system, you must understand the naming convention used for the samples. The naming
convention for SAS/GRAPH samples is Gpcxxxxx, where pc is the product code and
xxxxx is an abbreviation of the example title. For example, the code for the first
example in the GMAP Procedure chapter, Example 1 on page 1045, is stored in sample
member GMPSIMPL. The sample-library member name is sometimes displayed as a
footnote in the output’s lower-right corner.
3 In SAS System Help, the sample programs are organized by product. Within each
product category, the samples are sorted alphabetically by title. Thus, to access
the code for the first example in the GMAP Procedure chapter, navigate in the
help system to the SAS Sample Library page, choose SAS/GRAPH from the list of
products, and then scroll to the listing "GMPSIMPL-Producing a Simple Block
Map."
3 In your file system, the files that contain the sample code have file names that
match the sample member names. For example, in a directory-based system, the
code for sample member GMPSIMPL is located in a file named GMPSIMPL.SAS.
Note: For WebGraph samples the naming convention is GWBxxxxx. 4
Note: Some of the examples include LIBNAME and FILENAME statements. You
must provide the name of the SAS data library or external file before running the
example. 4
22 Sample Programs Chapter 1
Procedure Code
dsgi DS
ganno AN
gchart CH
gradar GD
gcontour CT
gfont FO
gimport IP
gkeymap KY
gmap MP
goptions OP
gplot PL
gprint PR
gproject PJ
greduce RD
gremove RM
greplay RE
gslide SL
gtestit IT
g3d TD
g3grid TG
Statement Code
axis AX
by BY
footnote FO
goptions ON
legend LG
note NO
pattern PN
Introduction to SAS/GRAPH Software Annotate Macros Data Set 23
Statement Code
symbol SY
title TI
Statement Code
WebGraph WB
CHAPTER
2
SAS/GRAPH Programs
Overview 25
Language Elements 26
SAS/GRAPH Procedures 26
SAS/GRAPH Global Statements 27
Annotate DATA Step 27
Other SAS Language Statements 27
FILENAME Statement 28
LIBNAME Statement 29
SAS Data Sets 29
Temporary and Permanent SAS Data Sets 29
Using a Library Reference to Specify a Data Set 30
Using a File Specification to Specify a Data Set 30
Data Set Requirements 31
Automatic Data Set Locking 31
Using Engines with SAS/GRAPH Software 31
Running SAS/GRAPH Programs 31
Modes of Operation 31
Running in Batch Mode 32
RUN-Group Processing 33
With global and local statements 33
With BY statements 33
With the WHERE Statement 33
Procedure Output and the Graphics Output Area 34
About the Graphics Output Area 34
External Dimensions 34
Device Resolution 35
Cells 36
Units 38
Placement of Graphic Elements in the Graphics Output Area 39
How Errors in Sizing Are Handled 40
Making Programs Portable 40
Overview
In general, SAS/GRAPH programs work like other SAS programs: the SAS/GRAPH
procedures use data from SAS data sets to produce output – in this case, graphics
output. In addition, SAS/GRAPH programs define the output environment and control
the format and destination of the graphics output. This chapter discusses SAS/GRAPH
programs and explains how they produce graphics output. It describes
3 the language elements used by SAS/GRAPH programs
26 Language Elements Chapter 2
Language Elements
The language elements used by SAS/GRAPH programs include SAS/GRAPH
procedures, SAS/GRAPH statements, and Annotate data sets. In addition to
SAS/GRAPH language elements, your SAS/GRAPH program may include Base SAS
statements and procedures that you use to process your data or control the destination
or format of your program output.
SAS/GRAPH Procedures
SAS/GRAPH procedures create graphics output, process data for other SAS/GRAPH
procedures to use, or manage graphics output that has been stored in a catalog. A
SAS/GRAPH procedure step typically contains these statements:
PROC statement
starts the procedure. Typically it identifies input and output data sets, and assigns
a destination for graphics output. For information on data sets and data
requirements, see “SAS Data Sets” on page 29. For information on assigning
graphics catalogs, see “Storing Graphics Output in SAS Catalogs” on page 53.
Subordinate statements
perform the work of the procedure; subordinate statements that generate graphs
are called action statements. For example, the HBAR statement in the GCHART
procedure is an action statement.
RUN statement
executes the statements in the procedure step. Use the QUIT statement to end the
procedure. See also “RUN-Group Processing” on page 33.
In addition, many SAS/GRAPH procedures can use the following statements:
BY statement
causes the procedure to produce multiple graphs, each corresponding to a BY
variable value. Each graph that is produced for a value of a BY variable is stored
as a separate catalog entry in either the default catalog, WORK.GSEG, or in the
catalog you specify with a GOUT= option in the PROC statement. See “BY
Statement” on page 141 for a complete description.
NOTE statement
adds text to the graphics output. See “TITLE, FOOTNOTE, and NOTE
Statements” on page 210 for a complete description.
You can also use other SAS language statements with SAS/GRAPH procedures. See
“Other SAS Language Statements” on page 27.
SAS/GRAPH Programs Other SAS Language Statements 27
LABEL statement
assigns a descriptive text string to a variable. Unless other text is specified in the
SAS/GRAPH program, the label appears in place of the variable name.
LIBNAME statements
identify SAS libraries that contain SAS data sets or catalogs that you want to use
with your SAS/GRAPH programs. See “LIBNAME Statement” on page 29 for more
information.
ODS statements
direct the output from certain SAS/GRAPH procedures to the Output Delivery
System.
The ODS LISTING statement directs PROC GDEVICE output to the SAS
listing file.
The ODS HTML statement is used with the GIF driver to direct graphics
output to one or more GIF files and create a variety of HTML files that can display
the GIF files in a Web browser. See “ODS HTML Statement” on page 164 for
information on using the ODS HTML statement with SAS/GRAPH procedures.
OPTIONS statement
changes the value of one or more SAS system options.
QUIT statement
executes any statements that have not executed and ends the procedure.
WHERE statement
specifies observations from SAS data sets that meet a particular condition. Using
a WHERE statement provides an easy way to graph a subset of your data.
For a complete description of these statements, see SAS Language Reference:
Dictionary.
FILENAME Statement
The FILENAME statement associates a SAS fileref with an external text file or
output device. With SAS/GRAPH software, you can use a FILENAME statement to
3 point to a text file that you want to use for data input or output.
3 assign the destination of a graphics stream file (GSF). This destination can be
either a single, specific file or an aggregate file storage location, such as directory
or PDS. See “About Exporting SAS/GRAPH Output” on page 59 for information on
creating graphics stream files.
You can also use the FILENAME statement to route input to and from other devices.
For details, see the SAS documentation for your operating environment.
A FILENAME statement that points to an external file has this general form:
FILENAME fileref ’external-file’;
fileref
is any SAS name.
external-file
is the physical name of the external file or aggregate file storage location you want
to reference. For details on specifying the physical names of external files, see the
SAS documentation for your operating environment.
For a complete description of the FILENAME statement, see SAS Language
Reference: Dictionary.
SAS/GRAPH Programs Temporary and Permanent SAS Data Sets 29
LIBNAME Statement
The LIBNAME statement associates a libref with a SAS data library. A SAS data
library can be either temporary or permanent. Typically, SAS data libraries used with
SAS/GRAPH software contain
3 SAS files for data input and output.
3 SAS catalogs that contain maps, fonts, or device entries.
3 SAS catalogs that contain graphics output. These catalogs are often stored in
permanent libraries. See “Storing Graphics Output in SAS Catalogs” on page 53
for information on storing graphics output in a permanent catalog.
The LIBNAME statement has this general form:
LIBNAME libref ’SAS-data-library’;
libref
is any SAS name.
SAS-data-library
is the physical name for the SAS data library on your host system. For details on
specifying SAS-data-library, see the SAS documentation for your operating
environment.
The libref WORK is reserved; it always points to an area where temporary data sets
and catalogs are kept. The contents of WORK are deleted when you exit a SAS session.
For a complete description of the LIBNAME statement, see SAS Language Reference:
Dictionary.
If you omit the DATA= option, the procedure uses the value of the SAS system option
_LAST_=. The default for _LAST_= is the most recently created SAS data set (either
permanent or temporary) in the current SAS job or session.
If you do not specify a data set and no data set has been created in the current SAS
session, an error occurs and the procedure stops.
Most of the procedures that read data sets or create output data sets accept data set
options. SAS data set options appear in parentheses after the data set specification, as
shown in this example:
proc gplot data=reflib.stocks(where=(year=1997));
For more information on SAS data sets and other data processing details, see SAS
Language Reference: Concepts. For a complete discussion of SAS data set options and
SAS system options, see SAS Language Reference: Dictionary.
Typically, permanent SAS data sets have a two-level name of the form
libref.SAS-data-set-name in which libref identifies a storage location on your host
system. A LIBNAME statement associates a libref with the storage location. See also
“LIBNAME Statement” on page 29. For example, these statements specify a permanent
data set:
libname reflib ’my-SAS-library’;
proc gplot data=reflib.stocks;
You can use a one-level name for permanent SAS data sets if you specify a USER
data library. In this case, the procedure assumes that data sets with one-level names
are in the USER data library instead of in the WORK data library. You can assign a
USER data library with a LIBNAME statement or the USER= SAS system option. For
example, these statements use a single-level name to specify a permanent data set that
is stored in the library identified as the USER library:
options user=’my-SAS-library’;
proc gplot data=stocks;
The quotes are required for a file specification; if omitted, SAS treats the specification
as a library reference. In the above example, if the quotes are omitted, SAS creates the
data set in the temporary WORK catalog and identifies it by the name WORK.MYDATA.
To create the file in a location other than the default location, the quoted file
specification must include the full path to the desired location.
You cannot use quoted file specifications for
3 SAS catalog names
3 MDDB and FDB references
3 PROC SQL
3 the _LAST_= system option.
SAS/GRAPH Programs Modes of Operation 31
Note: The default engine for Versions 7 and 8 do not work with the GREDUCE
procedure if the input data set is compressed. 4
For more information about SAS engines, see SAS Language Reference: Concepts.
Modes of Operation
There are several ways to run a SAS program. You can use
3 SAS windowing environment that gives you a text editor from which to submit
programs, windows for the SAS log and SAS output, and many other facilities
3 interactive line mode, in which you submit programs one line at a time
3 noninteractive mode, which executes a SAS program (stored in a file) in your
current terminal session
32 Running in Batch Mode Chapter 2
3 batch mode, which executes a SAS program (stored in a file) in a separate session.
The mode you use determines whether the graphics output displays on your monitor.
If you use the SAS windowing environment, 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 Chapter 4, “SAS/GRAPH Output,” on page 47 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 GOPTIONSChapter 36,
“The GOPTIONS Procedure,” on page 1075 statement to determine how to handle the
graphics output.
SAS Monospace is available on all hosts and other fonts can be made available by
running PROC FONTREG.
proc fontreg fontpath ’directory_containing_TT_or_Type1_fonts’;run;
FreeType font support is also available with the Universal GIF driver.
options dev=sasprtc printerpath=gif;
proc gtestit pic=1;run;
SAS/GRAPH Programs RUN-Group Processing 33
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 statement, it is best to use a QUIT
statement after each procedure that uses RUN-group processing, rather than relying on
a new procedure to end the processing. Running too many procedures without an
intervening QUIT statement can use up so much memory as to crash the system
(depending, of course, on how many other processes are running). Also, note that failing
to do a QUIT before doing an ODS CLOSE results in the process memory not being
freed at all. 4
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” on page
141.
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:
3 With the GMAP procedure, the WHERE variable must be in the input data set.
3 With a procedure that is using an Annotate data set, the following requirements
must be met:
3 The ANNOTATE= option must be included in the action statement.
3 The WHERE statement must be executed before the action statement.
3 The WHERE variable must occur in the Annotate data set.
External Dimensions
The graphics output area is contained within the device’s display area. The external
dimensions of the device’s display area are controlled by the values of the XMAX and
YMAX device parameters. XMAX sets the maximum horizontal dimension; YMAX sets
the maximum vertical dimension. The orientation of the graphics output area, that is,
whether it is landscape or portrait, is determined by whether the larger value is XMAX
(orientation is landscape) or YMAX (orientation is portrait).
SAS/GRAPH Programs About the Graphics Output Area 35
The external dimensions of the graphics output area are controlled by the values of
the HSIZE and VSIZE device parameters.
Typically, the default dimensions of the graphics output area are the same as the
dimensions of the device. This is usually true for display devices. For those devices, the
default value of HSIZE and VSIZE is 0. However, for hardcopy devices, the XMAX,
YMAX values represent the external boundaries of the output medium (such as a sheet
of paper). If these devices need a margin, HSIZE, VSIZE and HORIGIN, VORIGIN are
assigned default values and the default graphics output area is somewhat smaller than
the device’s display area. Figure 2.1 on page 35 illustrates such a device.
HSIZE=8.0in
YMAX=11.00in
YPIXELS=3300
VSIZE=8.5in
display area
HORIGIN=0.218in
VORIGIN=1.496in
Note that HORIGIN and VORIGIN define the left margin and bottom margin,
respectively. The right margin and top margin are calculated by the device driver as
follows:
right-margin = XMAX − (HSIZE + HORIGIN)
top-margin = YMAX −(VSIZE + VORIGIN)
You cannot specify values for right-margin and top-margin.
You can change the dimensions of the graphics output area for a SAS session or for a
single graph with the HSIZE= and VSIZE= graphics options. Changing the size of the
graphics output area does not change the dimensions of the device’s display area or
affect the resolution. The values of HSIZE= and VSIZE= cannot exceed the maximum
dimensions for the device as specified by XMAX and YMAX. Furthermore, you cannot
specify values for graphics options HSIZE= and VSIZE= that exceed the HSIZE and
VSIZE values in the device entry.
Device Resolution
The resolution of a device is the number of pixels per inch. It is determined by the
values of the device parameters XMAX, YMAX, and XPIXELS, YPIXELS, and is
calculated by dividing the number of pixels by the corresponding external dimension.
For example,
x-resolution = XPIXELS / XMAX
Therefore, the X resolution of the PSCOLOR device illustrated in Figure 2.1 on page
35 is 300dpi (dots per inch).
Ordinarily, you do not want to change the device resolution because changing it may
distort your image. However, you may want to change the size of the display area. To
36 About the Graphics Output Area Chapter 2
do so without changing the resolution, use the GOPTIONS statement to change the
values of only XPIXELS= and YPIXELS=, or the values of only XMAX= and YMAX=.
Then SAS/GRAPH will automatically calculate the correct value for the unspecified
parameters so that the device retains the default resolution.
If you do want to change the device resolution (usually for image files or graphs that
are displayed online), specify values for both XMAX= and XPIXELS= (horizontal
resolution) or both YMAX= and YPIXELS= (vertical resolution), or all four. In these
cases, SAS/GRAPH changes the dimensions and recalculates the device resolution.
Table 2.1 on page 36 summarizes the interaction of these options.
XMAX= and YMAX= not XPIXELS= and YPIXELS= changes the dimensions and
recalculates the value of
XPIXELS= and YPIXELS= in
order to retain the resolution
Cells
Within the graphics output area, SAS/GRAPH software defines an invisible grid of
rows and columns. This grid is made up of character cells as shown in Figure 2.2 on
page 37.
The size and proportion of these cells affects the size and appearance of graphic
elements that are drawn using units of CELLS. The attributes of the cells are
determined by both the external dimensions of the graphics output area (controlled by
HSIZE and VSIZE) and the number of rows and columns. The number of rows is
controlled by the LROWS (if orientation is landscape) or PROWS (if orientation is
portrait) device parameter. Similarly, the number of columns is controlled by the
LCOLS (landscape) or PCOLS (portrait) device parameter.
You can change the number of rows and columns in the grid with the HPOS= and
VPOS= graphics options. HPOS= overrides the value of LCOLS or PCOLS and sets the
number of columns in the graphics output area. VPOS= overrides the value of LROWS
or PROWS and sets the number of rows in the graphics output area.
Figure 2.2 on page 37 illustrates the relationship between the graphics options or
device parameters that determine the dimensions of the graphics output area and those
that determine the number of character cells within the graphics output area.
SAS/GRAPH Programs About the Graphics Output Area 37
Figure 2.2 Rows, Columns, and Cells in the Graphics Output Area
HPOS=8
(columns in graphics output area; can also be
defined by LCOLS or PCOLS device parameter)
character
cell
VPOS=6 VSIZE=6 in
(rows in (can also be
graphics output defined by
area; can also YMAX device
be defined by parameter)
LROWS or
PROWS device
parameter)
HSIZE=8 in
(can also be defined by XMAX device parameter)
Changing only the external dimensions of the graphics output area (HSIZE= and
VSIZE=) retains the cell size but causes SAS/GRAPH to automatically recalculate the
number of rows and columns, as illustrated in Figure 2.3 on page 37.
HPOS=8
VPOS=18 VSIZE=9IN
(recalculated) (specified)
VPOS=12 VSIZE=6IN
HSIZE=4IN HSIZE=6IN
(specified)
Changing only the number of rows and columns (HPOS and VPOS) changes the size
of the cells without altering the overall size of the output. Figure 2.4 on page 37 shows
how increasing the number of rows and columns reduces the size of the individual cells.
VPOS=10 VSIZE=6IN
(specified) (no change)
VPOS=12 VSIZE=6IN
HSIZE=4IN HSIZE=4IN
(no change)
38 About the Graphics Output Area Chapter 2
Usually, you should not change the number of rows and columns from the default for
your device. However, if you must change them to make a graph fit, note that the size
of text in the graphics output will change if you specified text size using units of
CELLS. If the cells are large (that is, HPOS= and VPOS= have small values), the text
may not fit. If the cells are too small, the text may be too small to read. In this case,
you can adjust the size of the text with the HEIGHT= statement option or the HTEXT=
graphics option.
To change all the attributes of the graphics output area, specify values for all four
options, as shown in Figure 2.5 on page 38.
Figure 2.5 Changing HSIZE=, VSIZE= and HPOS=, VPOS= Changes Dimensions
and Number and Size of Cells
HPOS=6
(specified)
HPOS=8
VPOS=10 VSIZE=7.5IN
(specified) (specified)
VPOS=12 VSIZE=6IN
HSIZE=4IN HSIZE=6IN
(specified)
Table 2.2 on page 38 summarizes the interaction of the HSIZE=, VSIZE=, HPOS=,
and VPOS= graphics options.
HPOS= and VPOS= not HSIZE= and keeps the external dimensions but changes the
VSIZE= cell size according to the number of rows and
columns.
HSIZE= and VSIZE= HPOS= and VPOS= changes the dimensions of the graphics output
area, the number of rows and columns, and
recalculates the cell size.
Units
By default, most graphic elements are drawn using units of CELLS to determine
their size. For example, the default character height for the TITLE1 definition is two
cells; for all other text the default height is one cell.
Changing the cell size to control the size of one element, such as text, may distort
other parts of your graph. Instead, you may want to change the type of units that
SAS/GRAPH uses to control the size of the graphic elements. In addition to CELLS and
other absolute units such as inches (IN), centimeters (CM), and points (PT), you can
often use units of percent of the graphics output area (PCT). This unit specification
SAS/GRAPH Programs Placement of Graphic Elements in the Graphics Output Area 39
allows the height of the graphic elements to change in proportion to the size of the
graphics output area.
You can specify the type of unit for individual graphic elements or you can use the
GUNIT= graphics option to set the default units that will be used for most height
specifications.
Note: Titles and footnotes can be positioned elsewhere on the graph as well, with
different effects on space allocation. See “TITLE, FOOTNOTE, and NOTE Statements”
on page 210 for details. 4
Figure 2.6 Default Locations for Graphic Elements in the Graphics Output Area
optional
area for
titles and
footnotes
optional procedure
area for output
titles and area
footnotes
graphics
output
area
Note: If the titles, footnotes, and legend are very large, they may make the
procedure output area too small for the graph. You can control the size of title and
footnote text and of most legend elements with statement options. For details, see
Chapter 7, “SAS/GRAPH Statements,” on page 121 for a description of the appropriate
statement. In addition, “GOPTIONS Statement” on page 146 lists the graphics options
that control the size of various graphic elements. See also “Making Programs Portable”
on page 40. 4
40 Making Programs Portable Chapter 2
See “GUNIT” on page 309 for a complete description of the GUNIT= graphics
option.
3 Compare colors and patterns for the devices you will use and use the colors of the
device that has the fewest colors, With a slide camera, for example, you can choose
from over 16 million colors, but some graphics monitors display only four or eight
colors at a time.
If you want to generate a graph on both a color device and a black-and-white
device, such as a laser printer or a monochrome graphics monitor, all colors are
remapped to black, white, or scales of gray, depending on the device. However,
with the PATTERN statement, you can substitute line-patterns for colors.
3 Preview the appearance of the output on a different device with the
TARGETDEVICE= graphics option. For example, to see how the output will look
on a color PostScript printer, specify
goptions targetdevice=pscolor;
41
CHAPTER
3
Device Drivers
Overview 41
About Device Drivers 42
Types of Device Drivers 42
How Device Drivers Are Assigned 43
Selecting a Device Driver 43
Viewing the List of Available Device Drivers 44
Browsing the Contents of a Device Entry 44
Specifying a Device Driver in a SAS Session 44
Controlling Output with Device Drivers 45
Modifying Device Parameters Permanently 45
Overriding Device Parameters Temporarily 46
Graphics Options 46
Statement Options 46
Overview
SAS/GRAPH procedures that produce graphics output require a device driver to
display the output. This chapter discusses the role of device drivers in generating
SAS/GRAPH output, provides directions for selecting and specifying device drivers, and
explains how you can change the settings of device parameters.
Other tasks related to device drivers are discussed in Chapter 4, “SAS/GRAPH
Output,” on page 47 and Chapter 9, “Introducing SAS/GRAPH Output for the Web,” on
page 369 and in the SAS Help facility for SAS/GRAPH. These include
3 displaying graphics output (see “Displaying Graphics Output on Monitors or
Terminals” on page 49)
3 previewing on one device how output will look on another device (see “Previewing
Output” on page 52)
3 sending graphics output to a printer or other hardcopy device (see “Printing
Graphics Output” on page 51)
3 creating external files in other graphics formats for use with other applications
(see “About Graphics Stream Files” on page 60)
3 creating graphics output that can be referenced in an HTML file and viewed with
a Web browser (see “About Graphics Stream Files” on page 60)
For a description of device catalogs and for information on creating and modifying
device drivers, see Chapter 31, “The GDEVICE Procedure,” on page 915.
42 About Device Drivers Chapter 3
For more information about Universal Printing, see the Base SAS Software section in
SAS Help and Documentation. For more information about Windows printing, see the
SAS Help facility for SAS/GRAPH.
The NOFS on page 921 option in the PROC GDEVICE statement causes the
procedure not to use the GDEVICE windows.
If you want to write the list of devices to an external file you can
3 save the contents of the Output window.
3 use the PRINTTO procedure to redirect the GDEVICE procedure output to
an external file. See Base SAS Procedures Guide for a description of the
PRINTTO procedure.
Once you have generated the list of available device drivers, you can search the list
until you find the description that matches your output device. The corresponding name
is the name that you specify as the device driver.
display past the device’s capability or if you specify colors for a device that cannot
display them, you will get unpredictable results.
Note: If you run SAS/GRAPH software in a multi-user environment, you should not
change the device entries in the Institute-supplied catalog, SASHELP.DEVICES, unless
you are the system administrator or the SAS Support Consultant. 4
If you need to change a device driver in SASHELP.DEVICES, copy it into a personal
catalog named DEVICES, and then modify the copy. To use the new device driver,
assign the libref GDEVICE0 to the library that contains the modified copy. See
“Creating or Modifying Device Entries” on page 934 for details.
Graphics Options
To override device parameter settings with graphics options, simply submit the
options in a GOPTIONS statement. For example, the HSIZE= and VSIZE= graphics
options control the default size of the graphics output area and override the values of
the HSIZE= and VSIZE= device parameters in the current device entry. The following
GOPTIONS statement changes the dimensions of the graphics output area:
goptions hsize=6in vsize=4in;
These new values remain in effect until you change them, use the RESET= graphics
option to reset them, or end your SAS session.
The values that you specify for graphics options must be supported by your graphics
device. If you use an option that is not supported, SAS/GRAPH software ignores the
option. See “GOPTIONS Statement” on page 146 for information about specifying
graphics options.
Statement Options
You can also override parameters that control such attributes as text color and font
by using options in other SAS/GRAPH statements. For example, this TITLE statement
explicitly specifies the text color and font:
title color=blue font=zapf ’Production Quality’;
The COLOR= option overrides the default color selection from the device entry’s
colors list as well as any graphics options that affect text color. The FONT= option
overrides the device’s default font and any graphics options that affect the font. As long
as the values are supported by your graphics device, the values you specify in the
statements override the corresponding device parameters and graphics options when
the SAS program is executed.
When you specify options that override device parameter settings, this is the order of
precedence that SAS/GRAPH software uses:
1 options in a SAS/GRAPH procedure statement or AXIS, FOOTNOTE, LEGEND,
NOTE, PATTERN, SYMBOL, or TITLE statement
2 graphics options in a GOPTIONS statement
3 device parameters in a device entry
4 default hardware settings of a device.
47
CHAPTER
4
SAS/GRAPH Output
Example 66
Saving Multiple Graphs to Multiple Files 68
Example 68
Replacing Existing External Files 70
Example 71
Other Ways to Assign the Destination 72
Using GACCESS=GSASFILE 72
Using GACCESS= to Explicitly Specify a Destination 72
Exporting SAS/GRAPH Output Using Modified Device Entries 72
73
The Metagraphics Driver Facility 73
catalog-name
is the name of the catalog whose contents you want to view. The default is
WORK.GSEG. If the specified catalog does not contain any graphics entries, the
window opens but is empty. The catalog assignment is temporary and remains in
effect only while the GRAPH window remains open. To change the catalog,
resubmit the GRAPHn command.
entry-name
is the name of the catalog entry that you want to view. If you omit entry-name or
the entry does not exist, the last graph in the catalog is displayed. If you specify
entry-name, you must also supply the libref and catalog name.
GRSEG
is the type of catalog entry.
To close the GRAPH window, issue the END command.
Doing any of the following may change the HSIZE and VSIZE values and
consequently the size of the GRAPH window:
3 changing the device driver
3 specifying a target device
3 specifying dimensions with the HSIZE= and VSIZE= graphics options.
In addition, resizing the GRAPH window can reduce the number of cells available for
the output. In order to display some types of graphs in a reduced GRAPH window, you
may need to increase the number of cells either by using the HPOS= and VPOS=
graphics options or by modifying the device driver. To ensure that graphs have an
adequate number of cells, use a full-size GRAPH window when creating the graphs.You
can then reduce the window to replay the graphs. For more information on dimensions
and cell size, see “About the Graphics Output Area” on page 34.
If you create most or all of your graphs at the same size or with the same aspect
ratio, you can avoid distortion if you size the window before you draw the graphs and
then use the WSAVE command to save the position and dimensions of the window. If
you resize the GRAPH windows and do not use the WSAVE command, the new size is
not saved, even in the same SAS session.
number of seconds before the next graph is drawn. NOPROMPT suppresses the delay
between the graphs displayed. In this case, SAS/GRAPH automatically returns to your
program after the last graph displays. (See Chapter 8, “Graphics Options and Device
Parameters Dictionary,” on page 261 for a complete description of these graphics
options.)
With the direct display method, you cannot scroll to other graphs in the catalog. To
redisplay graphs, you must rerun the procedure or replay the catalog entries. For
information on replaying graphs, see Chapter 43, “The GREPLAY Procedure,” on page
1237.
Previewing Output
If you want to preview how a graph is going to appear on another device before you
send it to that device, you can use the TARGETDEVICE= graphics option. For example,
SAS/GRAPH Output Accessing Catalogs from Different Versions of SAS 53
CAUTION:
You can read Version 6 catalogs from Version 7 and Version 8, but you cannot write to
them unless you port them. 4
In some cases you have to specify an engine to read a Version 6 catalog from the
current SAS version:
3 If you are running the current version and you assign a libref that points to a
library that contains only Version 6 catalogs, the correct engine is automatically
54 Creating and Specifying Catalogs Chapter 4
applied and you can view the entries. However, you cannot write to the catalog
without porting it.
3 If you are running Version 7 or Version 8 and you assign a libref that points to a
library that contains both Version 6 and the current version catalogs, the
LIBNAME statement must specify the SASEB engine to view the entries in the
Version 6 catalog. Even with the engine assigned, you cannot write to the catalog
without porting it.
For more information, see “Transporting Catalogs across Operating Environments”
on page 56.
All Version 7 and Version 8 applications that support catalog entries that also existed
in Version 6 should be able to transparently read those Version 6 catalog entries. That
is, if a Version 7 or Version 8 user specifies the SASEB (Version 6 compatibility) engine
on the LIBNAME statement, the application should be able to read and process any
Version 6 data that the SASEB engine may return.
The Version 7 and Version 8 compatibility engines also support write access to
Version 6 catalogs.
CAUTION:
Be careful using GOUTMODE=REPLACE. GOUTMODE=REPLACE replaces all existing
entries in the output catalog. You cannot retrieve previous entries once they have
been replaced. See “GOUTMODE” on page 302 for more information. 4
SAS/GRAPH Output Modifying SAS/GRAPH Output 55
3 To open a GRAPH window and edit a graph that is stored in a catalog, submit the
GRAPH command from the command line of the SAS Explorer window and add
EDIT to the end of the command. Separate the two commands with a semicolon
(;). For example, the following statement opens the GRAPH3 window, displays the
specified graph, and activates the graphics editor:
graph3 mylib.grafcat.slide1; edit
You can use the graphics editor to change graphics elements already displayed in the
graph such as text, lines, and polygons, or you can add graphics elements to the graph.
You can create, delete, or duplicate a graphics element and select, change, move, or
resize it. You can also change an element’s properties, such as its color or fill pattern, or
its values, such as the coordinates of one of its points. For instance, you can move a bar
from one side of the display area to the other, make a copy of it and place it in yet
another place, and change its fill color and pattern. You can undo and redo changes,
zoom in or out on the display, move an element to the foreground or background, and
read in or link to another graph that has already been created.
After you have made changes, you can save your modifications to a catalog and send
the modified graph to an output device, such as a printer.
For a complete description of the graphics editor, refer to the SAS Help facility for
SAS/GRAPH.
Note: Modifying your graphics output with the graphics editor does not change the
SAS programs that generated that output. 4
To retain the original order of the GRSEG entries in the catalog, use SELECT=
in the PROC CPORT statement to export individual graphs in the order they were
created. Otherwise, when you use the GREPLAY procedure to list the graphics
entries in the imported catalog, the procedure will list the entries in alphabetical
order, rather than the order in which they were created.
Note: Only the GREPLAY procedure can list catalog entries in the order they
were created. All other procedures list entries in alphabetical order.
To export a catalog that contains groups of entries created using the GREPLAY
procedure, you must use SELECT= in the PROC CPORT statement to select the
names of the groups, rather than the names of individual graphs, to be included in
the transport file. If you export the entire catalog without using SELECT=, the
groups are not maintained in the catalog created when you import the transport
file in the new host environment.
When you use the CPORT procedure, messages in the SAS log identify the
catalog entries that have been placed in the transport file. If the catalog entry was
created by replaying several graphs into a template, the log messages list the
names of all of the entries that contributed to the templated graph.
2 Move the transport file to the target machine, if necessary. You must move the
transport file in binary format. If you do not move the transport file in binary
format, the CIMPORT procedure cannot read the file you create.
Operating Environment Information: Use communications software or tape to
move the transport file. Refer to the documentation for your network or standard
procedures for using tape files. 4
3 Once you have moved the transport file to the target machine, import the
transport file into a catalog in the new host environment using the CIMPORT
procedure. The entries are imported in the order specified in SELECT= in the
PROC CPORT statement used to create the transport file.
The SELECT= option in the PROC CIMPORT statement does not affect the
order of the imported entries.
Note: You must use the CIMPORT procedure from the current version of the SAS
System. The CIMPORT procedure in a previous release cannot read a transport file
created by the CPORT procedure in the current version. For details on using the
CPORT and CIMPORT procedures, see the Base SAS Procedures Guide. 4
Once the transport file has been moved to the new host environment using
communications software or tape, the CIMPORT procedure creates a new catalog called
MYLIB.GRAPHS on the new machine.
58 Transporting Catalogs across Operating Environments Chapter 4
After moving the transport file to the new host environment, you can import the color
map using the following statements:
filename tranfile ’external-file’;
libname newlib ’SAS-data-library’;
After moving the transport file to the new host environment, you can import the font
using the following statements:
filename tranfile ’external-file’;
libname gfont0 ’SAS-data-library’;
could export a device entry from the GDEVICE0.DEVICES catalog using the following
statements:
filename tranfile ’external-file’;
libname gdevice0 ’SAS-data-library’;
After moving the transport file to the new host environment, you can import the
device entry using the following statements:
filename tranfile ’external-file’;
libname gdevice0 ’SAS-data-library’;
In order to do these kinds of things with your SAS/GRAPH output, you must export
your graphs from SAS/GRAPH, using a different graphics file format, such as CGM,
GIF, or TIFF, and store them in external files.
For information on creating SAS/GRAPH output for Web publishing, see Chapter 9,
“Introducing SAS/GRAPH Output for the Web,” on page 369. For information on
SAS/GRAPH language elements and programs and on how procedure output is
generated, see Chapter 2, “SAS/GRAPH Programs,” on page 25. For information on
using and managing SAS/GRAPH output, see Chapter 4, “SAS/GRAPH Output,” on
page 47.
General Information
Common Requirements
Regardless of the process you use to create a GSF from a SAS/GRAPH program, you
must specify the following:
3 a destination for the output. This can be an aggregate file storage location (for
example, a directory or a partitioned data set) or a specific file. Typically you
specify the destination with a FILENAME statement and one or more graphics
options. For more information, see “FILENAME Statement” on page 28.
3 a device driver that creates the type of graphics output that you want.
3 whether SAS/GRAPH should replace an existing file or append new records to it.
By default, SAS/GRAPH replaces an existing file with newly created output of the
same name. For details, see “Replacing Existing External Files” on page 70.
SAS/GRAPH Output General Information 63
File extensions
When you send SAS/GRAPH output to an aggregate file storage location,
SAS/GRAPH generates the name of the external file by taking the catalog entry name
and adding the appropriate file extension. Most drivers provide a default extension. If a
driver does not generate an extension, SAS/GRAPH uses the default extension .GSF. To
specify a different extension from the one SAS/GRAPH provides, use the EXTENSION=
graphics option. (For details, see “EXTENSION” on page 288).
Example
illustrates how SAS/GRAPH generates names for catalog entries and external files,
depending on 1) whether the NAME= option is used, and 2) on the fileref specification.
This illustration assumes the GSLIDE procedure and DEV=GIF:
64 Saving One Graph to a File Chapter 4
Table 4.1 How SAS/GRAPH Generates Entry Names and File Names
NAME= (not specified) fileref points to a file named catalog entry name: GSLIDE
’MYSLIDE.GIF’ external file name:
MYSLIDE.GIF
NAME= (not specified) fileref points to a storage catalog entry name: GSLIDE
location (for example, a external file name:
directory) GSLIDE.GIF
Note: When the fileref points to an aggregate file storage location, the name of the
catalog entry always determines the name of the external file. It does not matter
whether the catalog entry name is the default name or a name assigned by NAME=. 4
CAUTION:
If the graph created by the program already exists in the catalog, a new catalog entry with
an incremented name will be created and a new external file may be created rather than
updating the existing file. 4
You cannot replace individual entries in a catalog; therefore, to replace an entry you
must first delete the entry and then re-create it. Therefore, even though the contents of
the external file are replaced, the catalog entry is not. Each time you submit the
program, a new entry is created and the catalog entry name is incremented.
Example
This example creates one GSF that contains one text slide created by a group of
TITLE and FOOTNOTE statements and the GSLIDE procedure.
Define the fileref. The FILENAME statement associates the fileref GRAFOUT with
the external file that is the destination for the GSF. The file extension .PS indicates
that the graphics output is PostScript.
filename grafout ’mygraph.ps’;
Specify graphics options for the GSF. RESET=ALL resets all global statements and
graphics options. DEVICE= specifies a PostScript device driver. GSFNAME= assigns
the fileref GRAFOUT as the destination for the GSF. GSFMODE=REPLACE (the
default) causes the contents of the external file to be replaced each time the graphics
procedure is run.
goptions reset=all
device=pscolor
gsfname=grafout
gsfmode=replace
ftext=swissb;
Produce one text slide. NAME= specifies the name that is assigned to the catalog
entry created by the procedure. If you omit NAME=, SAS/GRAPH uses the default
naming convention to name the entry.
proc gslide border name=’proposal’;
title1 h=4 ’Proposed Design Improvements:’;
title2 h=3 ’* Increase Stability’;
title3 h=3 ’* Increase Speed’;
title4 h=3 ’* Reduce Weight’;
footnote h=2 j=l ’ABC Company’;
run;
quit;
When you submit these statements, SAS/GRAPH does the following if no graphs of
the same name exist in the catalog:
3 Creates one catalog entry named PROPOSAL in WORK.GSEG.
3 Creates one external file that contains the output from the GSLIDE procedure and
sends a message to the LOG reporting the number of records and the name of the
file to which they were written. The file name is the one specified in the
FILENAME statement.
Because the destination is a specific file and because GSFMODE=REPLACE, each
time you run the program it replaces the contents of the external file. Therefore, this
method is particularly useful when you want to update an external file by resubmitting
an existing program.
However, if there is more than one run of a graphics procedure in this program, the
file would contain only the graphics output from the last procedure run because this
program replaces the external file each time a graphics procedure is run.
Note: Even though the contents of the external file are replaced, the catalog entry is
not. Unless you explicitly delete the existing entry named PROPOSAL, each time you
66 Saving Multiple Graphs to One File Chapter 4
submit the program, a new entry is created and the catalog entry name is incremented.
This table illustrates what happens if you submit the above program three times
without deleting the catalog entries: 4
Table 4.2
1 PROPOSAL mygraph.ps
2 PROPOSA1 mygraph.ps
3 PROPOSA2 mygraph.ps
Note that each new catalog entry replaces the contents of the external file, in this
case, mygraph.ps. For more information, see “Replacing Existing External Files” on
page 70.
For a complete description of the graphics options used in this example, see Chapter
8, “Graphics Options and Device Parameters Dictionary,” on page 261.
Example
This example stores several text slides in one external file. The program is the same
as the previous example except the GOPTIONS statement specifies
GSFMODE=APPEND and the GSLIDE procedure uses RUN-group processing to create
multiple slides. Each slide includes the current TITLE statement and all previously
defined TITLE and FOOTNOTE statements.
Define the fileref.
filename grafout ’mygraph.ps’;
Specify graphics options for the GSF. GSFNAME= assigns the fileref GRAFOUT as
the destination for the GSF. GSFMODE=APPEND adds each new piece of output to the
end of the external file.
goptions reset=all
device=pscolor
gsfname=grafout
gsfmode=append
ftext=swissb
rotate=landscape;
Produce four text slides. Each RUN-group generates a new catalog entry. NAME=
specifies the base name for each catalog entry created by the procedure.
proc gslide border name=’proposal’;
footnote h=2 j=l ’ABC Company’;
title1 h=4 ’Proposed Design Improvements:’;
SAS/GRAPH Output Saving Multiple Graphs to One File 67
run;
title1 h=3 ’* Increase Stability’;
run;
title1 h=3 ’* Increase Speed’;
run;
title1 h=3 ’* Reduce Weight’;
run;
quit;
When you submit these statements, SAS/GRAPH does the following if no graphs of
the same name exist in the catalog:
3 Creates a new catalog entry for each graph, beginning with the name PROPOSAL.
After the first graph is created, the entry name is incremented so that subsequent
graphs are called PROPOSA1, PROPOSA2, and so forth.
3 Creates one external file that contains all of the output from the GSLIDE
procedure. The file name is the one specified in the FILENAME statement. Each
time a graph is added to the file, SAS/GRAPH sends a message to the LOG
reporting the number of records and the name of the file to which they were
appended.
Note: Because the destination is a specific file and because the GSFMODE= setting
is APPEND, each time you run the program SAS/GRAPH adds the new graphs to the
external file. If you want the file to contain only the newly created graphs, delete it
before resubmitting the program. 4
In addition, if you resubmit the program without deleting the original catalog entries,
SAS/GRAPH will create four new entries that will be added to the catalog entry and four
new graphs appended to the external file, both of which will contain all eight graphs.
This table illustrates what happens if you submit this program twice without
deleting the catalog entries or the external file:
Table 4.3
PROPOSA2
PROPOSA3
2 PROPOSAL mygraph.ps PROPOSAL, PROPOSA1,
PROPOSA1 PROPOSA2, PROPOSA3,
PROPOSA4, PROPOSA5,
PROPOSA2
PROPOSA6, PROPOSA7
PROPOSA3
PROPOSA4
PROPOSA5
PROPOSA6
PROPOSA7
For more information, see “Replacing Existing External Files” on page 70.
68 Saving Multiple Graphs to Multiple Files Chapter 4
Although the general technique is the same, there are significant differences between
directing your graphics output to a specific file and directing it to an aggregate file
storage location. These differences are mostly concerned with how the file is named.
When the destination is an aggregate file storage location, SAS/GRAPH not only
creates the external file, it also names it. When SAS/GRAPH names an external file, it
always uses the name of the entry in the output catalog. This name is either
3 the name you specify in the NAME= option in the procedure
3 the default name supplied by SAS/GRAPH, such as GSLIDE.
In addition, SAS/GRAPH automatically appends the correct file extension to the
external file name. For example, if the output is named Q1SALES and the external file
is a GIF file, the file name is Q1SALES.GIF.
This technique of building the file name from the catalog entry name affects what
you do when you want to replace the contents of a file created in this way. For details,
see “Replacing Existing External Files” on page 70.
Example
This example creates four text slides and stores each one in a separate external file.
The program is similar to the previous examples except the fileref points to an
aggregate storage location instead of to a specific file.
Define the fileref. The FILENAME statement assigns an aggregate file storage
location as the destination for the files.
filename grafout ’external-file-location’; /* such as a directory */
Specify graphics options for the GSF. GSFNAME= assigns the fileref GRAFOUT as
the destination for the GSF. GSFMODE=REPLACE (the default) replaces the contents
of the external files with catalog entries of the same name.
goptions reset=all
device=pscolor
gsfname=grafout
SAS/GRAPH Output Saving Multiple Graphs to Multiple Files 69
gsfmode=replace
ftext=swissb
rotate=landscape;
Produce four text slides. Each RUN-group generates a new catalog entry. NAME=
specifies the base name for each catalog entry that is generated by the procedure. This
name is also the base name for the external files.
proc gslide border name=’proposal’;
footnote h=2 j=l ’ABC Company’;
title1 h=4 ’Proposed Design Improvements:’;
run;
title1 h=3 ’* Increase Stability’;
run;
title1 h=3 ’* Increase Speed’;
run;
title1 h=3 ’* Reduce Weight’;
run;
quit;
When you submit these statements, SAS/GRAPH does the following if no graphs of
the same name exist in the catalog:
3 Creates a new catalog entry for each graph, beginning with the name PROPOSAL.
After the first graph is created, the entry name is incremented so that subsequent
graphs are called PROPOSA1, PROPOSA2, and so forth.
3 Creates one external file for each catalog entry. The name of the file is the same as
the entry name plus the extension. In this case, the files are named
PROPOSAL.PS, PROPOSA1.PS, and so forth. For each file created, SAS/GRAPH
sends a message to the LOG reporting the number of records and the name of the
file to which they were written.
Note: Because you cannot replace individual entries in a catalog, each time you run
the program SAS/GRAPH creates new catalog entries and consequently new files. If
you want to replace the files, you must delete the corresponding catalog entries before
resubmitting the program. 4
This table illustrates what happens if you submit this program twice without
deleting the catalog entries:
70 Replacing Existing External Files Chapter 4
Table 4.4
1 PROPOSAL proposal.ps
PROPOSA1 proposa1.ps
PROPOSA2 proposa2.ps
PROPOSA3 proposa3.ps
2 PROPOSA4 proposa4.ps
PROPOSA5 proposa5.ps
PROPOSA6 proposa6.ps
PROPOSA7 proposa7.ps
Because the catalog names increment, there is never a matching file that the new
catalog can replace. Therefore, unless you delete the existing entries, the program
continues to create new files. To delete the existing entries, first run a GREPLAY
procedure with the DELETE option:
proc greplay igout=work.gseg nofs;
delete proposal proposa1 proposa2 proposa3;
One additional method for replacing catalog entries is rarely recommended because it
is easy to accidentally delete catalog entries that you did not intend to delete. If you
want to replace the entire contents of the catalog and if you are running only one
procedure, you can use the graphics option GOUTMODE=REPLACE. Whenever a new
procedure starts, GOUTMODE=REPLACE replaces the entire contents of the current
catalog with the new entries; it does not replace individual entries.
SAS/GRAPH Output Replacing Existing External Files 71
Example
The following example uses the GREPLAY procedure to explicitly delete specified
catalog entries so that you can re-create them and replace the corresponding external
files. This example uses the permanent catalog MYLIB.GRAFCAT.
3 The GREPLAY procedure explicitly deletes existing catalog entries that have the
same name as the entries to be created. If no entries exist, PROC GREPLAY
issues a message and the program continues.
3 The GSLIDE procedure generates four text slides and stores them in the catalog
specified by GOUT=. NAME= specifies PROPOSAL as the base name for the
catalog entries created by the procedure.
Define the fileref. The FILENAME statement assigns an aggregate file storage
location as the destination for the files.
filename grafout ’external-file-location’;
Specify graphics options for the GSF. GSFNAME= assigns the fileref GRAFOUT as
the destination for the GSF. GSFMODE=REPLACE (the default) replaces the contents
of the external files with catalog entries of the same name.
goptions reset=all
device=pscolor
gsfname=grafout
gsfmode=replace
ftext=swissb
rotate=landscape;
Delete existing catalog entries of the same name. The GREPLAY procedure deletes
the specified catalog entries. These are the catalog names generated by the NAME=
option in the procedure. If the entries do not exist, PROC GREPLAY issues a message
and the program continues.
proc greplay nofs igout=mylib.grafcat;
delete proposal proposa1 proposa2 proposa3;
run;
Produce four text slides. Each RUN-group generates a new catalog entry. NAME=
specifies the base name for each catalog entry generated by the procedure. This name is
also the base name for the external files.
proc gslide border gout=mylib.grafcat name=’proposal’;
footnote h=2 j=l ’ABC Company’;
run;
title1 h=3 ’* Increase Strength’;
run;
title1 h=3 ’* Reduce Drag’;
run;
title1 h=3 ’* Increase Resistance to Sheer’;
run;
quit;
3 creates a new catalog entry in MYLIB.GRAFCAT for each slide, and increments
the entry names: PROPOSAL, PROPOSA1, PROPOSA2, and PROPOSA3.
3 creates one external file for each catalog entry. The file name is built from the
catalog entry name. If a file of the same name already exists, SAS/GRAPH
replaces the contents of the file.
Using GACCESS=GSASFILE
This method is similar to the GSFNAME= method described in the previous sections.
3 Use a FILENAME statement and assign a destination to the fileref GSASFILE.
When you use GACCESS, the fileref must be named GSASFILE. The destination
can be either a specific file or an aggregate file storage location.
3 Assign GSASFILE to the GACCESS= graphics option instead of to GSFNAME=.
For example, these statements define and assign the fileref for an aggregate file
storage location:
/* define a fileref for the destination */
filename gsasfile ’external-file-location’;
Then simply change the device parameters to create an entry that produces graphics
stream files by default.
Often these device parameters correspond to the graphics options in your program.
For example, if your program uses the fileref GRAFOUT, you can enter a value of
Grafout in the Gsfname: field in the Host File Options window.
See Chapter 31, “The GDEVICE Procedure,” on page 915 for more information on
modifying device entries. Refer to the Device Help for SAS/GRAPH in the SAS Help
facility for lists of available drivers and for specific information on modifying device
entries in your operating environment.
CHAPTER
5
SAS/GRAPH Fonts
Overview 75
Specifying Fonts in SAS/GRAPH Programs 75
Font Specifications 76
Default Fonts 77
Font Locations 77
Using Hardware Fonts 78
Default Hardware Fonts 78
Using a GOPTIONS Statement to Change the Default Hardware Font 79
Using the GDEVICE Procedure to Change the Default Hardware Font 79
Specifying the Full Font Name 80
Specifying Alternative Hardware Fonts 80
Specifying Special Characters 81
Using SAS/GRAPH Software Fonts 82
Rendering Fonts 82
Font Lists 82
Overview
The SAS/GRAPH software has a variety of type styles that you can use to display
text and special characters in your procedure output. These type styles are stored in
fonts that you can specify when you want to select type for the text on your graphs or
choose plot symbols.
This chapter explains how to specify a font, how to change the default hardware font,
how to produce special characters, and how to select a software font.
After the FONTREG procedure runs, the SASEMF device driver and graphs in the
ODS PDF destination can use FreeType fonts without any modification. However, you
will need to modify the GIF, JPEG, PNG, and TIFFP device drivers before these can
access FreeType fonts. For details about using FreeType fonts, refer to The FONTREG
Procedure.
Note: In some operating environments, you can access the System or TrueType fonts
that are available to the host print driver that is currently set for your printer. For
more information, see the SAS documentation for your operating environment. 4
title to all the text in your output. When the SAS/GRAPH software encounters an
explicit font specification in a SAS statement, it uses the font that you specify rather
than a font that is specified in a GOPTIONS statement or the device’s hardware font.
With SAS/GRAPH you can select existing hardware or software fonts or create your
own font. Hardware fonts are fonts that exist on hardcopy output devices (such as
printers or plotters) or on a computer. PC TrueType and UNIX system fonts are
examples of hardware fonts that exist on computers. Software fonts are the fonts
delivered with SAS. The software fonts are the entries in the SASHELP.FONTS
catalogue. If you do not make a font assignment, in most cases the SAS/GRAPH
software uses the default hardware font for your device.
Note: Java and ActiveX devices do not support software fonts. 4
Font Specifications
A font specification is an argument that takes a font name as its value. Font
specifications typically take the following form:
FONT=font
F=font
where font is a valid SAS name. The specified font can be
3 a software font that is either
3 a catalog entry that is supplied by SAS Institute (for example, CENTB),
or that is user-generated (for example, MYFONT generated by the
GFONT procedure)
3 a system font that is available in your operating environment.
Note: Font names greater than eight characters in length must be
enclosed in quotation marks. 4
To see a list of available software fonts, issue the FONTLIST command
from the SAS command line. See Base SAS Software Help for more
information on the FONTLIST command. The resulting window enables you
to copy a font name into the copy buffer so that you can paste the name into
your SAS program. The window’s Family box lists the software fonts that are
supplied by SAS Institute. Choose the System button to see a list of the
system fonts that are available in your operating environment. Choose the
Help button for help on using the window. See “Font Lists” on page 82 for
more information on the valid font names for Institute-supplied software
fonts.
3 a hardware font that is either in the form of
3 HWxxxnnn
3 hardware-font-name.
See “Specifying Alternative Hardware Fonts” on page 80 for details.
For example, the following statement specifies the Century Bold font in a title:
title font=centb ’This is a Title’;
However, there are other arguments that also take font as a value. For example, the
FTEXT= option in the following GOPTIONS statement specifies the Century Bold font
for all text that does not have a more explicit font specification:
goptions ftext=centb;
SAS/GRAPH Fonts Font Locations 77
Note: In this chapter, the argument FONT= is used to represent any argument that
takes font as its value. 4
Default Fonts
When a font is needed, theSAS/GRAPH software looks first for a font specification in
the statement or procedure that produces the output, and then it looks in the
GOPTIONS statement. If no font specification is found, the SAS/GRAPH software uses
one of the following:
3 for TITLE1 statements, the default font is SWISS.
3 for all other text, the default font is NONE. The NONE font specifies the default
hardware font for the output device.
In some cases, the device’s hardware font cannot be used and the SIMULATE font is
used instead. The SIMULATE font is a software font that simulates the device’s
hardware characters by allowing the same amount of space for the text that the
hardware characters use. The SIMULATE font is used whenever the default hardware
font is unavailable, including the following situations:
3 FONT=NONE or FONT=HWxxxnnn or no font is specified, and one of the
following conditions or sets of conditions is also met:
3 GOPTIONS NOCHARACTERS is specified.
3 The device driver does not support hardware text.
3 You request a hardware font for a different device.
3 You specify an angle or rotation for the characters that the device does not
support.
3 The device does not have scalable hardware characters (that is, hardware
characters can be generated only in the proportions specified with the font),
and one of the following conditions is also met:
3 The values of the HPOS= and VPOS= graphics options do not match the
values displayed in the LCOLS or PCOLS field or the LROWS or
PROWS field in the Detail window of the device entry.
3 The HSIZE= or VSIZE= graphics option is set to values that are not the
default.
3 You replay a graph in a template that is not the same size as the full
size of the graphics output area, or you use a device driver other than
the one you used to create the graph.
3 The target device and the display device have different values for the
HPOS= and VPOS= graphics options.
3 You use any height specification, including the HEIGHT=, HTEXT=,
HTITLE=, and HBY= graphics options, that is not equal to 1.
You should never delete the SIMULATE font from the fonts catalog.
Note: You can change the font that is used as the SIMULATE font with the
SIMFONT= graphics option. If you use the SIMFONT= option, it is better to specify a
uniform font. Do not specify a hardware font as a substitute for SIMULATE. See
“SIMFONT” on page 351 for more information on the SIMFONT= option. 4
Font Locations
SAS/GRAPH software fonts are stored in catalogs. The SAS/GRAPH software looks
only into catalogs with certain librefs and names to find fonts. By default, SAS/GRAPH
78 Using Hardware Fonts Chapter 5
If your device has only one hardware font (this is often the case), the Chartype field
has a value of 0.
In addition, if the font selected with CHARTYPE= is not scalable and if the values of
HPOS= and VPOS= do not match the values of the Rows and Cols fields in the
Chartype window, then the SIMULATE font is substituted.
3 Note the number of the font that you want to use as the default font and go to the
Parameters window.
4 Enter the number of the font in the Chartype field.
5 Close the window and exit the procedure.
Note: If you change the number in the Chartype field in the Parameters window of
the device entry, the change is permanent and remains in effect from one SAS session
to another until you change the entry again. 4
(See Chapter 31, “The GDEVICE Procedure,” on page 915 for information on viewing
device entries and changing device parameters.)
The SAS System allows up to 255 characters for the font name. The font name may
contain spaces. If the font name is longer than 40 characters, PROC GDEVICE in
fullscreen mode only displays the first 37 characters, followed by an ellipsis (...). To see
the complete font name when the name is longer than 40 characters, use PROC
GDEVICE with the NOFS (no fullscreen) option as follows:
proc gdevice c=sashelp.devices nofs;
list driver-name;
run;
quit;
When a font is quoted, the SAS System will first look at the Chartype window of the
device driver entry to see if it is a valid hardware font. If the font is not found in the
Chartype window, the SAS System will then check to see if the quoted font is a valid
SAS/GRAPH software font. If the font is not recognized as either a valid hardware font
or a valid SAS/GRAPH software font, the SIMPLEX font will be used.
xxx are the last two or three characters of the module name in
the Module field in the Detail window of your device entry.
If the module name has eight characters (SASGDPSL, for
example), use the last three characters (PSL). If the
module name has only seven characters (SASGDVT, for
example), use the last two characters (VT).
nnn is the Chartype number of the hardware font that you
want to use as listed in the Chartype window in the
device entry. This value should be a three-digit decimal
number, with leading zeros if necessary.
3 In the font specification, explicitly assign a hardware font using the following form:
hardware-font-name
identifies the name of the hardware font that is listed in the Chartype
window of the device entry. Hardware-font-name must be enclosed in
quotation marks and the maximum length is 256 characters. The specified
font name will be converted internally to the HWxxxnnn name. Note that in
Annotate, the specified font name must be enclosed in both double quotes and
single quotes (see Chapter 25, “Annotate Dictionary,” on page 613 for details).
3 Assign one of the fonts listed in the Chartype window of your device entry as the
default hardware font with the CHARTYPE= graphics option. You can also change
the default hardware font by modifying the value of the Chartype field in the
Parameters window of your device entry. Then you can use FONT=NONE in your
SAS/GRAPH procedure or statement to specify the new default hardware font.
When you specify FONT=HWxxxnnn or hardware-font-name, the size of the
character cells is determined by the values in the Rows and Cols fields in the Chartype
window of the device entry, and the values of the HPOS= and VPOS= options are
ignored for the font. Consequently, the font retains its original proportions. In addition,
with this method the font catalog is checked for proportional spacing information. This
information is used by the software to determine how much space to reserve for
proportional text. See Chapter 8, “Graphics Options and Device Parameters
Dictionary,” on page 261 for additional information.
statement uses hexadecimal 18 to produce £ in the Zapf type style. (This example
assumes a U.S. key map).
title font=zapf ’18’x;
Note: The character code or hexadecimal value associated with any character in any
font is dependent on the key map that is currently being used. 4
In addition, you can use a key map to map selected characters to your keyboard. For
example, if you want to be able to type e directly, you could create a key map that maps
e to the key that usually generates the asterisk (*) and a device map that maps e to
your output device. Then, when you press the * key, although you see * on your display,
e is produced on your graphics device. See Chapter 34, “The GKEYMAP Procedure,” on
page 983 for details.
Rendering Fonts
The SAS/GRAPH software includes methods of storing rendered versions of
Bitstream fonts, along with three graphics options to control how the fonts are rendered.
When your graphics output uses one of the Bitstream fonts that are provided in the
SAS/GRAPH software, SAS/GRAPH must process information contained in
corresponding FONT catalog entries to determine how to draw characters of the
specified size and typeface. The process of calculating the character shapes and sizes is
known as rendering the font. Bitstream fonts that are available in the SAS/GRAPH
software include the Century, Swiss, and Zapf families.
The SAS/GRAPH software can store rendered versions of the Bitstream fonts in
memory or in special SAS files. Using these rendered versions of the fonts can provide
a speed improvement when characters of the same size and style are used again during
the SAS session. The SAS/GRAPH software can read the rendered version of the
characters from memory or from the rendered font file rather than having to perform
the rendering calculations again each time the characters are used. If you store the
rendered fonts in files in a permanent SAS data set, the SAS/GRAPH software can use
the rendered font files again in subsequent SAS sessions.
Note: Because the rendered font files use a special utility member type, they do not
appear in the list of library members that is displayed when you issue a DIRECTORY
command for the SAS data library in which the font files are stored. 4
You control whether and how rendered versions of fonts are stored using the
FONTRES=, RENDER=, and RENDERLIB= graphics options. See Chapter 8,
“Graphics Options and Device Parameters Dictionary,” on page 261 for details.
Font Lists
The fonts available with theSAS/GRAPH software are listed in the following tables.
All of the software fonts are stored in the catalog SASHELP.FONTS. For many fonts,
the last letter or letters of the font name indicates weight or spacing of the font:
B bold (thicker)
E empty (outline) versions of their counterparts
SAS/GRAPH Fonts Font Lists 83
I italic (slanted)
L light (thin)
U uniformly spaced versions of their counterparts; most of the
SAS/GRAPH fonts that do not end in U are proportionately spaced;
however, the Kanji fonts are always uniform.
X expanded (wider characters and extra space between characters).
CAUTION:
Empty and uniform versions of fonts cannot be used if you have deleted their filled or
proportionally spaced counterparts. 4
If the label of a font in SASHELP.FONTS is "Depends on," it is possible to delete it.
However, empty and uniform versions of fonts are generated from their regular, bold, or
italic counterparts. Therefore, if you delete any of these fonts, you cannot use the
uniform or empty version of that font. For example, you must have the CENTB
(Century Bold) font in order to use the CENTBE (Century Bold Empty) font.
84 Font Lists Chapter 5
Uniform Font
Type Style Font Name Name
Arabic ARABIC
David DAVID
Davidb DAVIDB
Hebrew NHEBREW*
Hebrewb HEBREWB
Hebrew Empty HEBREWE
Hiragana NHIRA*
Kanji KANJI
86 Font Lists Chapter 5
Uniform Font
Type Style Font Name Name
Kanji KANSJIS
Kanji Subset
Kanji 1 KAN1
Kanji 2 KAN2
Kanji 3 KAN3
Kanji 4 KAN4
Kanji 5 KAN5
Kanji 6 KAN6
Kanji 7 KAN7
Kanji 8 KAN8
Katakana KATA
Katakana NKATA*
Marker MARKERE
Empty *
Note: Figure 5.5 on page 87 shows the MARKER font. The MARKERE font
produces the same symbols but in empty (outline) form. 4
CHAPTER
6
SAS/GRAPH Colors and Images
SAS/GRAPH software uses these values if you do not explicitly select colors in other
statements. Refer to Chapter 8, “Graphics Options and Device Parameters Dictionary,”
on page 261 for complete information about each of these graphics options.
If you have not explicitly specified a color in a SAS statement or set a default color
for a graphic element in the graphics output, SAS/GRAPH software searches for a
colors list.
The color selected from the colors list varies depending on the procedure using the
color and the graphics element that is being drawn. Usually, the first color in the list is
used; however, certain procedures may select other colors. For example, if the CAXIS=
option is not specified in the GCONTOUR procedure’s PLOT statement, the procedure
selects the second color from the colors list to draw the axes. See the documentation for
an individual procedure for more information.
Each value you specify in a color list must be either a valid color name or a valid color
code. Color names must not exceed 64 characters and color codes must not exceed eight
characters. For an explanation of SAS color names and codes, see “Color-Naming
Schemes” on page 95.
SAS provides, in the SAS Registry, a set of ordinary-language color names that you
can use for colors that are common to most Web browsers. For a list of these names,
showing both the ordinary-language name and its associated RGB value, you can run
the following code and view the output in the Log window:
proc registry list
startat=’COLORNAMES’;
run;
94 Defining and Using a Colors List Chapter 6
You can also modify entries in this list and add your own names and their associated
RGB values. For more information on viewing and modifying the list of color names,
see Using the SAS Registry to Control Color in SAS Language Reference: Concepts.
Note: The COLORS= graphics option only provides a default lookup table. Any time
you explicitly select any other colors in your SAS/GRAPH program, those colors are
used to draw the graphics elements for which you have specified them. 4
For a pen plotter, SAS/GRAPH software uses the order of the colors in the COLORS=
graphics option to define the order of pens for a multiple pen plotter, or to make a pen
plotter prompt you to change the pen when a graph uses more colors than the plotter
has loaded.
The colors from any elements that have a color explicitly specified in your SAS
program are combined to form a color list. This color list is used to assign colors to the
elements that do not have a color explicitly specified. If no colors are explicitly specified,
black will be used. This setting is useful if you want to generate graphics output with
the maximum of 256 colors, and you do not want to use any of the default colors from
the current device driver.
professionally styled graphic output. The ODS styles are available for both bar graphs
and pie charts. For more information on ODS Styles see “Using ODS Styles” on page
488 and SAS Output Delivery System: User’s Guide.
Color-Naming Schemes
The valid color-naming schemes are
3 RGB (red green blue)
3 CMYK (cyan magenta yellow black)
3 HLS (hue lightness saturation)
3 HSV (hue saturation brightness), also called HSB
3 gray scale
3 SAS color names (from the SAS Registry)
3 the SAS Color Naming System (CNS).
For the CMYK color scheme, color specifications must be enclosed in quotation
marks. For the SAS color names and CNS names, quotation marks are required if the
color name contains spaces. In all other instances, quotation marks are optional.
You can freely intermix colors using different color-naming schemes in your
programs. However, depending on your device capabilities, the color that is displayed
may not be the color that you expect. See “Colors and Device Capabilities” on page 103
for information on how to tell if your device supports user-defined colors.
Note: When printed, RGB color values are automatically converted to the CMYK
color values so that the colors display appropriately in the output. 4
Note: You can specify a CMY value by making the kk, the color’s black component,
zero (00). 4
A predefined list of the SAS color names and their accompanying RGB values are
contained in the SAS Registry Editor. The SAS Registry Editor also allows you to add
your own SAS color names. With these colors, you can specify the name itself or the
RGB value associated with that color name.
With CNS, you develop your color value by selecting and combining valid lightness,
saturation, and hue terms. The CNS colors are based on the HLS color model and will
display fairly uniform transitions between color values.
Note: Invalid color values will be replaced by the next valid color value on the
foreground color list. Messages are written to the SAS log detailing the colors
substituted for invalid color values. 4
Table 6.1
White
CNS values should be written in the following order: lightness saturation hue. The
color names may written without space separators between words, with an underscore
to separate words, or with a space to separate words. The following list contains
examples of valid color names:
verylightmoderatepurplishblue
very_light_moderate_purplish_blue
“very light moderate purplish blue”
Color names containing spaces must be enclosed in quotation marks.
Note: The %CNS macro only accepts CNS color names where a space is used to
separate the words in the color name. See Table 6.5 on page 101 for more information 4
If a CNS color name is also a color name in the SAS Registry, the SAS Registry color
value will be used. Some CNS color names and color names in the SAS Registry have
100 Color-Naming Schemes Chapter 6
different color values. To use a CNS color value when the color name is also in the SAS
Registry, place quotes around the color name.
The lightness values black and white should not be used with saturation or hue
values. If not specified, medium is the default lightness value and vivid is the default
saturation value. Gray is the only saturation value that can be used without a hue.
Unless the CNS value is black, white, or some form of gray, at least one hue value must
be used.
One or two hue values can be used in the CNS color name. When using two hue
values, the hues must be adjacent to form a color. The hues are located in the following
circular order: blue, purple, red, orange/brown, yellow, green, and then returning to
blue. When two hues are used, the resulting color is a combination of both colors. Use
the suffix “ish” to reduce the effect of a hue when two hues are combined. For example,
reddish purple is less red than red purple. If you are using a color with an “ish” suffix,
this color must precede the color without the “ish” suffix.
Use... To...
%HELPCLR; List the color utility macro names.
When the color utility macros are invoked, the calculated color value can be directed
to the SAS log or perform in-place substitutions in the code. The following tables list
and describe the color utility macros and provide an usage example of each macro:
Replace cyan, magenta, yellow, black with numeric values Entering the following code into your
to create a CMYK color value. The numeric values that are Program Editor:
used in place of cyan, magenta, yellow, black indicate the %COLORMAC;
percentage (0 to 100) of each of these colors to be included data _null_;
in the CMYK color value. See “CMYK Color Codes” on put %CMYK(0,46,16,31);
run;
page 96 for more information on the color value produced
by using this macro. Returns the CMYK value 0075294F
which is purple.
Note: In the PUT statement, %CMYK(cyan, magenta, yellow, black), should not be
placed in quotations. 4
Replace hue, lightness, saturation with numeric values to Entering the following code into your
create a HLS color value. Hue should be replaced with any Program Editor:
value from 0 to 360. Lightness and saturation indicate a %COLORMAC;
percentage (0 to 100) to be included in the HLS color value. data _null_;
See “HLS Color Codes” on page 97 for more information. put ‘‘%HLS(0,50,100)’’;
run;
Returns the HLS value H00080FF
which is blue.
102 Color-Naming Schemes Chapter 6
Replace hue, saturation, value with numeric values to Entering the following code into your
create a HLS value from HSV components. Hue should be Program Editor:
replaced with any value from 0 to 360. Saturation and %COLORMAC;
value (brightness) indicate a percentage (0 to 100) to be data _null_;
included in the HLS color value. See “HSV (or HSB) Color put ‘‘%HSV(0,100,75)’’;
run;
Codes” on page 98 and “HLS Color Codes” on page 97 for
more information. Returns the HSV value V000FFBF
which is dark red.
Replace hls with a HLS color value to create a RGB color Entering the following code into your
value. See “HLS Color Codes” on page 97 and “RGB Color Program Editor:
Codes” on page 95 for more information. %COLORMAC;
data _null_;
put ‘‘%HLS2RGB(H04B8040)’’;
run;
Returns the RGB value CX9F5F8F
which is grayish reddish purple.
SAS/GRAPH Colors and Images Colors and Device Capabilities 103
Note: Round-trip conversions using HLS2RGB and then RGB2HLS macros or vice
versa, may produce ultimate output values that differ from the initial input values. For
example, converting CXABCDEF (a light blue) using %RGB2HLS (CXABCDEF)
produces H14ACDAD. Converting this value back to RGB using %HLS2RGB
(H14ACDAD) returns CXAACCEE. While not identical, the three colors are very
similar on the display and when printed. 4
For additional information on color-naming schemes, see Effective Color Displays:
Theory and Practice by David Travis and Computer Graphics: Principles and Practice
by Foley, van Dam, Feiner, and Hughes.
list. Some devices try to match the user-defined color with the closest color in the
device’s color palette. Others merely remap the color to the next available color in the
device’s color palette. To avoid having colors remapped, use the colors in your device’s
default colors list.
Pen Plotters
The colors you can use with a pen plotter are determined by your set of pens. You
specify the color names in the GOPTIONS statement’s COLORS= option, then place
pens with those color names in the plotter when the following message appears (the
message does not appear if you specify the NOPROMPT graphics option):
Please mount the following pens: . . .
By default, SAS/GRAPH software tries to keep a standard set of pens in the plotter’s
carousel. If colors in the standard set of pens are named in the COLORS= graphics
option, a mount request is issued for the entire standard set, even if all of them are not
used in the output. This minimizes the number of times pens must be reshuffled as a
graph is being drawn. If GOPTIONS COLORS=(NONE) is used, you are only prompted
to mount pens for the colors that are actually used in the output.
Note: You can specify any valid SAS name for a color when using a pen plotter. It
does not have to be a predefined or user-defined color name. For example, you can
specify COLOR=PEN3, and you will be prompted to mount PEN3 or SAS/GRAPH
software will assume a pen of that color is in the appropriate slot. This feature is often
helpful if you are using transparency pens or other special pens. 4
Limitations
Using colors in SAS/GRAPH software is limited by the number of colors that you can
use in one graph and by the capabilities of your device. The following sections discuss
these limitations.
Maximum Number of Colors Displayable in SAS/GRAPH Software
You can use a maximum of 256 unique colors on each graph, including the
background color (specified with the CBACK= graphics option or the CBACK device
parameter). If you use more than 256 unique names in a program, SAS/GRAPH
software issues a warning and remaps the 257th and any subsequent colors to
existing color names, beginning with the first color name in the existing color list.
Note: If you specify a color using two different color-naming schemes for the
same graph (for example, WHITE and RGB white, CXFFFFFF), SAS/GRAPH
software counts them as two color specifications out of the 256 colors that you are
allowed to use on one graph. 4
Maximum Number of Colors Displayable on a Device
The number of colors that you can display is limited by the type of graphics output
device that you have. If you generate a graph with more colors than the device can
SAS/GRAPH Colors and Images Colors and Device Capabilities 105
display, the colors that cannot be displayed are mapped to an existing color. You
may also receive a note in the SAS log telling you when a color is mapped to
another color in the colors list and what color will be used instead.
Although your device may support 256 colors, it may not let you use all of them
at once. The MAXCOLORS device parameter tells SAS/GRAPH software the
maximum number of colors that can be displayed at one time. MAXCOLORS is
the number of foreground colors plus the background color and has a range of two
to 256. If you use more than the number of colors set by the MAXCOLORS device
parameter, the excess colors are remapped.
Note: The MAXCOLORS device parameter defaults to the number of
displayable colors on the basic model of each graphics device supported. If your
graphics device can display more colors than the base model, use the
PENMOUNTS= graphics option to specify the number of colors that can be
displayed. Optionally, you can use PROC GDEVICE to modify the value of the
MAXCOLORS device parameter. 4
For pen plotters, you use the PENMOUNTS= graphics option to indicate the
number of pen holders on the plotter. PENMOUNTS is the number of foreground
colors and has a range of one to 255. PENMOUNTS does not include the
background color. Using this graphics option does not limit the number of colors
that you can specify for a graph that is produced on a pen plotter. If you use more
colors than the plotter has pen holders, you will be prompted to change pens
unless you have also specified the NOPROMPT graphics option.
Replaying Graphs on a Device That Displays Fewer Colors
You can use the GREPLAY Procedure to display graphs previously generated.
Sometimes you may need to replay the graphs on a device that cannot display as
many colors as the device on which the graph was originally developed. Use
“CMAP” on page 270 to control some of the remapping.
When you replay graphs on devices that display fewer colors than are in the
graph, two situations may cause problems:
3 Colors are specified that the device does not support.
3 More colors are specified than the device can display at one time.
If you specify colors on a device that does not support those colors, the colors are
remapped to those available for that device. You may also receive a note in the
SAS log telling you when a color is mapped to another color in the colors list and
what the new color is.
The number of colors that your device can display affects the actual color
displayed. If your graphics output device can generate a maximum of 64 distinct
colors and your graph contains 256 colors, the 65th through the 256th color
specifications are remapped to the device’s available colors and may not display as
the color you specify.
You can use the TARGETDEVICE= graphics option to preview the way a graph
is going to look on a different device. You set this graphics option to the device
entry name of the device driver that will be used later. The graph is displayed as
close as possible to the way it will display when the other device is used.
Note: When you use the TARGETDEVICE= graphics option, SAS/GRAPH
software uses the colors list of the target device as the default colors list; any color
that you explicitly use is displayed when you preview the graph, although the
target device may cause the color to be mapped. Refer to “TARGETDEVICE” on
page 355 for complete information about the TARGETDEVICE= graphics option. 4
Trueness of Color Displayed on a Device
The size of the color palette in your device determines the trueness of the color
that is actually produced. For example, a device with a palette of 64 colors can
106 Specifying Images in SAS/GRAPH Programs Chapter 6
only produce colors that contain a combination of four shades of red (including no
red), four shades of green (including no green), and four shades of blue (including
no blue). Consequently, ranges of color will be remapped to available colors. For
example, color specifications CX008080, CX258080, and CX3F8080 will all look the
same (no red). CX408080 through CX7F8080 will look redder; CX808080 through
CXBF0000, redder still; and CXC08080 through CXFF8080, the reddest. Larger
palettes have more color resolution but may not have more simultaneous colors.
CAT (SAS Catalog IMAGE entry) supports color-mapped images as well as true
color images. The images can be optionally
compressed.
DIB (Microsoft Windows Device Independent see the description of BMP.
Bitmap)
EMF (Microsoft NT Enhanced Metafile) supported under Windows 95, Windows 98,
Windows 2000, and Windows NT.
JPEG (Joint Photographic Experts Group) supports compression of images with the use of
JPEG File Interchange Format (JFIF) software.
JFIF software is developed by the Independent
Joint Photographic Experts Group.
PBM (Portable Bitmap Utilities) supports gray, color, RGB, and bitmap files. The
Portable Bitmap Utilities is a set of free utility
programs that were primarily developed by Jeff
Poskanzer.
SAS/GRAPH Colors and Images Reading and Writing Image File Types 107
PS (PostScript Image File Format) the Image classes use only PostScript image
operators. A level II PS printer is required for
color images. PostScript was developed by
Adobe Systems, Inc.
TGA (Targa) supports both true color images and
color-mapped images; however, the current
release of the Image classes supports only true
color TGA files. Targa is owned by Truevision,
Inc.
TIFF (Tagged Image File Format) internally supports a number of compression
types and image types, including bitmap,
color-map, gray-scale, and true color. TIFF was
developed by Aldus Corporation and Microsoft
Corporation and is used by a wide variety of
applications.
BMP FORMAT=BMP
COMPRESS=NONE is the default. Sets compression to
COMPRESS=RLE run-length encoded.
CAT FORMAT=CAT
PBM FORMAT=PBM
PCD FORMAT=PCD specifies photo CD format. FORMAT=PCD
RES= specifies the image resolution to be
read. Photo CD images have multiple
resolution images in each image. Values
are:
BASE/64 64x96
BASE/16 128x192
BASE/4 256x384
4BASE 1024x1536
16BASE 2048x3072.
TGA FORMAT=TGA
TIFF FORMAT=TIFF
XBM FORMAT=XBM
110 Reading and Writing Image File Types Chapter 6
XWD FORMAT=XWD
BMP FORMAT=BMP
CAT FORMAT=CAT
PBM FORMAT=PBM
COMPRESS=NONE creates a text PBM file.
PCL FORMAT=PCL
DPI=num specifies the number of dots per inch to use
to calculate the visual size of the image on
the PostScript page in the output file. The
default is 300. For example, a 600-pixel by
600-pixel image appears as a 2-inch by
2-inch image on the PostScript page if you
use the default setting.
PNG FORMAT=PNG
PS FORMAT=PS
TIFF FORMAT=TIFF
COMPRESS=NONE is the default
SAS/GRAPH Colors and Images Placing a Background Image 113
“Image File Types Supported by SAS/GRAPH” on page 106 shows the image file
formats that you can use. “Disabling and Enabling Image Output” on page 120 shows
how to suppress the image output without removing the imaging code from your
114 Placing a Background Image Chapter 6
SAS/GRAPH program; for example, you might want to suppress the image when
printing the graph.
By default, the image is tiled on the background, which means that the image is
copied as many times as needed to fill the background area. You can specify
IMAGESTYLE=FIT on the GOPTIONS statement to stretch the image so that a single
image fits within the entire background area:
goptions iback=’external-image-file’
imagestyle=fit;
After fitting the image, you can tile subsequent images by resetting the GOPTIONS
statement or by specifying IMAGESTYLE=TILE. The following graphs illustrate the
use of tiled versus stretched images.
The following example displays an image behind a pie chart. Because the
IMAGESTYLE option is not used, the image is tiled in the background area.
goptions reset=all ctitle=cx90d0d9 ftitle=swissb
ctext=white htext=0.85 htitle=2.5 ftext=swissb
colors=(cx00cccc cxcd0369 cx5b768d
cx594f4a cx008080 cxff8f71)
iback=’external-image-file’;
title ’Projected Automobile Sales’;
data sales;
length month $ 9;
input month amount;
datalines;
January 200
February 145
March 220
April 180
May 155
June 250
;
proc gchart;
pie month / freq=amount value=inside
noheading coutline=black;
run;
quit;
The preceding program generates the following graph, which illustrates the tiling of
an image to fill an area.
SAS/GRAPH Colors and Images Placing a Backplane Image on Graphs with Frames 115
“Image File Types Supported by SAS/GRAPH” on page 106 shows the image file
formats that you can use. “Disabling and Enabling Image Output” on page 120 shows
how to suppress the image output without removing the imaging code from your
116 Placing Images on the Bars of Two-Dimensional Bar Charts Chapter 6
SAS/GRAPH program; for example, you might want to suppress the image when
printing the graph.
By default, the image is tiled on the backplane, which means that the image is copied
as many times as needed to fill the backplane.
To stretch a single instance of the image to fill the backplane, specify
IMAGESTYLE=FIT as follows:
iframe=fileref | ’external-image-file’
imagestyle=fit;
To switch from a single fitted image back to a series of tiled images, you can specify
IMAGESTYLE=TILE.
The following example displays an image on the backplane of a horizontal bar chart.
Because the IMAGESTYLE= option is not used, the image is tiled by default.
goptions reset=all ctitle=cx000080 ftitle=swissb
ctext=black htext=0.85 htitle=2.5 ftext=swissb
cback=cxf7e1c2;
title ’Projected Automobile Sales’;
data sales;
length month $ 9;
input month amount;
datalines;
January 200
February 145
March 220
April 180
May 155
June 250
;
pattern1 value=solid color=cxcd0369;
axis1 width=1.5 major=(width=1.5)
label=( h=1 ’Number of Cars’) noplane;
axis2 width=1.5 major=(width=1.5)
label=( h=1 ’Month’) noplane;
proc gchart;
hbar3d month / freq=amount
nostats
axis=axis1
maxis=axis2
iframe=’external-image-file’
coutline=black;
run;
quit;
“Image File Types Supported by SAS/GRAPH” on page 106 shows the image file
formats that you can use. “Disabling and Enabling Image Output” on page 120 shows
how to suppress the image output without removing the imaging code from your
SAS/GRAPH program; for example, you might want to suppress the image when
printing the graph.
By default, the image is tiled on the bar, which means that the image is copied as
many times as needed to fill the bar area. You can specify IMAGESTYLE=FIT on the
PATTERN statement to stretch a single instance of the image to fit the dimensions of
the bar, as follows:
pattern image=’external-image-file’
imagestyle=fit;
After fitting the image, you can tile subsequent images by resetting the PATTERN
statement or by specifying IMAGESTYLE=TILE.
Note: Images are only supported on the bars that are generated by the HBAR and
VBAR statements. If an image is specified on a PATTERN statement that is used with
another type of chart, then the PATTERN statement is ignored and default pattern
rotation is affected. For example, if you submit a PIE statement when an image has
been specified on PATTERN, the default fill pattern is used for the pie slices; however,
rather than rotating that pattern through the colors list, each slice in the pie displays
the fill pattern in the same color. 4
The following example generates a bar chart that shows the sales for different
automobile manufacturers. The bars that represent the sales figures for each
manufacturer display a model vehicle for that manufacturer. Because
IMAGESTYLE=FIT is not specified, each image is tiled on the bar that displays it.
goptions reset=all ctitle=cx000080 ftitle=swissb
ctext=black htext=0.85 htitle=2.5
ftext=swissb cback=cxf7e1c2;
title ’Projected Automobile Sales’;
data sales;
length Month $ 9 Manufacturer $ 10;
input Month amount Manufacturer;
datalines;
January 100 Nissan
February 80 Nissan
March 210 Nissan
April 201 Nissan
January 400 Dodge
February 90 Dodge
March 220 Dodge
April 202 Dodge
January 300 Cheverolet
February 70 Cheverolet
March 230 Cheverolet
April 203 Cheverolet
January 200 Ford
February 100 Ford
March 240 Ford
April 204 Ford
;
run;
pattern1 image=’external-image-file’; /* corvette image */
pattern2 image=’external-image-file’; /* viper image */
118 Using Annotate to Display an Image Chapter 6
proc gchart;
vbar month / freq=amount
coutline=black
subgroup=Manufacturer
axis=axis1
cframe=olive;
run;
quit;
The code above displays the image in the screen coordinates (20, 20) to (40, 40). The
last parameter indicates how to display the image. The following keywords are
available:
fit fits the image within the specified area. This stretches the image, if
necessary.
120 Disabling and Enabling Image Output Chapter 6
tile tiles the image within the specified area. This copies the image as
many times as needed to fit the area.
“Image File Types Supported by SAS/GRAPH” on page 106 shows the image file
formats that you can use. “Disabling and Enabling Image Output” on page 120 shows
how to suppress the image output without removing the imaging code from your
SAS/GRAPH program; for example, you might want to suppress the image when
printing the graph.
Here is a complete example:
goptions reset=all;
title ’DGSI with image’;
footnote ’ dsgi with image option’;
data image;
rc=ginit();
rc=graph(’clear’);
rc=gdraw(’image’,’external-image-file’,
5, 5, 90, 90,’fit’);
rc=graph(’update’);
rc=gterm();
run;
quit;
NOIMAGEPRINT can be useful for printing output without images. To enable image
output, reset the GOPTIONS statement or specify the IMAGEPRINT graphics option.
121
CHAPTER
7
SAS/GRAPH Statements
Overview 123
AXIS Statement 124
Description 124
Syntax 125
Options 126
Text Description Suboptions 135
Using Text Description Suboptions 139
Tick Mark Description Suboptions 139
Using the AXIS Statement 140
Assigning AXIS Definitions 140
BY Statement 141
Description 141
Syntax 141
Required Arguments 142
Options 142
Preparing Data for BY-Group Processing 142
Controlling BY Lines 143
Suppressing the BY line 143
Suppressing the name of the BY variable 143
Controlling the appearance of the BY line 143
Naming the Catalog Entries 143
Using the BY Statement 143
With the GCHART Procedure 144
With the GMAP Procedure 144
With the GPLOT Procedure 144
With the RUN Groups 144
With the Annotate Facility 145
With TITLE, FOOTNOTE, and NOTE Statements 145
With PATTERN and SYMBOL Definitions 145
FOOTNOTE Statement 146
GOPTIONS Statement 146
Description 146
Syntax 146
Options 150
Using the GOPTIONS Statement 150
Graphics Option Processing 150
LEGEND Statement 151
Description 151
Syntax 151
Options 152
Text Description Suboptions 158
122 Contents Chapter 7
Overview
SAS/GRAPH programs can use some of the SAS language statements that you
typically use with the base SAS procedures or with the DATA step, such as LABEL,
WHERE, and FORMAT. These statements are described in the SAS Language
Reference: Dictionary.
In addition, SAS/GRAPH has its own set of statements that affect only graphics
output generated by the SAS/GRAPH procedures and the graphics facilities Annotate
and DSGI. Most of these statements are global statements. That is, they can be
specified anywhere in your program and remain in effect until explicitly changed or
canceled. These are the SAS/PH global statements:
AXIS
modifies the appearance, position, and range of values of axes in charts and plots.
FOOTNOTE
adds footnotes to graphics output. This statement is like the TITLE statement and
is described in that section.
GOPTIONS
submits graphics options that control the appearance of graphics elements by
specifying characteristics such as default colors, fill patterns, fonts, or text height.
Graphics options can also temporarily change device settings.
124 AXIS Statement Chapter 7
LEGEND
modifies the appearance and position of legends generated by procedures that
produce charts, plots, and maps.
NOTE
adds text to the graphics output. This statement is an exception because it is not
global but local, meaning that it must be submitted within a procedure.
Otherwise, NOTE is like the TITLE statement and is described in that section.
PATTERN
controls the color and fill of patterns assigned to areas in charts, maps, and plots.
SYMBOL
specifies the shape and color of plot symbols as well the interpolation method for
plot data. It also controls the appearance of lines in contour plots.
TITLE
add titles to graphics output. The section describing the TITLE statement includes
the FOOTNOTE and NOTE statements.
These statements are described in this chapter, which also includes two Base
language statements that have a special effect when used with SAS/GRAPH procedures:
BY
processes data according to the values of a classification (BY) variable and
produces a separate graph for each BY-group value.
ODS HTML
generates one or more files written in Hyper Text Markup Language (HTML). If
you use it with SAS/GRAPH procedures, you can specify one of the device drivers
GIF, ACTIVEX, or JAVA (ACTIVEX and JAVA are only available with GCHART,
GCONTOUR, GMAP, GPLOT, and G3D). With the GIF device driver, the graphics
output is stored in GIF files. With the ACTIVEX device driver, graphics output is
stored as XML input to ActiveX controls. With the JAVA device driver, graphics
output is stored as XML input to Java applets. The HTML files that are generated
reference the graphics output. When viewed with a Web browser, the HTML files
can display graphics and non-graphics output together on the same Web page.
AXIS Statement
The AXIS statement controls the location, values, and appearance of the axes in plots
and charts.
Used by:
GBARLINE, GCHART, GCONTOUR, GPLOT, and GRADAR procedures
Global
Description
AXIS statements specify the characteristics of an axis, including:
3 the way the axis is scaled
3 how the data values are ordered
3 the location and appearance of the axis line and the tick marks
3 the text and appearance of the axis label and major tick mark values.
AXIS definitions are used only when they are explicitly assigned by an option in a
procedure that produces graphs with axes.
SAS/GRAPH Statements AXIS Statement 125
Figure 7.1 on page 125 illustrates the terms associated with the various parts of axes.
Syntax
AXIS<1...99>< options>;
option(s) can be one or more options from any or all of the following categories:
3 axis scale options:
INTERVAL=EVEN | UNEVEN | PARTIAL
LOGBASE=base | E | PI
LOGSTYLE=EXPAND | POWER
ORDER=(value-list)
3 appearance options:
COLOR=axis-color
LENGTH=axis-length <units >
NOBRACKETS
126 AXIS Statement Chapter 7
NOPLANE
OFFSET=(<n1 ><,n2 >)<units > | (<n1<units>><,n2<units >>)
ORIGIN=<(x><,y >)<units> | (<x<units >><,y<units>>)
STYLE=line-type
WIDTH=thickness-factor
3 tick mark options:
MAJOR=(tick-mark-suboption(s) )| NONE
MINOR=(tick-mark-suboption(s) )| NONE
3 text options:
LABEL=(text-argument(s) )| NONE
REFLABEL=(text-argument(s) )| NONE
SPLIT="split-char"
VALUE=(text-argument(s) )| NONE
Options
When the syntax of an option includes units, use one of these:
CELLS character cells
CM centimeters
IN inches
PCT percentage of the graphics output area
PT points
If you omit units, a unit specification is searched for in this order:
1 GUNIT= in a GOPTIONS statement
2 the default unit, CELLS.
COLOR=axis-color
C=axis-color
specifies the color for all axis components (the axis line, all tick marks, and all
text) unless you include a more explicit AXIS statement color specification. Any of
these color specifications override COLOR= for the specified item:
Table 7.1
calling procedure: all axis text (AXIS label and major tick mark
CTEXT= value descriptions)
CAXIS= axis line and major and minor tick marks
If you omit all color options, the AXIS statement looks for a color specification
in this order:
SAS/GRAPH Statements AXIS Statement 127
LOGBASE=base | E | PI
scales the axis values logarithmically according to the value specified. Base must
be greater than 1. How the values are displayed on the axis depends on the
LOGSTYLE= option. For example, LOGBASE=E with the default
LOGSTYLE=EXPAND generates an axis like the one in Figure 7.2 on page 128.
128 AXIS Statement Chapter 7
NUM
e ** 4
e ** 3
e ** 2
e ** 1
e ** 0
10000 4
1000 3
100 2
10 1
a. b.
If you use ORDER= with a logarithmic axis, the values specified by ORDER=
must match the style specified by LOGSTYLE=. For example, if you specify a
logarithmic axis with a base of 2 and you want to display the first five expanded
values, use this statement:
SAS/GRAPH Statements AXIS Statement 129
If the values that are specified by ORDER= do not match the type of values
specified by LOGSTYLE=, the request for a logarithmic axis is ignored.
This option is not supported by the GRADAR Procedure.
Featured in: “Example 2. Specifying Logarithmic Axes” on page 229 .
Not supported by: Java
MAJOR=(tick-mark-suboption(s) )| NONE
modifies the major tick marks. Tick-mark-suboption(s) defines the color, size, and
number of the major tick marks. NONE suppresses all major tick marks, although
the values represented by those tick marks are still displayed.
Tick-mark-suboption can be
COLOR=tick-color
HEIGHT=tick-height <units >
NUMBER=number-of-ticks
WIDTH=thickness-factor
See “Tick Mark Description Suboptions” on page 139 for complete descriptions.
List all suboptions and their values within the parentheses.
AXIS definitions assigned to the group axis of a bar chart by the GAXIS= option
ignore MAJOR= because the axis does not use tick marks.
Note: By default, tickmarks are now placed at three intervals on the spokes of
a GRADAR chart. They are placed at the minimum value, maximum value, and at
one value in between. The tick marks on the 12 o’clock spoke are also labeled by
default.
HEIGHT is not supported by Java or ActiveX. WIDTH is not supported by
Java. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226 , “Example 2. Specifying Logarithmic Axes” on page 229, and
“Example 7. Using BY-group Processing to Generate a Series of Charts” on page
240.
Not supported by: Java (partial), ActiveX (partial).
MINOR=(tick-mark-suboption(s) )| NONE
modifies the minor tick marks that appear between major tick marks.
Tick-mark-suboption(s) defines the color, number, or size of the minor tick marks.
NONE suppresses all minor tick marks. Tick-mark-suboption can be
COLOR=tick-color
HEIGHT=tick-height <units >
NUMBER=number-of-ticks
WIDTH=thickness-factor
See “Tick Mark Description Suboptions” on page 139 for complete descriptions.
List all suboptions and their values within the parentheses.
AXIS definitions assigned to the group axis of a bar chart by the GAXIS= option
ignore MINOR= because the axis does not use tick marks.
This option is not supported by the GRADAR Procedure.
HEIGHT is not supported by Java or ActiveX.
130 AXIS Statement Chapter 7
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226, “Example 2. Specifying Logarithmic Axes” on page 229, and
“Example 7. Using BY-group Processing to Generate a Series of Charts” on page
240.
Not supported by: Java (partial), ActiveX (partial)
NOBRACKETS
suppresses the printing of group brackets drawn around the values on the group
axis in a bar chart. NOBRACKETS applies only to the group axis of bar charts.
This option is not supported by the GRADAR Procedure.
See also: GROUP= on page 805 and GAXIS= on page 805.
Not supported by: Java, ActiveX
NOPLANE
removes either the horizontal or vertical 3D axis plane in bar charts produced by
the HBAR3D and VBAR3D statements. NOPLANE affects only the axis to which
the AXIS statement applies.
To remove selected axis elements such as lines, values or labels, use specific
AXIS statement options. To remove all axis elements except the 3D planes use the
NOAXIS option in the procedure. To remove the backplane, use the NOFRAME
option in the procedure.
This option is not supported by the GRADAR Procedure.
Featured in: “Example 7. Using BY-group Processing to Generate a Series of
Charts” on page 240.
OFFSET=(<n1><,n2>)<units > | (<n1<units>><,n2<units>>)
specifies the distance from the first and last major tick marks or bars to the ends
of the axis line.
The value of (n1 )is the distance from the beginning (origin) of the axis line to
the first tick mark or middle of the first bar, and the value of (n2 )is the distance
from the end of the axis line to the last tick mark or middle of the last bar.
On a horizontal axis, the (n1) offset is measured from the left end of the axis
line and the (n2) offset is measured from the right end. On a vertical axis, the (n1)
offset is measured up from the bottom of the axis line and the (n2) offset is
measured down from the top of the line.
To specify the same offset for both n1 and n2, use one value, with or without a
following comma. For example, either option sets both n1 and n2 to 4 centimeters:
offset=(4 cm)
offset=(4 cm,)
To specify different offsets, use two values, with or without a comma separating
them. For example,
offset=(4 cm, 2 cm)
To specify only the second offset, use only one value preceded by a comma. This
option offsets the last major tick mark or bar 3 centimeters from the right-hand
end of the axis line:
offset=(,3 cm)
You can specify units for the n1,n2 pair or for the individual offset values.
This option is not by the GRADAR Procedure .
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226.
Not supported by: Java
ORDER=(value-list )
SAS/GRAPH Statements AXIS Statement 131
specifies the order in which data values appear on the axis. The values specified
by ORDER= are the major tick mark values. You can modify the appearance of
these values with the VALUE= option.
The way you specify value-list depends on the type of variable:
3 For numeric variables, value-list is either an explicit list of values or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
n<...n> TO n <BY increment > <n <...n > >
If a numeric variable has an associated format, the specified values must
be the unformatted values.
Values must be listed in either ascending or descending order. By default
the increment value is 1. You can use a negative integer for increment to
specify a value list in descending order. In all forms, multiple n values can be
separated by blanks or commas. Here are some examples:
order=(2 4 6)
order=(6,4,2)
order=(2 to 10 by 2)
order=(50 to 10 by -5)
If the specified range is not evenly divisible by the increment value, the
highest value displayed on the axis is the last incremental value below the
ending value for the range. For example, this value list produces a maximum
axis value of 9:
order=(0 to 10 by 3)
With SAS date and time values, use a FORMAT statement so that the tick
mark values have an understandable form. For more information on SAS
date and time values, see the SAS Language Reference: Dictionary.
With any type of value-list, specifying values that are not distributed uniformly
or are not in ascending or descending order, generates a warning message in the
SAS log. The specified values are spaced evenly along the axis even if the values
are not distributed uniformly.
Using ORDER= to restrict the values displayed on the axis may result in
clipping. For example, if the data range is 1 to 10 and you specify ORDER=(3 TO
5), only the data values from 3 to 5 appear on the plot or chart. For charts, the
omitted values are still included in the statistic calculation.
Note: Values out of range do not always produce a warning message in the
SAS log. 4
CAUTION:
The ORDER= option does not calculate midpoint values; as a result it is not
interchangeable with the MIDPOINTS= option in the GCHART procedure. 4
You can use ORDER= to specify the order in which the midpoints are displayed
on a chart, but do not use it to calculate midpoint values. Be sure that the values
you specify match the midpoint values that are calculated either by default by the
GCHART procedure or by the MIDPOINTS= option. For details, see the
description of MIDPOINTS= for the appropriate statement in Chapter 29, “The
GCHART Procedure,” on page 773.
ORDER= overrides the suboption NUMBER= described in “Tick Mark
Description Suboptions” on page 139.
ORDER= is not valid with the ASCENDING, DESCENDING and NOZEROS
options used with the bar chart statements in the GCHART procedure.
This option is not supported by the GRADAR procedure.
Note: The Java applet supports ORDER= for numeric axes, but does not
support ORDER= for categorical, character, midpoint, or group axes.
The ActiveX control supports only simple order lists. Non-uniform interval
values, such as dates, are not supported. Only max and min values are supported
with a default interval of one day. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226, “Example 5. Filling the Area between Plot Lines” on page 236, and
“Example 7. Using BY-group Processing to Generate a Series of Charts” on page
240
SAS/GRAPH Statements AXIS Statement 133
If you specify two values, with or without a comma separating them, the first
value sets the x coordinate and the second value sets the y coordinate, as in this
example:
origin=(2 pct, 4 pct)
If you specify one value preceded by a comma, only the y coordinate is set to
that value, as shown here:
origin=(,3 pct)
You can specify units for the x,y pair or for the individual coordinates.
This option is not supported by the GRADAR Procedure.
Not supported by: Java, ActiveX
REFLABEL=(text-argument(s)) | NONE
creates and defines the appearance of a reference-line label. Text-argument(s)
defines the appearance or the text of the label, or both. NONE suppresses the
reference-line label. Text-argument(s) can be one or more of these:
’text-string’
provides up to 256 characters of label text. By default, a reference line does
not have a label. Enclose each string in quotes. Separate multiple strings
with blank spaces; the strings are applied to the reference lines consecutively
along the axis, from the plot origin to the end of the axis.
text-description-suboption
modifies a characteristic such as the font, color, or size of the text string(s)
that follows it. Text-description-suboption can be
ANGLE=degrees
AUTOREF
COLOR=text-color
FONT=font | NONE
HEIGHT=text-height <units >
JUSTIFY=LEFT | CENTER | RIGHT
POSITION=TOP| MIDDLE| BOTTOM
ROTATE=degrees
T=n
See “Text Description Suboptions” on page 135 for a complete description.
Specify as many text strings and text description suboptions as you want, but
enclose them all in one set of parentheses.
REFLABEL is not supported by the GRADAR Procedure.
Not supported by: Java, ActiveX.
134 AXIS Statement Chapter 7
SPLIT="split-char"
specifies the split character that the AXIS statement uses to break axis values into
multiple lines. Split-char can be any character value that can be specified in a SAS
character variable. The split character must be embedded in the variable values in
the data set or in an associated format. When the AXIS statement encounters the
split character, it automatically breaks the value at that point and continues on
the next line. For example, suppose the data set contains the value Berlin,
Germany, and you specify SPLIT=",". The value would appear on the axis as
Berlin
Germany
The value will appear on the axis on one line as December, 1999. However,
any other axis values containing a comma would honor the split character.
This option is not supported by the GRADAR Procedure.
Featured in: Example 7 on page 856
Not supported by: Java, ActiveX
STYLE=line-type
specifies a line type for the axis line. Valid values for line-type are 0 through 46. If
you specify STYLE=0, the axis line is not drawn. The default is 1, a solid line.
Note: In order for the axis line to be altered by the STYLE= option, the
NOFRAME option must also be set. If only the STYLE=option is set, the axis
frame will be modified.
Note: This option overrides the LineStyle attribute in graph styles. For more
information on graph styles, see SAS Output Delivery System: User’s Guide . 4
4
Note: See also: Figure 7.22 on page 208 for examples of the available line
types. 4
VALUE=(text-argument(s) )| NONE
modifies the major tick mark values. That is, this option modifies the text that
labels the major tick marks on the axis. Text-argument(s) defines the appearance
or the text of a major tick mark value, or both. NONE suppresses the major tick
mark values, although the major tick marks are still displayed. Text-argument(s)
can be one or more of these:
’text-string’
provides up to 256 characters of text for the major tick mark value. By
default, the value is either the variable value or an associated format value.
Enclose each string in quotes and separate multiple strings with blanks.
Specified text strings are assigned to major tick marks in order. If you
specify only one text string, only the first tick mark value changes, and all
the other tick mark values display the default. If you specify multiple strings,
the first string is the value of the first major tick mark, the second string is
the value of the second major tick mark, and so forth. For example, to change
default tick mark values 1, 2, and 3 to First, Second, and Third, use this
option:
value=(’First’ ’Second’ ’Third’)
SAS/GRAPH Statements AXIS Statement 135
Note: Although VALUE= changes the text displayed at a major tick mark,
it does not affect the actual value represented by the tick mark. To change
the tick mark values, use ORDER=. Also note that with client-side rendering
using Java or ActiveX, it is necessary to use ORDER= to ensure that the
same number of tick marks are displayed as with server-rendered graphics.
For example, specify ORDER=(1 to 12) to ensure that tick marks for all
twelve months are displayed on the client.
To change the value of midpoints in bar charts produced with the
GCHART procedure, use the MIDPOINTS= option in the procedure. 4
text-description-suboption
modifies a characteristic such as the font, color, or size of the text string(s)
that follows it. Text-description-suboption can be
ANGLE=degrees
COLOR=text-color
FONT=font | NONE
HEIGHT=text-height <units >
JUSTIFY=LEFT | CENTER | RIGHT
ROTATE=degrees
TICK=n.
For a complete description, see “Text Description Suboptions” on page 135.
Place text description suboptions before the text strings they modify.
Suboptions not followed by a text string affect the default values. To specify
and describe the text for individual values or to produce multi-line text, use
the TICK= suboption.
Specify as many text strings and text description suboptions as you want, but
enclose them all in one set of parentheses.
Note: If an end-user viewing a graph in the Java applet or ActiveX control
zooms in on a particular part of a graph for which VALUE= is specified, the values
are not readjusted in coordination with the zooming. 4
Featured in: “Example 2. Specifying Logarithmic Axes” on page 229, “Example
7. Using BY-group Processing to Generate a Series of Charts” on page 240, and
“Example 9. Combining Graphs and Reports in a Web Page” on page 248.
Not supported by: Java (partial), ActiveX (partial)
WIDTH=thickness-factor
specifies the thickness of the axis line. Thickness increases directly with the value
of thickness-factor. By default, WIDTH=1.
Note: In order for the axis line to be altered by the WIDTH= option, the
NOFRAME option must also be set. If only the WIDTH=option is set, the axis
frame will be modified.
Java does not support WIDTH. ACTIVEX ignores the WIDTH option for the
vertical axis of an AXIS statement with GPLOT and GCONTOUR. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226.
Not supported by: Java, ActiveX (partial)
specified text strings. See LABEL= on page 127, REFLABEL= on page 133, and
VALUE= on page 134.
ANGLE=degrees
A=degrees
specifies the angle of the baseline with respect to the horizontal. A positive value
for degrees moves the baseline counterclockwise; a negative value moves it
clockwise. By default, ANGLE=0 (horizontal) unless the text is automatically
angled or rotated to avoid overlapping. For an illustration of the effect of
ANGLE=, see Figure 7.24 on page 213.
Note: Changing the angle of a vertical axis-label can result in the label being
positioned above the graph when using client-side rendering with Java or
ActiveX. 4
See also: the ROTATE= suboption on page 138
Featured in: Example 7 on page 856 .
Not supported by: Java (partial)
AUTOREF
automatically labels each reference line on an axis with the response value at the
reference line’s position. AUTOREF is only used with the REFLABEL= option.
The automatic labels are applied only to reference lines that do not have specific
labels assigned to them. For example, the following option uses the response-axis
value as the label for every reference line except the second reference line, which
is assigned the label two:
reflabel=(autoref t=2 "two")
Note, however, that if at the same time you also request automatic labeling with
a PLOT or BUBBLE statement (using the AUTOHREF or AUTOVREF option),
then the automatic labeling of the PLOT or BUBBLE statement can write on top
of your custom label specified with t he AXIS statement. You must ensure that
your custom labels specified with the AXIS statement are not at the same position
as automatic labels requested with a different statement.
Not supported by: Java, ActiveX, GIF
COLOR=text-color
C=text-color
specifies the color for the text. If you omit the COLOR= suboption, a color
specification is searched for in this order:
1 the CTEXT= option for the procedure
2 the CTEXT= option in a GOPTIONS statement
3 the default, the first color in the colors list.
FONT=font | NONE
F=font | NONE
specifies the font for the text. See Chapter 5, “SAS/GRAPH Fonts,” on page 75 for
details on specifying font. If you omit FONT=, a font specification is searched for
in this order:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font, NONE.
Not supported by: Java (partial)
Note: With client-side output using Java and ActiveX, text justification is
relative to the text string, not the tick mark. For example, left justification means
that the left end of the text string is justified with respect to the drawing location,
as well as other strings in a multiline label—which may be to the right of a tick
mark. 4
You can use JUSTIFY= to print multiple lines of text by repeating JUSTIFY=
before the text string for each line. You can also use JUSTIFY= to specify
multi-line text at specified major tick marks. For example, this statement
produces an axis label and major tick mark values like those shown in Figure 7.4
on page 138.
axis label=(’Current’ justify=c
’Sales Projections’)
value=(tick=1 ’JAN’ justify=c ’1997’
tick=2 ’FEB’ justify=c ’1997’
tick=3 ’MAR’ justify=c ’1997’
tick=4 ’APR’ justify=c ’1997’
tick=5 ’MAY’ justify=c ’1997’);
138 AXIS Statement Chapter 7
For the options to be applied to a text string, they must precede the quoted
string. In the following option, the j=left is ignored because it follows the
string:
reflabel(c=green "one" "two" t=3 "three" j=left)
3
Note: Client-side rendering with the Java applet or ActiveX control does not
support the REFLABEL option.
With VALUE=, TICK= specifies the nth major tick mark value. It is used to
designate the tick mark value whose text and appearance you want to modify.
For example, the following option changes the color of only the third tick
mark value and leaves all others unchanged:
value=(tick=3 color=red)
Suboptions that precede TICK= affect all the major tick mark values.
Suboptions that follow TICK= affect only the specified value. For example,
the following option makes all the major tick mark values 4 units high and
colors all of them blue except for the third one, which is red:
value=(height=4 color=blue tick=3 color=red)
FONT=SWISS applies to both Weight and (in tons). HEIGHT=4 affects Weight,
but is respecified as HEIGHT=3 for (in tons). JUSTIFY=RIGHT affects only (in
tons).
If you specify a negative number, tick marks are drawn inside the axis.
Not supported by: Java, ActiveX
NUMBER=number-of-ticks
N=number-of-ticks
specifies the number of tick marks to be drawn. With MAJOR=, number-of-ticks
must be greater than 1. With MINOR=, number-of-ticks must be greater than 0.
With MAJOR=, the NUMBER= suboption can be overridden by a major tick
mark specification in the procedure, which in turn can be overridden by ORDER=.
With MINOR=, the NUMBER= suboption can be overridden by a minor tick
mark specification in the procedure.
NUMBER= is not valid with logarithmic axes.
WIDTH=thickness-factor
W=thickness-factor
specifies the thickness of the tick mark, where thickness-factor is a number.
Thickness increases directly with thickness-factor. By default, WIDTH=1.
Not supported by: Java (partial)
Canceling one AXIS statement does not affect any other AXIS definitions. To cancel
all current AXIS statements, use the RESET= option in a GOPTIONS statement:
goptions reset=axis;
Statement that
generates an Option that assigns an AXIS
Procedure axis Type of axis definition
BY Statement
The BY statement processes data and orders output according to the BY group.
Used by:
GCHART, GCONTOUR, GMAP, GPLOT, GREDUCE, G3D, G3GRID procedures
Description
The BY statement divides the observations from an input data set into groups for
processing. Each set of contiguous observations with the same value for a specified
variable is called a BY group. A variable that defines BY groups is called a BY variable
and is the variable that is specified in the BY statement. When you use a BY
statement, the graphics procedure
3 processes each group of observations independently
3 generates a separate graph or output for each BY group
3 automatically adds a heading called a BY line to each graph identifying the BY
group represented in the graph
3 adds BY statement information below the Description field of the catalog entry.
By default, the procedure expects the observations in the input data set to be sorted
in ascending order of the BY variable values.
Note: The BY statement in SAS/GRAPH is essentially the same as the BY
statement in base SAS, but the effect on the output is different when it is used with
SAS/GRAPH procedures. 4
Syntax
BY<DESCENDING>variable
<...<DESCENDING>variable-n>
<NOTSORTED>;
142 Preparing Data for BY-Group Processing Chapter 7
Required Arguments
variable
specifies the variable that the procedure uses to form BY groups. You can specify
more than one variable. By default, the procedure expects observations in the data
set to be sorted in ascending order by all the variables that you specify or to be
indexed appropriately.
Options
DESCENDING
indicates that the data set is sorted in descending order by the specified variable.
The option affects only the variable that immediately follows the option name, and
must be repeated before every variable that is not sorted in ascending order. For
example, this BY statement indicates that observations in the input data set are
arranged in descending order of VAR1 values and ascending order of VAR2 values:
by descending var1 var2;
This BY statement indicates that the input data set is sorted in descending
order of both VAR1 and VAR2 values:
by descending var1 descending var2;
NOTSORTED
specifies that observations with the same BY value are grouped together, but are
not necessarily sorted in alphabetical or numeric order. The observations can be
grouped in another way, for example, in chronological order.
NOTSORTED can appear anywhere in the BY statement and affects all
variables specified in the statement. NOTSORTED overrides DESCENDING if
both appear in the same BY statement.
The requirement for ordering or indexing observations according to the values
of BY variables is suspended when you use the NOTSORTED option. In fact, the
procedure does not use an index if you specify NOTSORTED. For NOTSORTED,
the procedure defines a BY group as a set of contiguous observations that have the
same values for all BY variables. If observations with the same value for the BY
variables are not contiguous, the procedure treats each new value it encounters as
the first observation in a new BY group and will create a graph for that value,
even if it is only one observation.
Controlling BY Lines
By default, the BY statement prints a BY line above each graph that contains the
variable name followed by an equal sign and the variable value. For example, if you
specify BY SITE in the procedure, the default heading when the value of SITE is
London would be SITE=London.
3 the effect of BY-group processing on the GCHART, GMAP, and GPLOT procedures
3 the interaction between BY-group and RUN-group processing
3 the requirements for using BY-group processing with the Annotate facility
3 how to include BY information in titles, notes, and footnotes
3 how patterns and symbols are assigned to BY-groups
3 the effect of using BY-group processing with the ODS HTML statement.
For additional information on any of these topics, refer to the appropriate chapter.
value of the BY variable. For example, each of these two RUN-groups produces a
separate plot for every value of the BY variable SITE:
/* first run group*/
proc gplot data=sales;
title1 ’Sales Summary’;
by site;
plot sales*model_a;
run;
The BY statement stays in effect for every subsequent RUN group until you submit
another BY statement or exit the procedure. Variables in subsequent BY statements
replace any previous BY variables.
You can also turn off BY-group processing by submitting a null BY statement (BY;) in
a RUN group, but when you do this, the null BY statement turns off BY-group
processing and the RUN group generates a graph.
For more information, see “RUN-Group Processing” on page 33.
sure that REGION always has the same four values. Otherwise, the patterns may not
be the same across graphs. For example, if the value North is missing from the data,
the patterns are assigned as follows:
PATTERN1 is assigned to East,
PATTERN2 is assigned to South,
PATTERN3 is assigned to West.
In this case, South is assigned pattern 2 instead of pattern 3 and West is assigned
pattern 3 instead of pattern 4. To avoid this, include the value North for the variable
REGION, but assign it a missing value for all other variables.
FOOTNOTE Statement
See “TITLE, FOOTNOTE, and NOTE Statements” on page 210.
GOPTIONS Statement
The 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
Description
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. 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 allows 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
3 override default values for graphics options that control either graphics attributes
or device parameters for a single graph or for an entire SAS session
3 reset individual graphics options or all graphics options to their default values
3 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 Chapter 31, “The
GDEVICE Procedure,” on page 915 for details.
To review the current settings of all graphics options, use the GOPTIONS procedure.
See Chapter 36, “The GOPTIONS Procedure,” on page 1075 for details.
Syntax
GOPTIONS<options-list>;
options-list can be one or more options from any or all of the following categories:
3 reset option
SAS/GRAPH Statements GOPTIONS Statement 147
HTITLE=title-height <units>
RENDER=APPEND | DISK | MEMORY | NONE | READ
RENDERLIB=libref
SIMFONT=software-font
3 options that set defaults for procedures and global statements
GUNIT=units
INTERPOL=interpolation-method
OFFSHADOW=(x <units>, y <units> | (x,y) <units>
V6COMP | NOV6COMP
3 image animation options
DELAY=delay-time
DISPOSAL=NONE | BACKGROUND | PREVIOUS | UNSPECIFIED
INTERLACED | NONINTERLACED
ITERATION=iteration-count
TRANSPARENCY | NOTRANSPARENCY
3 options that affect how your SAS/GRAPH program runs
DISPLAY | NODISPLAY
ERASE | NOERASE
GWAIT=seconds
GRAPHRC | NOGRAPHRC
IMAGEPRINT | NOIMAGEPRINT
PCLIP | NOPCLIP
POLYGONCLIP | NOPOLYGONCLIP
3 options that control how output is sent to devices or files
ADMGDF | NOADMGDF
DEVADDR=device-address
DEVICE=device-entry
DEVMAP=device-map-name | NONE
EXTENSION=’file-type’
FILECLOSE=DRIVERTERM | GRAPHEND
FILEONLY | NOFILEONLY
GACCESS=output-format | ’output-format > destination’
GEND=’string’ <...’string-n’>
GEPILOG=’string’ <...’string-n’>
GOUTMODE=APPEND | REPLACE
GPROLOG=’string’ <...’string-n’>
GPROTOCOL=module-name
GSFLEN=record-length
GSFMODE=APPEND | PORT | REPLACE
GSFNAME=fileref
GSFPROMPT | NOGSFPROMPT
GSTART=’string’ <...’string-n’>
HANDSHAKE=HARDWARE | NONE | SOFTWARE | XONXOFF
KEYMAP=map-name | NONE
POSTGEPILOG=’string’
SAS/GRAPH Statements GOPTIONS Statement 149
POSTGPROLOG=’string’
PREGEPILOG=’string’
PREGPROLOG=’string’
PROMPTCHARS=’prompt-chars-hex-string’X
3 options that specify hardware capabilities of the device
CHARACTERS | NOCHARACTERS
CIRCLEARC | NOCIRCLEARC
DASH | NODASH
DASHSCALE=scaling-factor
FILL | NOFILL
FILLINC=0...9999
LFACTOR=line-thickness-factor
PIEFILL | NOPIEFILL
POLYGONFILL | NOPOLYGONFILL
SYMBOL | NOSYMBOL
3 options that control printer hardware features
AUTOCOPY | NOAUTOCOPY
AUTOFEED | NOAUTOFEED
BINDING=DEFAULTEDGE | LONGEDGE | SHORTEDGE
COLLATE | NOCOLLATE
DUPLEX | NODUPLEX
GCOPIES=(<current-copies><,max-copies>)
PAPERDEST=bin
PAPERFEED=feed-increment <IN | CM>
PAPERLIMIT=width <IN | CM>
PAPERSIZE=’size-name’ | (width,height)
PAPERSOURCE=tray
PAPERTYPE=’type-name’
PPDFILE=fileref | ’external-file’
REPAINT=redraw-factor
REVERSE | NOREVERSE
SPEED=pen-speed
UCC=’control-characters-hex-string’X
3 options that interact with the operating environment
DRVINIT=’system-command(s)’
DRVTERM=’system-command(s)’
PREGRAPH=’system-command(s)’
POSTGRAPH=’system-command(s)’
PROMPT | NOPROMPT
3 options for mainframe systems
GCLASS=SYSOUT-class
GDDMCOPY=FSCOPY | GSCOPY
GDDMNICKNAME=nickname
GDDMTOKEN=token
GDEST=destination
150 Using the GOPTIONS Statement Chapter 7
GFORMS=’forms-code’
GWRITER=’writer-name’
TRANTAB=table | user-defined-table
Options
See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page 261
for a complete description of all graphics options used by the GOPTIONS statement.
To reset only the background color specification to the default and keep the
remaining values, use this GOPTIONS statement:
goptions cback=;
Alternatively, you can use RESET=ALL, but it also cancels any global statement
definitions in addition to resetting all graphics options to default values.
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. 4
SAS/GRAPH Statements LEGEND Statement 151
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.
LEGEND Statement
The LEGEND statement controls the location and appearance of legends on
two-dimensional plots, contour plots, maps, and charts.
Used by:
GCHART, GCONTOUR, GMAP, GPLOT procedures
Global
Description
LEGEND statements specify the characteristics of a legend but do not create
legends. These characteristics are
3 the position and appearance of the legend box
3 the text and appearance of the legend label
3 the appearance of the legend entries, including the size and shape of the legend
values
3 the text of the labels for the legend values.
LEGEND definitions are not automatically applied when a procedure generates a
legend. Instead, they must be explicitly assigned with a LEGEND= option in the
appropriate procedure statement.
illustrates the terms associated with the various parts of a legend.
Syntax
LEGEND<1...99>< options>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ACROSS=number-of-columns
CBLOCK=block-color
CBORDER=frame-color
CFRAME=background-color
CSHADOW=shadow-color
DOWN=number-of-rows
FRAME
152 LEGEND Statement Chapter 7
FWIDTH=thickness-factor
SHAPE=BAR(width,height) <units> | LINE(length) <units> |
SYMBOL(width,height) <units>
3 position-options
MODE=PROTECT | RESERVE | SHARE
OFFSET=(<x ><,y >)<units > | (<x <units >><,y <units >>)
ORIGIN=(<x ><,y >)<units > | (<x <units >><,y <units >>)
POSITION=(<BOTTOM | MIDDLE | TOP> <LEFT | CENTER | RIGHT>
<INSIDE | OUTSIDE>)
3 text-options
LABEL=(text-argument(s)) | NONE
ORDER=(value-list)
VALUE=(text-argument(s)) | NONE
Options
When the syntax of an option includes units, use one of these:
CELLS character cells
CM centimeters
IN inches
PT points
PCT percentage of the graphics output area
Note: The Java applet does not support CM, IN, or PT. 4
If you omit units, a unit specification is searched for in this order:
1 GUNIT= in a GOPTIONS statement
2 the default unit, CELLS.
ACROSS=number-of-columns
specifies the number of columns to use for legend entries.
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245.
CBLOCK=block-color
generates and colors a three-dimensional block effect behind the legend. The size
and position of the block are controlled by the graphics option OFFSHADOW=(x,y).
CBLOCK= and CSHADOW= are mutually exclusive. If both are present,
SAS/GRAPH software uses the last one specified. CBLOCK= is usually used in
conjunction with the FRAME, CFRAME=, or CBORDER= options.
The Java client treats the CBLOCK option like CSHADOW.
See also: the OFFSHADOW=“OFFSHADOW” on page 325 graphics option and
“Creating Drop Shadows and Block Effects” on page 163.
Not supported by: Java
CBORDER=frame-color
draws a colored frame around the legend. This option overrides the FRAME
option. CBORDER= can be used in conjunction with the CFRAME= option.
CFRAME=background-color
SAS/GRAPH Statements LEGEND Statement 153
specifies the background color of the legend. This option overrides the FRAME
option. If both CFRAME= and FRAME= are specified, only the solid background
produced by CFRAME= is displayed. CFRAME= can be used in conjunction with
the CBORDER= option.
CSHADOW=shadow-color
generates and colors a drop shadow behind the legend. The size and position of
the shadow is controlled by the graphics option OFFSHADOW=(x,y).
CSHADOW= and CBLOCK= are mutually exclusive. If both are present,
SAS/GRAPH uses the last one specified. CSHADOW= is usually specified in
conjunction with the FRAME, CFRAME=, or CBORDER= options.
See also: the OFFSHADOW=“OFFSHADOW” on page 325 graphics option and
“Creating Drop Shadows and Block Effects” on page 163.
DOWN=number-of-rows
specifies the number of rows to use for legend entries.
FRAME
draws a frame around the legend. The color of the frame is the first color in the
colors list.
FWIDTH=thickness-factor
specifies the thickness of the frame, where thickness-factor is a number. The
thickness of the line increases directly with thickness-factor. By default,
FWIDTH=1.
Not supported by: Java, ActiveX
LABEL=(text-argument(s)) | NONE
modifies a legend label. Text-argument(s) defines the appearance or the text of a
legend label, or both. NONE suppresses the legend label. By default, the text of
the legend label is either the variable name or a previously assigned variable label
(except in the case of GPLOT with OVERLAY, in which case the default label is
“PLOT”). Text-argument(s) can be one or more of these:
‘text-string’
provides up to 256 characters of label text. Enclose each string in quotes.
Separate multiple strings with blanks.
text-description-suboption
modifies a characteristic such as the font, color, or size of the text string(s)
that follows it. Text-description-suboption can be
COLOR=text-color
FONT=font | NONE
HEIGHT=text-height <units>
JUSTIFY=LEFT | CENTER | RIGHT
POSITION=(<BOTTOM | MIDDLE | TOP> <LEFT | CENTER |
RIGHT>)
Note: The Java applet does not support the POSITION suboption—it
draws legend labels at the top-left of the legend. And, it does not support
multiple values for the JUSTIFY suboption (only the first is honored). The
ActiveX control supports POSITION= but does not support multiple values
for the JUSTIFY suboption (only the first is honored). 4
See “Text Description Suboptions” on page 158 for complete descriptions.
Specify as many text strings and text description suboptions as you want, but
enclose them all in one set of parentheses.
154 LEGEND Statement Chapter 7
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on
page 231 and “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245
Not supported by: Java (partial), ActiveX (partial)
MODE=PROTECT | RESERVE | SHARE
specifies whether or not the legend is drawn in the procedure output area or
whether legend elements can overlay other graphics elements. MODE= can take
one of these values:
PROTECT draws the legend in the procedure output area, but a blanking
area surrounds the legend, preventing other graphics elements
from being displayed in the legend. (A blanking area is a
protected area in which no other graphics elements are
displayed.)
RESERVE takes space for the legend from the procedure output area,
thereby reducing the amount of space available for the graph.
If MODE=RESERVE is specified in conjunction with
OFFSET=, the legend may push the graph off the graphics
output area. RESERVE is valid only when
POSITION=OUTSIDE. If POSITION=INSIDE is specified, a
warning is issued and MODE= is changed to PROTECT.
SHARE draws the legend in the procedure output area. If the legend is
positioned over elements of the graph itself, both graphics
elements and legend elements are displayed.
By default, MODE=RESERVE unless POSITION=INSIDE, in which case the
default changes to MODE=PROTECT.
See also: “Positioning the Legend” on page 162
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245.
Not supported by: Java, ActiveX
OFFSET=(<x><,y>)<units> | (<x <units>><,y <units>>)
specifies the distance to move the entire legend; x is the number of units to move
the legend right (positive numbers) or left (negative numbers), and y is the number
of units to move the legend up (positive numbers) or down (negative numbers).
To set only the x offset, specify one value, with or without a following comma:
offset=(4 cm,)
To set both the x and y offset, specify two values, with or without a comma
separating them:
offset=(2 pct, 4 pct)
See also: “Positioning the Legend” on page 162 and the option POSITION= on
page 155
Not supported by: Java, ActiveX
ORDER=(value-list)
selects or orders the legend values that appear in the legend. The way you specify
value-list depends on the type of variable that generates the legend:
3 For numeric variables, value-list is either an explicit list of values, or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment> <n <...n>>
If a numeric variable has an associated format, the specified values must
be the unformatted values.
3 For character variables, value-list is a list of unique character values enclosed
in quotes and separated by blanks:
’value-1’ <...’value-n’>
If a character variable has an associated format, the specified values must
be the formatted values.
For a complete description of value-list, see the option ORDER= on page 130 in
the AXIS statement.
Even though ORDER= controls whether a legend value is displayed and where
it appears, the VALUE= option controls the text that the legend value displays.
Not supported by: ActiveX, Java
ORIGIN=(<x><,y>)<units> | (<x <units >><,y <units>>)
specifies the x coordinate and the y coordinate of the lower-left corner of the legend
box. ORIGIN= explicitly positions the legend anywhere on the graphics output
area. It is possible to run a legend off the page or overlay the graph.
To set only the x coordinate, specify one value, with or without a following
comma:
origin=(4 cm,)
To set both the x and y coordinates, specify two values, with or without a comma
separating them:
origin=(2 pct, 4 pct)
ORIGIN= overrides the POSITION= option if both are used. Although using the
OFFSET= option with the ORIGIN= option is unnecessary, if OFFSET= is also
specified, it is applied after the ORIGIN= request has been processed.
See also: “Positioning the Legend” on page 162
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245 .
Not supported by: Java, ActiveX
POSITION=(<BOTTOM | MIDDLE | TOP> <LEFT | CENTER | RIGHT>
<OUTSIDE | INSIDE>)
positions the legend on the graph. Value for POSITION= are
156 LEGEND Statement Chapter 7
OUTSIDE or specifies the location of the legend in relation to the axis area.
INSIDE
BOTTOM or specifies the vertical position.
MIDDLE or
TOP
LEFT or specifies the horizontal position.
CENTER or
RIGHT
By default, POSITION=(BOTTOM CENTER OUTSIDE). You can change one or
more settings. If you supply only one value the parentheses are not required. If
you specify two or three values and omit the parentheses, SAS/GRAPH accepts the
first value and ignores the others.
Once you assign the initial legend position, you can adjust it with the OFFSET=
option.
The ORIGIN= options overrides POSITION=. The value of the MODE= option
can affect the behavior of POSITION=.
This specification produces legend values like the ones in Figure 7.6 on
page 157(b):
SAS/GRAPH Statements LEGEND Statement 157
shape=symbol(2,.5)
Minn Minn
CITY
CITY CITY
CITY
Phoenix Phoenix
Raleigh Raleigh
a. b.
By default, width is 5, height is 1, and units are CELLS. You can specify
units for the width,height pair or for the individual coordinates.
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on
page 231.
Not supported by: Java, ActiveX
VALUE=(text-argument(s) )| NONE
modifies the legend value descriptions. Text-argument(s) defines the appearance or
the text of the value descriptions. By default, value descriptions are the values of
the variable that generates the legend or an associated format value. Numeric
values are right justified and character values are left justified.
NONE suppresses the value descriptions although the legend values (bars,
lines, and so on) are still displayed. (NONE is not supported by Java or ActiveX).
Text-argument(s) can be one or more of these:
‘text-string’
provides up to 256 characters of text for the value description. Enclose each
string in quotes. Separate multiple strings with blanks.
Specified text strings are assigned to the legend values in order. If you
submit only one string, only the first legend entry uses the value of that
string. If you specify multiple strings, the first string is the text for the first
entry; the second string is the text for the second entry; and so forth. For
example, this specification produces legend entries like those shown in Figure
7.7 on page 157:
value=(’1986’ ’1987’ ’1988’)
text-description-suboption
modifies a characteristic such as the font, color, or size of the text string(s)
that follows it. Text-description-suboption can be
158 LEGEND Statement Chapter 7
COLOR=text-color
FONT=font | NONE
HEIGHT=text-height <units >
JUSTIFY=LEFT | CENTER | RIGHT
TICK=n (not supported by Java or ActiveX)
See “Text Description Suboptions” on page 158 for complete descriptions.
Place text description suboptions before the text strings they modify.
Suboptions not followed by a text string affect the default values. To specify
and describe the text for individual values or to produce multi-line text, use
the TICK= suboption.
Specify as many text strings and text description suboptions as you want, but
enclose them all in one set of parentheses.
To order or select legend entries, use the ORDER= option.
See also: “Text Description Suboptions” on page 158 and the option ORDER= on
page 155
Not supported by: Java (partial), ActiveX (partial)
FONT=font | NONE
F=font | NONE
specifies the font for the text. See Chapter 5, “SAS/GRAPH Fonts,” on page 75for
information on specifying fonts. If you omit FONT=, a font specification is
searched for in this order:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font, NONE.
HEIGHT=text-height <units>
H=text-height <units>
specifies the height of the text characters in the number of units. By default,
HEIGHT=1 CELL. If you omit HEIGHT=, a text height specification is searched
for in this order:
1 the HTEXT= option in a GOPTIONS statement
2 the default value, 1.
You can use JUSTIFY= to print multiple lines of text by repeating JUSTIFY=
before the text string for each line. For example, this statement produces a legend
label and value descriptions like those shown in Figure 7.8 on page 159:
legend label=(justify=c ’Distribution’
justify=c ’Centers’)
value=(tick=1 justify=c ’Portland,’
justify=c ’Maine’
tick=2 justify=c ’Paris,’
justify=c ’France’
tick=3 justify=c ’Sydney,’
justify=c ’Australia’);
Figure 7.8 Specifying Multiple Lines of Text with the JUSTIFY= Suboption
Figure 7.9 Using the POSITION= Suboption with Multi-line Legend Labels
POSITION=LEFT POSITION=(TOP)
(default) JUSTIFY=CENTER
multi-
multi- line
line label
label + + + ONE
● ● ● TWO + + + ONE
x x x THREE ● ● ● TWO
# # # FOUR x x x THREE
$ $ $ FIVE # # # FOUR
$ $ $ FIVE
POSITION=(TOP LEFT)
POSITION=TOP
multi- + + + ONE JUSTIFY=LEFT
line ● ● ● TWO
label x x x THREE multi-
# # # FOUR line
$ $ $ FIVE label
+ + + ONE
● ● ● TWO
x x x THREE
POSITION=(MIDDLE LEFT) # # # FOUR
$ $ $ FIVE
+ + + ONE
multi- ● ● ● TWO
line x x x THREE
label # # # FOUR POSITION=TOP
$ $ $ FIVE JUSTIFY=RIGHT
multi-
POSITION=(BOTTOM LEFT) line
label
+ + + ONE + + + ONE
● ● ● TWO ● ● ● TWO
multi- x x x THREE x x x THREE
line # # # FOUR # # # FOUR
label $ $ $ FIVE $ $ $ FIVE
If you omitted TICK=3, the text of the second legend entry would be
ParisSydney.
Text description suboptions that precede TICK= affect all the value descriptions
for the legend unless the same suboption (with a different value) follows a TICK=
specification. Text description suboptions that follow TICK= affect only the
specified legend entry. For example, suppose you specify this option for a legend
with three entries:
value=(color=red font=swiss tick=2 color=blue)
The text of all three entries would use the Swiss font; the first and third entries
would be red and only the second entry would be blue.
FONT=SWISS applies to both Weight and (in tons). HEIGHT=4 affects Weight,
but is respecified as HEIGHT=3 for (in tons). JUSTIFY=RIGHT affects only (in
tons).
Canceling one LEGEND statement does not affect any other LEGEND definitions. To
cancel all current LEGEND statements, use RESET= in a GOPTIONS statement:
goptions reset=legend;
legend
axis positions
Figure 7.11 on page 162 shows legend positions outside the axis area.
Use OFFSET=(x,y) to adjust the position of the legend specified by POSITION=. The
x value shifts the legend either left or right and the y value shifts the legend either up
or down.
The offset values are always applied after the POSITION= request. For example, if
POSITION=(TOP RIGHT OUTSIDE), the legend is located in the upper right corner of
the graphics output area. If OFFSET=(0,0) is specified, the legend does not move. If
OFFSET=(-5,-8)CM, the legend moves 5 centimeters to the left and 8 centimeters down.
Using ORIGIN=
Use ORIGIN=(x,y) to specify the coordinates of the exact location of the lower left
corner of the legend box. Because ORIGIN=(0,0) is the lower left corner of the graphics
output area, the values of x and y must be positive. If you specify negative values, a
warning is issued and the default value is used.
NOTE Statement
See “TITLE, FOOTNOTE, and NOTE Statements” on page 210.
Description
This section describes the ODS HTML statement as it relates to SAS/GRAPH
procedures.
The ODS HTML statement opens or closes the HTML destination. If the destination
is open, it produces output that is written in Hyper Text Markup Language (HTML). If
DEVICE=GIF, graphics output is produced as GIF files, and the HTML files display the
GIF files that are created by the SAS/GRAPH procedures. If DEVICE=JAVAMETA,
graphics output is produced as metagraphics data, which provides graphs that are exact
replicas of their corresponding GRSEG graphs but that are interactive in a Web page.
Procedures GCHART, GCONTOUR, GMAP, GPLOT, and G3D can also be used with the
JAVA and ACTIVEX drivers, both of which generate JavaScript in the output HTML
file. If DEVICE=JAVA, then a Java-enabled browser can use the script to render graphs
as a SAS/GRAPH Applet for Java. If DEVICE=ACTIVEX, then an ActiveX-enabled
browser can use the script to render graphs as a SAS/GRAPH Control for ActiveX.
Syntax
ODS HTML HTML-file-specification(s) | action
<ANCHOR=’string’>
<ARCHIVE=’string’>
<ATTRIBUTES=(’attribute-name1’=’attribute-value-1’ ...
’attribute-name-n’=’attribute-value=n’)>
<CODEBASE=file-location <(URL=’Uniform-Resource-Locator’)>>
<BASE=’base-text’>
<GFOOTNOTE | NOGFOOTNOTE>
<GPATH=graphics-location <(URL=’Uniform-Resource-Locator’ | NONE )>>
<GTITLE | NOGTITLE>
<HEADTEXT=’HTML-for-document-head’>
<METATEXT=’HTML-for-document-head’>
<NEWFILE=starting-point>
<PARAMETERS=(’parameter-name1’=’parameter-value-1’ ...
’parameter-name-n’=’parameter-value=n’)>
<PATH=file-location <(URL=’Uniform-Resource-Locator’ | NONE )>>
SAS/GRAPH Statements ODS HTML Statement 165
<RECORD_SEPARATOR=’string’ | NONE>
<STYLE=style-definition>
<TRANTAB=’translation-table’>;
Note: BODY= is required. If you use FRAME=, you must also use
CONTENTS= or PAGE=. 4
Required Arguments
One of these arguments is required.
CLOSE
closes the HTML destination and closes any HTML files that are currently open.
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245.
EXCLUDE
excludes output objects from the HTML destination.
SELECT
selects output objects to send to the HTML destination.
SHOW
writes to the SAS log the current selection or exclusion list for the HTML
destination.
HTML-file-specification
opens the HTML destination and specifies the HTML file or files to write to. You
can open up to four HTML files; the file designated by BODY= is required.
Whenever you open one of these files, it remains open until you either
3 close the HTML destination with ODS HTML CLOSE
3 open a different file for the same HTML file specification.
HTML-file-specification can be one or more of the following arguments. Values
for file-specification follow the arguments.
BODY=file-specification
FILE=file-specification
identifies the file that contains the HTML version of the procedure output.
With SAS/GRAPH, the body file contains references to the graphs. If
166 ODS HTML Statement Chapter 7
DEVICE=GIF, the graphs are stored in separate GIF files. When you view
the body file on a browser, the graphs are automatically displayed.
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245 and “Example 10. Creating a Bar Chart with
Drill-down for the Web” on page 255.
CONTENTS=file-specification
identifies the file that contains a table of contents to the ODS output that is
produced while the HTML destination is open. The contents file contains
links to the body file(s).
The text of links to graphics output is taken from the description field of
the GRSEG catalog entry. Use the DESCRIPTION= option in the procedure
to change the link text.
You can display a contents file alone or in conjunction with a frame file. If
you display a contents file directly (without using a frame file), selecting a
link opens the associated body file, and the contents file is no longer
displayed. If you display a contents file with a frame file, the contents file
always remains available in the left frame, and selecting a link opens the
associated body file in the right frame.
FRAME=file-specification
identifies a file that points to the body file and to either the table of contents
file or the page file, or both. If you specify FRAME=, you must also specify
either CONTENTS= or PAGE= or both.
When you open the frame file in the browser, it displays the Table of
Contents or the Table of Pages or both in the left frame, and the body file in
the right frame.
PAGE=file-specification
identifies the file that contains a table of pages to the ODS output that is
produced while the HTML destination is open.The pages file contains links to
the body file(s). ODS produces a new page of output whenever a procedure
explicitly specifies for a new page. The SAS system option PAGESIZE= has
no effect on pages in HTML output.
File-specification identifies the file or SAS catalog to write to and can be one of
the following:
3 fileref (<URL=’Uniform-Resource-Locator’> <NO_BOTTOM_MATTER>
<NO_TOP_MATTER> <DYNAMIC>)
3 external-file (<URL=’Uniform-Resource-Locator’> <NO_BOTTOM_MATTER>
<NO_TOP_MATTER> <DYNAMIC> )
3 entry.HTML (<URL=’Uniform-Resource-Locator’> <NO_BOTTOM_MATTER>
<NO_TOP_MATTER> <DYNAMIC> )
where
external-file
is the physical name of an external file to write to. For information on
specifying external files, see the SAS companion for your operating
environment.
fileref
is a fileref that has been assigned to an external file. The fileref must refer to
a single file; it cannot point to an aggregate file storage location. Use a
FILENAME statement to assign a fileref. See also “FILENAME Statement”
on page 28.
SAS/GRAPH Statements ODS HTML Statement 167
entry.HTML
specifies an entry in a SAS catalog to write to.You must also specify a library
and catalog. See the discussion on PATH=“ODS HTML Statement” on page
164.
URL=’Uniform-Resource-Locator’
provides a URL for file-specification. ODS uses this URL instead of the file
name in all the links and references that it creates that point to the file.
This option is useful for building HTML files that may be moved from one
location to another. If the links from the contents and page files are
constructed with a simple URL (one name), they work as long as the
contents, page, and body files are all in the same location.
NO_BOTTOM_MATTER
NOBOT
omits the bottom matter for the file. By default, when you close a file that
was open for HTML output of any kind, ODS writes some HTML to the
bottom of the file. This HTML ends the file so that it can be viewed cleanly in
a browser.
If you wish to leave a file in a state that you can append to, use
NO_BOTTOM_MATTER on the BODY= option on the ODS HTML statement
that opens the file. This option, in conjunction with NO_TOP_MATTER
makes it possible for you to add output to a file that already exists and to put
your own HTML code in the file between pieces of output.
To use NO_BOTTOM_MATTER, you must use a fileref for file-specification.
The FILENAME statement that defines the fileref must include the
host-specific option that opens the file for appending.
When you are opening a file that ODS has previously written to, you must
use ANCHOR= to specify a new base name for the anchors to avoid
duplicating anchors that already exist in the file. See the discussion “About
Anchors” on page 168.
NO_TOP_MATTER
NOTOP
omits the opening matter for the file. By default, when you open a file for
HTML output of any kind, ODS writes some HTML to the top of the file.
If you wish to append ODS output to an existing file, you must open the file
with NO_TOP_MATTER on the BODY= option on the ODS HTML statement
that opens the file. This option, in conjunction with NO_BOTTOM_MATTER
makes it possible for you to add output to a file that already exists and to put
your own HTML code in the file between pieces of output.
To use NO_TOP_MATTER, you must use a fileref for file-specification. The
FILENAME statement that defines the fileref must include the host-specific
option that opens the file for appending.
When you are opening a file that ODS has previously written to, you must
use ANCHOR= to specify a new base name for the anchors to avoid
duplicating anchors that already exist in the file. See the discussion“About
Anchors” on page 168.
DYNAMIC
enables you to send HTML output directly to a web server instead of writing
it to a file. This option sets the value of the HTMLContentType= attribute.
By default, if you do not specify DYNAMIC, ODS sets the value of
HTMLContentType= for writing to a file.
Note: If you specify the DYNAMIC suboption with any file specification in
the ODS HTML statement, you must specify it for all the file specifications in
the statement. 4
168 Using the ODS HTML Statement Chapter 7
Note: Regardless of how you specify the file, you may need to include the extension
.HTML or .HTM on the file name. Some browsers require one of these extensions in
order to read the file. 4
About Anchors
ODS HTML automatically creates an anchor for every piece of output generated by
the SAS procedures. An anchor specifies a particular location within an HTML file. In
SAS/GRAPH, an anchor usually defines a link target such as a graph whose location is
defined in an IMG element.
Controlling the anchor name is useful when you create a graph with drill-down
capability. In this case, you must create a variable that contains the names of the
anchors that are the targets for the different areas of the graph that the user may click
on.
PATTERN Statement
The PATTERN statement defines the characteristics of patterns used in graphs.
Used by:
GCHART, GCONTOUR, GMAP, GPLOT procedures; SYMBOL statement;
Annotate facility
Global
Assigned by default
Description
PATTERN statements create PATTERN definitions that define the color and type of
area fill for patterns used in graphs. These are the procedures and the graphics areas
that they create that use PATTERN definitions:
GCHART color, fill pattern, or image for the bars in 2D bar charts; color and
fill pattern for the segments of 3D bar charts, pie charts, and star
charts.
GCONTOUR contour levels in contour plots
GMAP map areas in choropleth, block, and prism maps; blocks in block
maps
GPLOT areas beneath or between plotted lines.
In addition, the SYMBOL statement and certain Annotate facility functions and
macros can use pattern specifications. For details see the “SYMBOL Statement” on
page 183 and Chapter 24, “Using Annotate Data Sets,” on page 587.
You can use the PATTERN statement to control the fill and color of a pattern, and
whether the pattern is repeated. There are three types of patterns:
3 bar and block patterns
3 map and plot patterns
3 pie and star patterns
Pattern fills can be solid or empty, or composed of parallel or crosshatched lines. For
two-dimensional bar charts, the PATTERN statement can specify images to fill
horizontal or vertical bars. In addition, you can specify device-dependent hardware
patterns for rectangle, polygon, and pie fills on devices that support hardware patterns.
If you do not create PATTERN definitions, SAS/GRAPH software generates them as
needed and assigns them to your graphs by default. Generally, the default behavior is
to rotate a solid pattern through the current colors list. For details, see “About Default
Patterns” on page 177.
Syntax
PATTERN<1...255>
<COLOR=pattern-color>
<REPEAT=number-of-times>
170 PATTERN Statement Chapter 7
<VALUE=bar/block-pattern
| map/plot-pattern
| pie/star-pattern
| hardware-pattern>;
Options
COLOR=pattern-color
C=pattern-color
specifies the color of the fill. Pattern-color is any SAS/GRAPH color name. See
Chapter 6, “SAS/GRAPH Colors and Images,” on page 91 .
Note: ActiveX assigns colors in a different order from Java, so the same data
can appear differently with those two drivers. 4
Using COLOR= with a null value cancels the color specified in a previous
PATTERN statement of the same number without affecting the values of other
options.
COLOR= overrides the CPATTERN= graphics option.
The CFILL= option in the PIE and STAR statements overrides COLOR=. For
details, see “Controlling Slice Patterns and Colors” on page 831.
CAUTION:
Omitting COLOR= in a PATTERN statement may cause the PATTERN statement to
generate multiple PATTERN definitions. 4
If no color is specified for a PATTERN statement, that is, if neither COLOR=
nor CPATTERN= is used, the PATTERN statement rotates the specified fill
through each color in the colors list before the next PATTERN statement is used.
For details, see “Understanding Pattern Sequences” on page 182.
See also: “Working with PATTERN Statements” on page 179.
Featured in: “Example 7. Using BY-group Processing to Generate a Series of
Charts” on page 240.
Not supported by: Java (partial), ActiveX (partial)
SAS/GRAPH Statements PATTERN Statement 171
If no valid patterns are available, default bar and block fill patterns are selected
in this order:
1 SOLID
SAS/GRAPH Statements PATTERN Statement 173
2 X1– X5
3 L1– L5
4 R1– R5
Each fill is used once with every color in the colors list unless a pattern color is
specified. The entire sequence is repeated as many times as required to provide
the necessary number of patterns.
Note: If the V6COMP graphics option is in effect, or if color is limited to a
single color with the CPATTERN= or COLORS= graphics options, the order is X1–
X5, L1– L5, R1– R5, S, and E. 4
Not supported by: Java (partial), ActiveX (partial)
VALUE=map/plot-pattern
V=map/plot-pattern
specifies patterns for:
3 contour levels in contour plots produced by the GCONTOUR procedure
3 map area surfaces in block, choropleth, and prism maps produced by the
BLOCK, CHORO, AND PRISM statements in the GMAP procedure.
3 areas under curves in plots produced by the AREAS= option in the PLOT
statement in the GPLOT procedure.
Values for map/plot-pattern are
MEMPTY an empty pattern. EMPTY or E are also valid aliases, except
ME when used with the map areas in block maps created by the
GMAP procedure.
MSOLID a solid pattern. SOLID or S are also valid aliases, except when
MS used with the map areas in block maps created by the GMAP
procedure.
Mdensity<style<angle>> a shaded pattern.
Note: Mdensity<style<angle>> is not supported by the Java
or ActiveX clients. 4
0o
M3N0 M3X0
o
45
M3N45 M3X45
90o
M3N90 M3X90
135o
M3N135 M3X135
If no valid patterns are available, default map and plot fill patterns are selected
in this order:
1 MSOLID
2 M2N0
3 M2N90
4 M2X45
5 M4N0
6 M4N90
7 M4X90
Each fill is used once with every color in the colors list unless a pattern color is
specified. The entire sequence is repeated as many times as required to provide
the necessary number of patterns.
Note: If the V6COMP graphics option is in effect, or if color is limited to a
single color with the CPATTERN= or COLORS= graphics options, MSOLID is not
used and the default fill list starts with M2N0. 4
Not supported by: Java (partial), ActiveX (partial)
VALUE=pie/star-pattern
V=pie/star-pattern
specifies patterns for pie and star charts produced by the PIE and STAR
statements in the GCHART procedure. Values for pie/star-pattern are
PEMPTY an empty pattern. EMPTY or E are also valid aliases.
PE
PSOLID a solid pattern. SOLID or S are also valid aliases.
PS
Pdensity<style<angle>> a shaded pattern.
SAS/GRAPH Statements PATTERN Statement 175
o
0
P3N0 P3X0
o
45
P3N45 P3X45
o
90
P3N90 P3X90
o
135
P3N135 P3X135
If no valid patterns are available, default pie and star fill patterns are selected
in this order:
1 PSOLID
2 P2N0
3 P2N90
176 Using the PATTERN Statement Chapter 7
4 P2X45
5 P4N0
6 P4N90
7 P4X90
Each fill is used once with every color in the colors list unless a pattern color is
specified. The entire sequence is repeated as many times as required to provide
the necessary number of patterns.
Note: If the V6COMP graphics option is in effect, or if color is limited to a
single color with the CPATTERN= or COLORS= graphic options, PSOLID is not
used and the default fill list starts with P2N0. 4
Note: If you use hatch patterns and request a legend instead of slice labels, the
patterns in the slices are oriented to be visually equivalent to the legend. 4
Not supported by: Java (partial), ActiveX (partial)
VALUE=HWxxxnnn
specifies a hardware pattern where
HW identifies the pattern as a hardware pattern. The pattern name
must begin with the characters HW.
xxx the last two or three characters of the module name in the
Module field in the Detail window of your device entry. If the
module name has eight characters (SASGDPSL, for example),
use the last three characters (PSL). If the module name has
only seven characters (SASGDVT, for example), use the last
two characters (VT).
nnn the number the driver uses to identify the device-dependent
pattern. Patterns and associated pattern numbers vary from
device to device. See the documentation for your device for
valid pattern numbers. For a brief description of some device
specific pattern values, see “Specifying Device-Dependent
Hardware Patterns” on page 181.
If you specify a hardware pattern for a device that does not support hardware
patterns, or if you specify an invalid pattern number, a solid rectangle, polygon, or
pie fill is substituted. A solid fill will also be used in place of a hardware pattern
in certain types of clipped polygons. See the PCLIP and POLYGONCLIP options
in Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page 261
for more information on using hardware patterns with clipped polygons.
See also: “Specifying Device-Dependent Hardware Patterns” on page 181.
Not supported by: Java (partial), ActiveX (partial)
description of COLOR= on page 170, VALUE= on page 173, and IMAGE= on page 171
options.
PATTERN definitions are generated in the order in which the statements are
numbered, regardless of gaps in the numbering or the statement’s position in the
program. Although it is common practice, you do not have to start with PATTERN1,
and you do not have to use sequential statement numbers.
PATTERN definitions are applied automatically to all areas of the graphics output
that require patterns. When assigning PATTERN definitions, SAS/GRAPH starts with
the lowest-numbered definition with an appropriate fill specification or with no fill
specification. It continues to use the specified patterns until all valid PATTERN
definitions have been used. Then, if more patterns are required, SAS/GRAPH returns
to the default pattern rotation, but continues to outline the areas in the same color as
the fill.
This statement cancels only REPEAT= without affecting the rest of the definition:
pattern4 repeat=;
Add or change options in the same way. This statement changes the color of the
pattern from red to blue:
pattern4 color=blue;
Canceling one PATTERN statement does not affect any other PATTERN definitions.
To cancel all current PATTERN statements, use the RESET= option in a GOPTIONS
statement:
goptions reset=pattern;
3 automatically generates the appropriate default patterns and outlines to fill the
areas, or
3 uses patterns, colors, and outlines that are defined by PATTERN statements,
graphics options, and procedure options.
In order to understand how SAS/GRAPH generates and assigns patterns defined
with PATTERN statements it is helpful to understand how it generates and assigns
default patterns. The following sections describe the default pattern behavior for all
procedures. See “Working with PATTERN Statements” on page 179 for details about
defining patterns.
pattern1 value=r3;
In this case, the PATTERN statement rotates the R3 fill through all the colors in the
colors list. For more information on pattern rotation, see “Understanding Pattern
Sequences” on page 182.
With... Use...
Note: If you specify a fill that is inappropriate for the type of graph you are
generating (for example, if you specify VALUE=L1 in a PATTERN statement for a
choropleth map), SAS/GRAPH ignores the PATTERN statement and continues
searching for a valid pattern. If it does not find a definition with a valid fill
specification, it uses default patterns instead. 4
3 With a PATTERN statement that only specifies a color (COLOR=), the COLOR=
option overrides the CPATTERN= color, but CPATTERN= causes the fill to be
SAS/GRAPH Statements Specifying Device-Dependent Hardware Patterns 181
hatched, not the default SOLID. For example, these statements produce one red,
hatched pattern:
goptions cpattern=green;
pattern1 color=red;
GDDM Drivers
GDDM drivers include several sets of hardware patterns. These patterns include both
predefined and user-defined (device-dependent) fill patterns. When you use a hardware
pattern with a GDDM driver, specify the name of the device-dependent pattern set you
want the driver to use. This name will be stored in the GPROLOG string in the device
entry for the driver. Specify the name of the pattern set in either of these ways:
3 Use the GPROLOG= graphics option to assign the pattern set name to the
GPROLOG string.
3 Enter the pattern set name in the Gprolog window of the device entry for the
GDDM device driver.
If you do not specify a pattern set name, the device uses a predefined pattern.
Values for nnn for predefined patterns are 1 through 16. Values for nnn for
device-dependent patterns are 65 through 128.
Information regarding both types of fill patterns can be found in GDDM Application
Programming Guide. For additional information on specifying hardware patterns with
GDDM drivers, see also the GDDM Base Programming Reference.
HPLJxxxx Drivers
HPLJxxxx drivers for the HP LaserJet support the predefined shading levels and
predefined fill patterns for rectangle fill only. These patterns are documented in the
appropriate HP LaserJet technical manual. Values for nnn for shading levels are 001
through 008. Values for fill patterns are 009 through 014.
Metagraphics Drivers
Metagraphics drivers can use the hardware patterns supported by the device for
which they are written. When you specify hardware patterns for a metagraphics driver,
values of nnn can range from 0 through 999.
182 Understanding Pattern Sequences Chapter 7
Here, PATTERN1 generates the first PATTERN definition. PATTERN2 omits COLOR=,
so the specified fill is rotated through all three colors in the colors list before the
PATTERN3 statement is used. This table shows the color and fill of the PATTERN
definitions that would be generated if nine patterns were required:
Definition Characteristics:
Number Source Color Fill
1 PATTERN1 red x3
2 PATTERN2 blue r3
3 PATTERN2 red r3
4 PATTERN2 green r3
5 PATTERN3 blue l3
Notice that after all the PATTERN statements are exhausted, the procedure begins
using the default bar and block patterns, beginning with SOLID. Each fill from the
default list is rotated through all three colors in the colors list before the next default
fill is used.
SAS/GRAPH Statements SYMBOL Statement 183
Here, PATTERN1 is used twice and PATTERN2 cycles through the list of three colors
and then repeats this cycle a second time:
3 PATTERN2 red x1
4 PATTERN2 blue x1
5 PATTERN2 green x1
6 PATTERN2 red x1
7 PATTERN2 blue x1
8 PATTERN2 green x1
SYMBOL Statement
The SYMBOL statement defines the characteristics of symbols that display the data
plotted by a PLOT statement used by PROC GBARLINE, PROC GCONTOUR, and
PROC GPLOT.
Used by:
GBARLINE, GCONTOUR, GPLOT procedures
Global
Assigned by default
Description
SYMBOL statements create SYMBOL definitions, which are used by the GPLOT and
GCONTOUR procedures. For the GPLOT procedure, SYMBOL definitions control
3 the appearance of plot symbols and plot lines, including bars, boxes, confidence
limit lines, and area fills
3 interpolation methods
3 how plots handle data out of range.
For the GCONTOUR procedure, SYMBOL definitions control
3 the appearance and text of contour labels
3 the appearance of contour lines.
184 SYMBOL Statement Chapter 7
If you create SYMBOL definitions, they are automatically applied to a graph by the
procedure. If you do not create SYMBOL definitions, these procedures generate default
definitions and apply them as needed to your plots.
Syntax
SYMBOL<1...255>
<COLOR=symbol-color>
<MODE=EXCLUDE | INCLUDE>
<REPEAT=number-of-times>
<STEP=distance<units>>
<appearance-option(s)>
<interpolation-option>
<SINGULAR=n>;
appearance-options can be one or more of these:
BWIDTH=box-width
CI=line-color
CO=color
CV=value-color
FONT=font
HEIGHT=symbol-height<units>
LINE=line-type
POINTLABEL<=(label-description(s)) | NONE>
VALUE=special-symbol | text-string | NONE
WIDTH=thickness-factor
interpolation-option can be one of these:
3 general methods
INTERPOL=JOIN
INTERPOL=map/plot-pattern
INTERPOL=NEEDLE
INTERPOL=NONE
INTERPOL=STEP<placement><J><S>
3 high-low interpolation methods
INTERPOL=BOX<option(s)><00...25>
INTERPOL=HILO<C><option(s)>
INTERPOL=STD<1 | 2 | 3><variance><option(s)>
3 regression interpolation methods
INTERPOL=R<type><0><CLM | CLI<50...99>>
3 spline interpolation methods
INTERPOL=L<degree><P><S>
INTERPOL=SM<nn><P><S>
INTERPOL=SPLINE<P><S>
Options
When the syntax of an option includes units, use one of these:
CELLS character cells
SAS/GRAPH Statements SYMBOL Statement 185
CM centimeters
IN inches
PCT percentage of the graphics output area
PT points.
If you omit units, a unit specification is searched for in this order:
1 the GUNIT= option in a GOPTIONS statement
2 the default unit, CELLS.
BWIDTH=box-width
specifies the width of the box generated by either the INTERPOL=BOX or
INTERPOL=HILOB option. Box-width can be any number greater than 0. By
default, the value of box-width is the same as the value of the WIDTH= option,
whose default value is 1. Therefore, if you specify a value for WIDTH= and omit
BWDITH=, the width of the box changes accordingly.
Featured in: “Example 4. Creating and Modifying Box Plots” on page 233.
CI=line-color
specifies a color for an interpolation line (GPLOT) or a contour line (GCONTOUR).
If you omit CI= but specify CV=, CI= assumes the value of CV=. In this case, CI=
and CV= specify the same color, which is the same as specifying COLOR= alone.
If you omit CI=, the color specification is searched for in this order:
1 the CV= option
2 the COLOR= option
3 the CSYMBOL= option in a GOPTIONS statement
4 each color in the colors list sequentially before the next SYMBOL definition is
used.
See also: “Using Color” on page 206
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226
CO=color
specifies a color for
3 outlines of filled areas generated by the INTERPOL=map/plot-pattern option
3 confidence limit lines generated by the INTERPOL=R series option
3 staffs, boxes, and bars generated by the high-low interpolation methods:
INTERPOL=HILO, INTERPOL=BOX, and INTERPOL=STD.
If you omit the CO= option, the search order for a color specification depends on
the interpolation method being used.
See also: “Using Color” on page 206
Featured in: “Example 5. Filling the Area between Plot Lines” on page 236 and
“Example 4. Creating and Modifying Box Plots” on page 233.
COLOR=symbol-color
C=symbol-color
specifies a color for the entire definition, unless it is followed by a more explicit
specification. For the GPLOT procedure, this includes plot symbols, the plot line,
confidence limit lines, and outlines. For the GCONTOUR procedure, this includes
contour lines and labels.
Using the COLOR= option is exactly the same as specifying the same color for
both the CI= and CV= options.
186 SYMBOL Statement Chapter 7
If COLOR= precedes CI= or CV= in the same statement, CI= or CV= is used
instead.
If you do not use COLOR= or CI=, CV=, and CO=, the color specification is
searched for in this order:
1 the CSYMBOL= option in a GOPTIONS statement
2 each color in the colors list sequentially before the next SYMBOL definition is
used.
If you do not use a SYMBOL statement to specify a color for each symbol, but
you do specify a colors list in a GOPTIONS statement, then Java and ActiveX
assign colors to symbols differently than does the SAS server. To ensure
consistency on all devices, you should specify the desired color of each symbol. The
SAS server restarts at the first color in the colors list and rotates through all of
the colors in the color list for the first default symbol before going to the next
symbol in the default symbol list where it again rotates through all of the colors in
the color list before picking up the next symbol.
Note: Neither the Java applet nor the ActiveX control supports using COLOR=
with PROC GCONTOUR. 4
See also: “Using Color” on page 206
Not supported by: Java (partial), ActiveX (partial)
CV=value-color
specifies a color for
3 plot symbols in the GPLOT procedure
3 the filled areas generated by the INTERPOL=map/plot-pattern option
3 contour labels in the GCONTOUR procedure.
If you omit CV= but specify CI=, CV= assumes the value of CI=. In this case,
CV= and CI= specify the same color, which is the same as specifying COLOR=
alone.
If you omit CV=, the color specification is searched for in this order:
1 the CI= option
2 the COLOR= option
3 the CSYMBOL= option in a GOPTIONS statement
4 each color in the colors list sequentially before the next SYMBOL definition is
used.
Note: Neither the Java applet nor the ActiveX control supports using CV= with
PROC GCONTOUR. 4
See also: “Using Color” on page 206
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226, “Example 5. Filling the Area between Plot Lines” on page 236, and
“Example 4. Creating and Modifying Box Plots” on page 233.
Not supported by: Java (partial), ActiveX (partial)
FONT=font
F=font
specifies the font for the plot symbol (GPLOT) or contour-label text (GCONTOUR)
specified by VALUE=. The font specification can be
3 the name of a software font. For example, FONT=MARKER specifies a
software font that is stored in the catalog SASHELP.FONTS.
3 a hardware font specification of the form HWxxxnnn or hardware-font-name:
HWxxxnnn
SAS/GRAPH Statements SYMBOL Statement 187
HW identifies the font as a hardware font, xxx are the last two or three
characters of the module name as listed in the Module field in the device
entry’s Detail window, and nnn is the Chartype number of the hardware
font as listed in the device entry’s Chartype window (for example,
FONT=HWDMX001).
hardware-font-name
specifies the name of a hardware font as shown in the device entry’s
Chartype window (for example, FONT="Palatino-Italic"). The name
must be enclosed in double quotation marks.
By default, no font is specified. The symbol specified by VALUE= is taken from
the special symbol table shown in Figure 7.21 on page 202. To use symbols from
the special symbol table, omit FONT=.
You can use FONT= to specify a symbol font, such as Marker, that contains a
symbol that you want to use in your plot. In this case, the string specified by
VALUE= is the character code for the symbol. For example, this definition
specifies a heart:
symbol font=marker value=N;
You can also use FONT= to specify a text font, such as Swiss. In this case, the
string specified by VALUE= appears in the plot:
symbol font=swiss value=star;
See also: the VALUE= on page 199 option , “Specifying Plot Symbols” on page
205, and Chapter 5, “SAS/GRAPH Fonts,” on page 75.
Featured in: Example 2 on page 906
Not supported by: Java, ActiveX
HEIGHT=symbol-height<units>
H=symbol-height<units>
specifies the height in number of units of plot symbols (GPLOT) or contour labels
(GCONTOUR).
Note: HEIGHT= affects only the height of the symbols and labels on the plot;
it does not affect the height of any symbols that may appear in a legend.
The HEIGHT option overrides the MarkerSize attribute in graph styles. For
more information on graph styles, see SAS Output Delivery System: User’s
Guide. 4
Note: With client-side rendering using Java, the minimum height is 2 pixels;
with ActiveX a symbol may be so small as to be invisible.
Neither the Java applet nor the ActiveX control supports HEIGHT= with PROC
GCONTOUR. 4
See also: the option SHAPE= on page 156 in the LEGEND statement
Featured in: “Example 4. Creating and Modifying Box Plots” on page 233,
“Example 3. Rotating Plot Symbols through the Colors List” on page 231, and
Example 2 on page 906.
Not supported by: Java (partial), ActiveX (partial)
INTERPOL=BOX<option(s)><00...25>
I=BOX<option(s)><00...25>
188 SYMBOL Statement Chapter 7
produces box and whisker plots. The bottom and top edges of the box are located
at the sample 25th and 75th percentiles. The center horizontal line is drawn at
the 50th percentile (median). By default, INTERPOL=BOX, in which case the
vertical lines, or whiskers, are drawn from the box to the most extreme point
within 1.5 interquartile ranges. (An interquartile range is the distance between
the 25th and the 75th sample percentiles.) Any value more extreme than this is
marked with a plot symbol.
Values for option(s) are one or more of these:
F fills the box with the color specified by CV= and outlines the
box with the color specified by CO=
J joins the median points of the boxes with a line
T draws tops and bottoms on the whiskers.
In addition, you can specify a percentile to control the length of the whiskers
within the range 00 through 25. These are examples of percentile specifications
and their effect:
00 high/low extremes. INTERPOL=BOX00 is not the same as the
default, INTERPOL=BOX.
01 1st percentile low, 99th high
05 5th percentile low, 95th high
10 10th percentile low, 90th high
25 25th percentile low, 75th high; since the box extends from the
25th to the 75th percentile, no whiskers are produced.
Figure 7.15 on page 188 shows the type of plot INTERPOL=BOX produces.
Y
50
40
30
20
10
0
A B C
X
To increase the width of the box itself, use the BWIDTH= option. By default the
value of BWIDTH= is the same as the value of WIDTH=. Therefore, if you specify
a value for WIDTH= and omit BWIDTH=, the width of the box changes.
For a scatter effect with the box, use a multiple plot request, as in this example:
symbol1 i=none v=star color=green;
symbol2 i=box v=none color=blue;
proc gplot data=test;
plot (y y)*x / overlay;
This option cannot be used in a symbol definition that is named in the GPLOT
procedure, when that procedure is generating output for the Web using a Java
device driver. This applies only when the PLOT statement is used with the
OVERLAY option, or when the PLOT2 statement is used, with or without the
OVERLAY option.
Featured in: “Example 4. Creating and Modifying Box Plots” on page 233.
Not supported by: Java (partial)
INTERPOL=HILO<C><option>
I=HILO<C><option>
specifies that a solid vertical line connect the minimum and maximum Y values for
each X value. The data should have at least two values of Y for every value of X;
otherwise, the single value is displayed without the vertical line.
By default, for each X value, the mean Y value is marked with a tick. This is
shown in Figure 7.16 on page 190.
To specify high, low, close stock market data, include this option:
C draws tick marks at the close value instead of at the mean
value. Specifying C assumes that there are three values of Y
(HIGH, LOW, and CLOSE) for every value of X. If more or
fewer than three Y values are specified, the mean is ticked.
The Y values can be in any order in the input data set.
In addition, you can specify one of these values for option:
B connects the minimum and maximum Y values with bars
instead of lines. Use the BWIDTH= option to increase the
width of the bars.
J joins the mean values or the close values (if HILOC is
specified) with a line. This point is not marked with a tick
mark. You cannot use the PLOT statement option AREAS=
with INTERPOL=HILOJ.
T adds tops and bottoms to each line.
BJ connects maximum and minimum values with a bar and joins
the mean or close values.
TJ adds tops and bottoms to the lines and joins the mean or close
values.
Figure 7.16 on page 190 shows the type of plot INTERPOL=HILO produces.
Plot symbols in the form of dots have been added to this figure.
190 SYMBOL Statement Chapter 7
Y
50
40
30
20
10
0
A B C
X
values of the horizontal variable are not strictly increasing, the corresponding
parametric method (L1P, L3P, or L5P) is used.
Specifying INTERPOL=L1P, INTERPOL=L3P, or INTERPOL=L5P results in a
parametric Lagrange interpolation of degree 1, 3, or 5, respectively. Both the
horizontal and vertical variables are processed with the Lagrange method and a
parametric interpolation of degree 1, 3, or 5, using the distance between points as
a parameter.
INTERPOL=map/plot-pattern
I=map/plot-pattern
specifies that a pattern fill the polygon that has been defined by the data points.
Values for map/plot-pattern are
MEMPTY
ME
an empty pattern. EMPTY and E are valid aliases.
The Java applet does not support this option.
MSOLID
MS
a solid pattern. SOLID and S are valid aliases
Mdensity<style<angle>>
a shaded pattern. (The Java applet does not support this option.)
Density specifies the density of the pattern’s shading:
1...5 1 produces the lightest shading and 5 produces the
heaviest.
Style specifies the direction of pattern lines:
N parallel lines (the default)
X crosshatched lines.
Angle specifies the starting angle for parallel or crosshatched lines:
0...360 the degree at which the parallel lines are drawn. By
default, angle is 0 (lines are parallel to the horizontal
axis).
The INTERPOL=map/plot-pattern option only works if the data are structured
so that the data points and, consequently, the plot lines form an enclosed area.
The plot lines should not cross each other.
See also: the “PATTERN Statement” on page 169
Featured in: “Example 5. Filling the Area between Plot Lines” on page 236
Not supported by: Java (partial)
INTERPOL=NEEDLE
I=NEEDLE
draws a vertical line from each data point to a horizontal line at the 0 value on the
vertical axis or the minimum value on the vertical axis if it is greater than 0. The
horizontal line is drawn automatically.
Figure 7.17 on page 192 shows the type of plot INTERPOL=NEEDLE produces.
Plot symbols are not displayed in this figure.
192 SYMBOL Statement Chapter 7
Y
20
10
10
20
1 2 3 4 5 6
X
Y
30
*
20 *
** * *
*
** * *
10 * *
* ***
0 *
* Reinsch, C.H. (1967), “Smoothing by Spline Functions,” Numerische Mathematik, 10, 177–183.
194 SYMBOL Statement Chapter 7
t = (x2 + y2)
If two points are so close together that the computations
overflow, the second point is not used.
S sorts a data set by the independent variable before plotting its
data.
Note: When points on the graph are out of range of the axis values, the curve is
clipped. If an end point is out of range, no curve is drawn. Out-of-range conditions
may be caused by restricting the range of axis values with the HAXIS= or VAXIS=
option in the PLOT statement or the ORDER= option in an AXIS definition.
Note: When points on the graph are close together and a spline interpolation is
used, the Java applet is unable to draw some line types correctly. 4
4
INTERPOL=STD<1 | 2 | 3><variance><option(s)>
I=STD<1 | 2 | 3><variance><option(s)>
specifies that a solid line connect the mean Y value with ± 1, 2, or 3 standard
deviations for each X.
Note: By default, 2 standard deviations are used. 4
** Pizer, Stephen M. (1975), Numerical Computing and Mathematical Analysis, Chicago: Science Research Associates, Inc.,
Chapter 4.
SAS/GRAPH Statements SYMBOL Statement 195
The sample variance is computed about each mean, and from it, the standard
deviation sy is computed. Variance can be one or both of these:
M computes sy ,
P computes sample variances using a pooled estimate, as in a
one-way ANOVA model.
In addition, specify one of these values for option(s):
B connects the minimum and maximum Y values with bars
instead of lines.
J connects the means from bar to bar with a line.
T adds tops and bottoms to each line.
BJ connects maximum and minimum values with a bar and joins
the mean values.
TJ adds tops and bottoms to the lines and joins the mean values.
Figure 7.19 on page 195 shows the type of plot INTERPOL=STD produces. A
horizontal tick is drawn at the mean. Plot symbols in the form of dots have been
added to this figure.
Y
60
50 ●
●
40 ●
● ●
●
30 ●
●
●
● ●
20 ●
10
0
A B C
X
Note: By default, the vertical axis ranges from the minimum to the maximum
Y value in the data. If the requested number of standard deviations from the
mean covers a range of values that exceeds the maximum or is less than the
minimum, the STD lines are cut off at the minimum and maximum Y values.
When this cutoff occurs, rescale the axis using VAXIS= in the PLOT statement or
ORDER= in an AXIS definition so that the STD lines are shown. 4
If you restrict the range of axis values by using HAXIS= or VAXIS= in a PLOT
statement or ORDER= in an AXIS definition, by default any observations that fall
outside the axis range are excluded from the interpolation calculation. See the
MODE= on page 197 option.
To increase the thickness of all lines generated by the INTERPOL=STD option,
use the WIDTH= option.
You cannot use the PLOT statement option AREAS= with INTERPOL=STD.
This option cannot be used in a symbol definition that is named in the GPLOT
procedure, when that procedure is generating output for the Web using a Java
device driver. This applies only when the PLOT statement is used with the
196 SYMBOL Statement Chapter 7
OVERLAY option, or when the PLOT2 statement is used, with or without the
OVERLAY option.
Not supported by: Java (partial)
INTERPOL=STEP<placement><J><S>
I=STEP<placement><J><S>
specifies that the data are plotted with a step function. By default, the data point
is on the left of the step, the steps are not joined with a vertical line, and the data
are not sorted before processing.
Specify one of these values for placement:
L displays the data point on the left of the step.
R displays the data point on the right of the step.
C displays the data point in the center of the step.
Note: When a step is retraced in order to locate its center
point, both the server and Java treat this as effectively not
drawing that part of the step at all. ActiveX, however, draws
each part of the step—resulting in a somewhat differently
appearing graph. 4
In addition, specify one or both of these:
J produces steps joined with a vertical line.
S sorts unordered data by the independent variable before
plotting.
Figure 7.20 on page 196 shows the type of plot INTERPOL=STEPJR produces.
Plot symbols in the form of dots have been added to this figure.
Y
100 ●
●
75
50 ●
25 ●
●
0 ● ●
1 2 3 4 5 6 7
X
LINE=line-type
L=line-type
specifies the line type of the plot line in the GPLOT procedure, or the contour line
in the GCONTOUR procedure:
1 a solid line.
2...46 a dashed line.
Line types are shown in Figure 7.22 on page 208. By default, LINE=1.
Note: This option overrides the LineStyle attribute in graph styles. For more
information on graph styles, see SAS Output Delivery System: User’s Guide.
SAS/GRAPH Statements SYMBOL Statement 197
Neither the Java applet nor ActiveX control supports client-side rendering for
GCONTOUR. 4
Not supported by: Java (partial), ActiveX (partial)
MODE=EXCLUDE | INCLUDE
specifies that interpolation calculations exclude or include data values that are
outside the range of plot axes. By default, MODE=EXCLUDE, which excludes
values outside the axis range from any calculations.
If you control the range of values displayed on an axis by using HAXIS= and
VAXIS= in the GPLOT procedure, or ORDER= in an AXIS definition, any data
points that lie outside of the range of the axes are discarded before the
calculations are done for interpolation lines. This has a particularly noticeable
effect on the high-low interpolation methods, which include INTERPOL=HILO,
INTERPOL=BOX, and INTERPOL=STD. Regression analysis also represents only
part of the original data.
See also: “Values Out of Range” on page 1087.
POINTLABEL<=(label-description(s)) | NONE>
labels plot points. The labels always use the format that is assigned to the
variable(s) whose values are used for the labels. POINTLABEL without any
specified descriptions labels points with the Y value. NONE suppresses the point
labels. Label-description(s) can be used to change the variable whose values are
used to label points, and/or to change features of the label text, such as the color,
font, or size of the text.
Note: If you do not specify a color on a SYMBOL statement, the symbol
definition is rotated through the colors list before the next SYMBOL statement is
used. Thus, if your plot contains multiple plot lines and you want to limit your
POINTLABEL specification to a single line, you must specify a color on the
SYMBOL statement that contains the POINTLABEL description. 4
Label-description(s) can be one or more of these:
COLOR=text-color
C=text-color
specifies the color of the label text. The default is the first color from the
colors list.
FONT=font | NONE
F=font | NONE
specifies the font for the text. See Chapter 5, “SAS/GRAPH Fonts,” on page
75 for details on specifying font. If you omit FONT=, a font specification is
searched for in this order:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font, NONE.
HEIGHT=text-height <units >
H=text-height <units >
specifies the height of the text characters in number of units. By default,
HEIGHT=1 CELL. If you omit HEIGHT=, a text height specification is
searched for in this order:
1 the HTEXT= option in a GOPTIONS statement
2 the default value, 1.
JUSTIFY=CENTER | LEFT | RIGHT
J=C | L | R
specifies the horizontal alignment of the label text. The default is CENTER.
The location of the point label is relative to the location of the corresponding
data point.
198 SYMBOL Statement Chapter 7
Alternatively, you can label the plot points with the values of the X and Y
variables, in either order. The order that you specify X and Y in the variable
specification determines the order that the values are displayed in the label.
The following option specifies variables HEIGHT and WEIGHT; in the label,
the value for HEIGHT will be displayed, followed by the value for WEIGHT:
POINTLABEL=("#height:#weight")
The variables that you specify must be the plot’s X and Y variables.
Specifying any other variables will cause unexpected labeling.
By default when you specify both the X and Y variables, a colon (:) displays
in the label to separate the values in each label. To change the character that
displays as the delimiter, use the $ syntax to specify an alternative character.
The following option specifies a vertical bar (|) as the delimiter in the label:
POINTLABEL=("#height:#weight $|")
The $ syntax must be within the same quotation marks as the variable
specification. The $ specification can precede or follow the variable
specification, but it must be separated from the variable specification by at
least one space.
Note: Specifying a delimiting character with the $ only changes the
character that displays in the label. It does not change the syntax of the
variable specification, which requires a colon and pound sign (:#) to precede
the second variable. 4
Note: There is a sixteen character length limit for each variable. A
maximum character length limit of thirty-three characters is possible. This
can be composed of X and Y variables, any other valid data set variable, and
a separator as required. 4
Specify as many label-description suboptions as you want. Enclose them all
within a single set of parentheses, and separate each suboption from the others by
at least one space.
Not supported by: Java (partial), ActiveX (partial)
REPEAT=number-of-times
R=number-of-times
SAS/GRAPH Statements SYMBOL Statement 199
specifies the number of times that a SYMBOL definition is applied before the next
SYMBOL definition is used. By default, REPEAT=1.
The behavior of REPEAT= depends on whether any of the SYMBOL color options
(CI=, CV=, CO=, and COLOR=) or the CSYMBOL= graphics option also is used:
3 If any SYMBOL color option also is used in the SYMBOL definition, that
SYMBOL definition is repeated the specified number of times in the specified
color.
3 If no SYMBOL color option is used but the CSYMBOL= graphics option is
currently in effect, the SYMBOL definition is repeated the specified number
of times in the specified color.
3 If no SYMBOL statement color options are used and the CSYMBOL=
graphics option is not used, the SYMBOL definition is cycled through each
color in the colors list, and then the entire group generated by this cycle
repeats the number of times specified by REPEAT=. Thus, the total number
of iterations of the SYMBOL definition depends on the number of colors in
the current colors list.
Neither the Java applet nor ActiveX control supports client-side rendering
for GCONTOUR.
See also: “Using the SYMBOL Statement” on page 202.
Not supported by: Java (partial), ActiveX (partial)
SINGULAR=n
tunes the algorithm used to check for singularities. The default value is machine
dependent but is approximately 1E-7 on most machines. This option is rarely
needed.
STEP=distance<units>
specifies the minimum distance between labels on contour lines. The value of
distance must be greater than zero. By default, STEP=65PCT.
Note: If you specify units of PCT or CELLS, STEP= calculates the distance
between the labels based on the width of the graphics output area, not the height.
For example, if you specify STEP=50PCT and if the graphics output area is 9
inches wide, the distance specified is 4.5 inches. A value less than 10 percent is
ignored and 10 percent is used instead. 4
When you use STEP=, specify the minimum distance that you want between
labels. The option then calculates how many labels it can fit on the contour line,
taking into account the length of the labels and the minimum distance you
specified. Once it has calculated how many labels it can fit while retaining the
minimum distance between them, it places the labels, evenly spaced, along the
line. Consequently, the space between labels may be greater than what you
specify, although it will never be less.
In general, to increase the number of labels from the default, reduce the value
of distance.
If the procedure cannot write the label at a particular location on the contour,
for example because the contour line makes a sharp turn, the label may be placed
farther along the line or omitted. If labels are omitted, a note appears in the log.
Specifying a low value for the GCONTOUR procedure’s TOLANGLE= option may
also cause labels to be omitted, since this forces the procedure to select smoother
labeling locations, which may not be available on some contours.
Featured in: Example 2 on page 906.
Not supported by: Java, ActiveX
VALUE=special-symbol | text-string | NONE
V=special-symbol | text-string | NONE
200 SYMBOL Statement Chapter 7
3 specifies a plot symbol for the data points (GPLOT and GBARLINE). If you
omit the SYMBOL statement, plot points are generated using the default plot
symbol. The default symbol is a square if you use the ActiveX or Java devices
and a PLUS sign for other devices. If you specify a SYMBOL statement, but
do not specify the VALUE= option, plot symbols are suppressed.
Note: For ActiveX output, the VALUE= option is not supported when
INTERPOL=HILO or INTERPOL=STD. You can use the OVERLAY option
with GPLOT to get symbols to appear on the data points. 4
3 specifies contour-label text in a contour plot (GCONTOUR). By default with
the AUTOLABEL option, GCONTOUR labels contour lines with the contour
variable’s value at that contour level.
3 VALUE=NONE suppresses plot symbols at the data points, or labels on the
contour lines. You can set the VALUE=NONE option independent of the
INTERPOL= option.
Values for special-symbol are the names and characters shown in Figure 7.21 on
page 202. The special symbol table can be used only if the FONT= option is not
used or a null value is specified:
font=,
value="’"
Java and ActiveX support the following characters from the marker font for
special-symbol:
Character Aliases
Star
Circle Sphere, Dot, Balloon
Plus Cross
Flag Y
SAS/GRAPH Statements SYMBOL Statement 201
Character Aliases
X
Prism Z
Spade “
Heart #
Diamond $
Club %
Hexagon Paw
Cylinder Hash
Note: If you do not use a SYMBOL statement to specify a color for each
symbol, but you do specify a colors list in a GOPTIONS statement, then Java and
ActiveX assign colors to symbols differently than does the SAS server. To ensure
consistency on all devices, you should specify the desired color of each symbol.The
SAS server restarts at the first color in the colors list and rotates through all of
the colors in the color list for the first default symbol before going to the next
symbol in the default symbol list where it again rotates through all of the colors in
the color list before picking up the next symbol. 4
Note: The VALUE option overrides the MarkerSymbol attribute in graph
styles. For more information on graph styles, see SAS Output Delivery System:
User’s Guide. 4
See also: the option FONT= on page 186 and “Specifying Plot Symbols” on page
205.
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on
page 231, “Example 4. Creating and Modifying Box Plots” on page 233, and
Example 2 on page 906.
Not supported by: Java (partial), ActiveX (partial)
WIDTH=thickness-factor
W=thickness-factor
specifies the thickness of interpolated lines (GPLOT) or contour lines
(GCONTOUR), where thickness-factor is a number. The thickness of the line
increases directly with thickness-factor. By default, WIDTH=1.
WIDTH= also affects all the lines in box plots (INTERPOL=BOX), high-low
plots with bars (INTERPOL=HILOB), and standard deviation plots
(INTERPOL=STD). It also affects the outlines of the area generated by the
AREAS= option in the PLOT statement of the GPLOT procedure.
Note: By default, the value specified by WIDTH= is used as the default value
for the BWIDTH= option. For example, specifying WIDTH=6 also sets BWIDTH=
to 6 unless you explicitly assign a value to BWIDTH=.
Java and ActiveX do not provide the same measure of control for width as SAS/
GRAPH on the server. Measurements are translated to pixels rather than a
percentage. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226 and “Example 4. Creating and Modifying Box Plots” on page 233.
Not supported by: Java (partial) and ActiveX (partial)
202 Using the SYMBOL Statement Chapter 7
Note: The words or special characters in the VALUE= column are entered exactly as
shown. 4
The following statement cancels only HEIGHT= without affecting the rest of the
definition:
symbol4 height=;
Add or change options in the same way. This statement adds an interpolation
method to SYMBOL4:
symbol4 interpol=join;
This statement changes the color of the plot symbol from red to blue:
symbol4 cv=blue;
Canceling one SYMBOL statement does not affect any other SYMBOL definitions. To
cancel all current SYMBOL statements, use RESET= in a GOPTIONS statement:
goptions reset=symbol;
3 specify a default color for all SYMBOL statements using the CSYMBOL= option
on the GOPTIONS statement. This method makes it easy to specify the same color
for each definition when you do not need more explicit color specifications.
3 limit the colors list to a single color using the COLORS= option on the GOPTIONS
statement. This method makes it easy to specify the same color for each definition
when you want the color to apply to other definitions also, such as PATTERN
definitions.
For more information on specifying colors for symbol definitions, see “Using Color” on
page 206.
If you do not use color to limit a SYMBOL statement to a single symbol definition,
SAS/GRAPH generates multiple symbol definitions from that statement by rotating the
current definition through the colors list (for more details, see “Using Generated Symbol
Sequences” on page 208). Because SAS/GRAPH uses symbol definitions in the order
they are generated, this means that the nth symbol definition applied to a graph does
not necessarily correspond to the SYMBOLn statement.
For example, assuming no color is specified on the CSYMBOL= graphics option,
these statements generate four definitions:
goptions colors=(red blue green);
symbol1 value=star;
symbol2 value=square color=yellow;
In this case, if a graph needs only three symbols, the SYMBOL2 definition is not used.
To make the nth applied symbol definition correspond to the SYMBOLn statement,
limit each SYMBOL statement to a single color, using one of the techniques listed at
the beginning of this section.
This example uses color to ensure each SYMBOL statement generates only one
definition. You can omit color specifications to let SAS/GRAPH rotate symbol definitions
through the colors list. For details, see “Using Generated Symbol Sequences” on page
208.
To use plot symbols other than those in Figure 7.21 on page 202, use the FONT=
option to specify a font for the plot symbol. If the font is a symbol font, such as Marker,
the string specified with the VALUE= option is the character code for the symbol to be
displayed. If the font is a text font, the string specified with VALUE= is displayed as
the plot symbol. (See VALUE= on page 199 and FONT= on page 186.)
This table illustrates some of the ways you can define a plot symbol:
Plot
Definition Symbol
symbol1 value=plus;
symbol2 value=+;
symbol5value="’";
proc gplot;
plot y1*x1 y2*x2 y3*x3 / overlay;
run;
Using Color
Generally, there are two ways to explicitly specify color for SYMBOL statements:
3 specify colors on the SYMBOL statements
3 specify a color on the CSYMBOL= graphics option.
You can also let SAS/GRAPH rotate symbol definitions through the colors list. For
details, see “Using Generated Symbol Sequences” on page 208.
The COLOR= option colors the entire symbol or those portions of it not colored by
one of the other color options. If COLOR= precedes CI= or CV=, the CI= or CV=
specification is used instead. If none of the SYMBOL color options is used, color
specifications are searched for in this order:
1 the CSYMBOL= option in a GOPTIONS statement
2 each color in the colors list sequentially before the next SYMBOL definition is used.
CAUTION:
If no color options are used, the SYMBOL definition cycles through each color in the colors
list. 4
SAS/GRAPH Statements Specifying Line Types 207
If the SYMBOL color options and the CSYMBOL= graphics option are not used, the
SYMBOL definition cycles through each color in the colors list before the next definition
is used. For details, see “Using Generated Symbol Sequences” on page 208.
Note: These line types are also used by other statements and procedures. Some
options accept a line type of 0, which produces no line. 4
CSYMBOL= color is not in effect, the specified plot symbol or line type is rotated
through the colors list.
If REPEAT= is also used, the resulting SYMBOL definition is repeated the specified
number of times.
Here, the SYMBOL1 statement generates the first SYMBOL definition. The
SYMBOL2 statement does not include color, so the first default plot symbol is rotated
through all colors in the colors list before the SYMBOL3 statement is used. This table
shows the colors and symbols that would be used if nine symbol definitions were
required for PROC GPLOT:
Sequence Characteristics:
Number Source Color Symbol Interpolation
Sequence Characteristics:
Number Source Color Symbol Interpolation
8 first default color=green first default default
Notice that after the SYMBOL statements are exhausted, the procedure begins using
the default definitions (sequences 6 through 9). Each plot symbol from the default list is
rotated through all colors in the colors list before the next plot symbol is used. Also,
SYMBOL1 does not specify a plot symbol, so the default sequencing provides the first
default symbol (a + sign). When sequencing resumes in sequence number 6, it starts at
the beginning again, selecting the first default plot symbol and rotating it through the
colors list.
If you use REPEAT= but no color, the sequence generated by cycling the definition
through the colors list is repeated the number of times specified by REPEAT=. For
example, these statements define a colors list and illustrate the effect of REPEAT= on
SYMBOL statements both with and without explicit color specifications:
goptions colors=(blue red green);
symbol1 color=gold repeat=2;
symbol2 value=star color=cyan;
symbol3 value=square repeat=2;
Here, SYMBOL1 is used twice, SYMBOL2 is used once, and SYMBOL3 rotates
through the list of three colors and then repeats this cycle a second time:
Sequence Characteristics:
Number Source Color Symbol Interpolation
Description
TITLE, FOOTNOTE, and NOTE statements add text to maps, plots, charts, and text
slides. With these statements you can
3 control the content, appearance, and placement of the text, including color, size,
font, and alignment
3 underline or draw boxes around the text
3 draw straight lines on the output.
Figure 7.23 on page 211 shows the default appearance and placement of titles,
footnotes, and notes on the graphics output area.
Titles are centered at the top of the graphics output in the title area. They are
positioned in numeric order with the lowest-numbered TITLE at the top of the title
area and the highest-numbered TITLE at the bottom of the title area.
TITLE statements have these default characteristics:
3 TITLE1 is twice the height of all other titles and uses the SWISS font.
3 All other TITLE statements are one unit high and use the default hardware font.
Footnotes are positioned similarly in the footnote area at the bottom of the graphics
output area, with the lowest numbered FOOTNOTE at the top of the footnote area.
Unless otherwise specified, they use the default hardware font and are one unit high.
Space for the title area and the footnote area is taken from the procedure output
area. The more titles and footnotes you specify and the bigger they are, the smaller the
procedure output area will be.
Notes are positioned at the top of the procedure output area and are left justified.
The statements appear one below another in the order they appear in the program.
Unless otherwise specified, they use the default hardware font and are one unit high.
For more information on titles, footnotes, and notes in the graphics output area, see
“Placement of Graphic Elements in the Graphics Output Area” on page 39.
212 TITLE, FOOTNOTE, and NOTE Statements Chapter 7
Syntax
TITLE<1...10>< text-argument(s)>;
FOOTNOTE<1...10>< text-argument(s)>;
NOTE< text-arguments(s)>;
Options
When the syntax of an option includes units, use one of these:
CELLS character cells
CM centimeters
IN inches
PT points
PCT percentage of the graphics output area
If you omit units, a unit specification is searched for in this order:
1 the GUNIT= option in a GOPTIONS statement
2 the default unit, CELLS.
SAS/GRAPH Statements TITLE, FOOTNOTE, and NOTE Statements 213
ANGLE=degrees
A=degrees
specifies the angle of the baseline of the entire text string with respect to the
horizontal. A positive degrees value will angle the baseline counterclockwise; a
negative value will angle it clockwise. By default, ANGLE=0 (horizontal).
Angled titles or footnotes may require more vertical space and, consequently,
may increase the size of the title area or the footnote area, thereby reducing the
vertical space in the procedure output area.
Using the BOX= option with angled text does not produce angled boxes; the box
is sized to accommodate the angled note.
Using the ANGLE= option after one text string and before another can reset
some options to their default values. See “Using Options That Can Reset Other
Options” on page 225.
ANGLE= has the same effect on the text as LANGLE=, except when you specify
an angle of 90 degrees or -90 degrees. In these angle specifications, the procedure
output area is shrunk from the left or right to accommodate the angled title or
footnote. The result depends on the statement in which you use the option:
3 With the TITLE statement:
Figure 7.24 on page 213 shows how ANGLE=90 degrees or ANGLE=-90
degrees positions and rotates title text.
ANGLE=90
positions the title at the left edge of the graphics output area, angled 90
degrees (counterclockwise) and centered vertically.
ANGLE=-90
positions the title at the right edge of the graphics output area, angled
-90 degrees (clockwise) and centered vertically.
ANGLE=90
positions the footnote at the right edge of the graphics output area,
angled 90 degrees (counterclockwise) and centered vertically.
214 TITLE, FOOTNOTE, and NOTE Statements Chapter 7
ANGLE=-90
positions the footnote at the left edge of the graphics output area, angled
-90 (clockwise) and centered vertically.
Title
Note with ANGLE=−90
Note with ANGLE=90
Footnote
See also: the options LANGLE= on page 219 and ROTATE= on page 222
Featured in: “Example 6. Enhancing Titles” on page 238
Not supported by: Java, ActiveX
SAS/GRAPH Statements TITLE, FOOTNOTE, and NOTE Statements 215
BCOLOR=background-color
BC=background-color
specifies the background color of a box produced by the BOX= option. If you omit
BOX=, BCOLOR= is ignored. By default, the background color of the box is the
same as the background color for the entire graph. The color of the frame of the
box is determined by the color specification used in BOX=.
BLANK=YES
BL=YES
protects the box and its contents from being overwritten by any subsequent
graphics elements by blanking out the area where the box is displayed. BLANK=
enables you to overlay graphics elements with boxed text. It is ignored if you omit
BOX=. Because titles and footnotes are written from the highest numbered to the
lowest numbered, the BLANK= option only blanks out titles and footnotes of a
lower number.
BOX=1...4
BO=1...4
draws a box around one line of text. A value of 1 produces the thinnest box lines; 4
produces the thickest. Boxing angled text does not produce an angled box; the box
is sized to include the angled text.
The color of the box is either:
3 the color specified by the COLOR= option in the statement
3 the default text color.
COLOR= affects only the frame of the box. To color the background of the box,
use BCOLOR=.
You can include more than one text string in the box as long as no text break
occurs between the strings; that is, you cannot use JUSTIFY= to create multiple
lines of text within a box.
To draw a box around multiple lines of text, you can either
3 Use MOVE= with relative coordinates to position the lines of text where you
want them and enclose them with BOX=. For example, this statement
produces the boxed note shown in Figure 7.27 on page 216:
note font=swiss justify=center box=3
’Office Hours’ move=(40pct,-12pct) ’9-5’;
3 Use the DRAW= option to draw the box and do not use BOX=.
216 TITLE, FOOTNOTE, and NOTE Statements Chapter 7
Figure 7.27 Using the BOX= Option and the MOVE= Option to Box Multiple Lines
of Text
Although BCOLOR= controls the background color of the box, the frame color is
controlled with the COLOR= that precedes BOX=.
If you omit COLOR=, a color specification is searched for in this order:
SAS/GRAPH Statements TITLE, FOOTNOTE, and NOTE Statements 217
The coordinate position (0,0) is the lower-left corner of the graphics output area.
Specify at least two coordinate pairs. Commas between coordinates are optional;
blanks can be used instead. DRAW= does not affect the positioning of text.
The starting point for lines specified with relative coordinates begins at the end
of the most recently drawn text or line in the current statement. If no text or line
has been drawn in the current statement, a warning is issued and the relative
draw is measured from where a zero-length text string would have ended, given
the normal placement for the statement.
You can mix relative and absolute coordinates. For example,
DRAW=(+0,+0,+0,1IN) draws a vertical line from the end of the text to one inch
from the bottom of the graphics output area.
Not supported by: Java, ActiveX
FONT=font
F=font
specifies the font for the subsequent text. See Chapter 5, “SAS/GRAPH Fonts,” on
page 75 for details on specifying SAS/GRAPH fonts. If you omit this option, a font
specification is searched for in this order:
3 for a TITLE1 statement
1 the FTITLE= option in a GOPTIONS statement
2 the FTEXT= option in a GOPTIONS statement
3 the default font, SWISS (COMPLEX in Release 6.06 and earlier).
3 for all other TITLE statements and the FOOTNOTE and NOTE statements:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font, NONE.
Note: Font names greater than eight characters in length must be enclosed in
quotation marks. 4
Note: If the TITLE or FOOTNOTE is being output through an ODS markup
destination and the corresponding NOGTITLE or NOGFOOTNOTE option is
specified, then the bold and italic FONT attributes are on by default. However, if
you specify different attributes with the FONT= option, the bold and italic
attributes are turned off. 4
See also: “Controlling Titles and Footnotes with ODS Output” on page 492
218 TITLE, FOOTNOTE, and NOTE Statements Chapter 7
Note: The Java applet and ActiveX control allow you to control the relative
height of text with the HEIGHT= option, but not the absolute height in terms of
specific units. 4
See also: “Controlling Titles and Footnotes with ODS Output” on page 492
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values”
on page 226 and “Example 6. Enhancing Titles” on page 238.
Not supported by: Java (partial), ActiveX (partial)
JUSTIFY=LEFT | CENTER | RIGHT
J=L | C | R
specifies the alignment of the text string. The default depends on the statement
with which you use JUSTIFY=:
3 for a FOOTNOTE statement the default is CENTER
3 for a NOTE statement the default is LEFT
3 for a TITLE statement the default is CENTER.
All the text strings following JUSTIFY= are treated as a single string and are
displayed as one line that is left-, right-, or center-aligned.
You can change the justification within a single line of text. For example, this
NOTE statement displays a date on the left side of the output and the page
number on the same line on the right:
note ’June 28, 1997’ justify=right ’Page 3’;
You can get the same effect with three TITLE statements, each specifying
JUSTIFY=RIGHT. If you produce a block of text by specifying the same
SAS/GRAPH Statements TITLE, FOOTNOTE, and NOTE Statements 219
justification for multiple text strings, and then change the justification for an
additional text string, that text is placed on the same line as the first string
specified in the statement.
Note: Using JUSTIFY= after one text string and before another can reset some
options to their default values. See “Using Options That Can Reset Other Options”
on page 225 for details. 4
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on
page 231.
LANGLE=degrees
LA=degrees
specifies the angle of the baseline of the entire text string(s) with respect to the
horizontal. A positive value for degrees moves the baseline counterclockwise; a
negative value moves it clockwise. By default, LANGLE=0 (horizontal).
Angled titles or footnotes may require more vertical space and consequently
may increase the size of the title area or the footnote area, thereby reducing the
vertical space in the procedure output area.
Using BOX= with angled text does not produce an angled box; the box is sized
to accommodate the angled note.
Unlike ANGLE=, LANGLE= does not reset any other options. Therefore,
LANGLE= is easier to use because you do not need to repeat options after a text
break.
LANGLE= has the same effect on the text as ANGLE=, except when an angle of
90 degrees or -90 degrees is specified. The result depends on the statement in
which you use the option:
3 With the TITLE statement:
Figure 7.28 on page 219 shows how LANGLE=90 degrees and
LANGLE=-90 degrees positions and rotates titles.
LANGLE=90
angles the title 90 degrees (counterclockwise) so that it reads from
bottom to top. The title is centered horizontally and positioned at the
top of the picture.
LANGLE=-90
angles the title -90 degrees (clockwise) so that it reads from top to
bottom. The title is centered horizontally and positioned at the top of
the picture.
Title Title
Note LANGLE=−90
Note LANGLE=90
Footnote Footnote
Commas between coordinates are optional; you can use blanks instead.
The starting point for lines specified with relative coordinates begins with the
end of the most recently drawn text or line in the current statement. If no text or
line has been drawn in the current statement, a warning is issued and the relative
move is measured from where a zero-length text string would have ended, given
the normal placement for the statement. You can mix relative and absolute
coordinates.
MOVE= overrides a JUSTIFY= specified for the same text string.
If a NOTE, FOOTNOTE, or TITLE statement uses MOVE= to position the text
so that the statement does not use its default position, the text of the next NOTE,
FOOTNOTE, or TITLE statement occupies the unused position and no blank lines
are displayed.
Note: If you specify MOVE= with at least one absolute coordinate and if the
option follows one text string and precedes another, some options can be reset to
their default values. See “Using Options That Can Reset Other Options” on page
225 for details. 4
Featured in: “Example 2. Specifying Logarithmic Axes” on page 229 and
“Example 6. Enhancing Titles” on page 238
222 TITLE, FOOTNOTE, and NOTE Statements Chapter 7
E
T
#BYVALn | #BYVAL(BY-variable-name)
substitutes the current value of the specified BY variable for #BYVAL in the
text string and displays the value in the footnote, note, or title produced by
the statement. Specify the variable with one of these:
n specifies which variable in the BY statement #BYVAL
should use. The value of n indicates the position of the
variable in the BY statement. For example, #BYVAL2
specifies the second variable in the BY statement.
BY-variable- names the BY variable. For example, #BYVAL(YEAR)
name specifies the BY variable, YEAR. Variable-name is not
case sensitive.
Featured in: “Example 7. Using BY-group Processing to Generate a Series of
Charts” on page 240 and “Example 9. Combining Graphs and Reports in a
Web Page” on page 248.
#BYVARn | #BYVAR(BY-variable-name)
substitutes the name of the BY-variable or label associated with the variable
(whatever the BY line would normally display) for #BYVAR in the text string
and displays the name or label in the footnote, note, or title produced by the
statement. Specify the variable with one of these:
n specifies which variable in the BY statement #BYVAR
should use. The value of n indicates the position of the
variable in the BY statement. For example, #BYVAR2
specifies the second variable in the BY statement.
BY-variable- names the BY variable. For example, #BYVAR(SITES)
name specifies the BY variable, SITES. Variable-name is not
case sensitive.
A BY variable name displayed in a title, note, or footnote is always in
uppercase. If a label is used, it appears as specified in the LABEL statement.
For more information , see “Substituting BY Line Values in a Text String”
on page 226 .
UNDERLIN=0...3
U=0...3
underlines subsequent text. Values of 1, 2 and 3 underline with an increasingly
thicker line. UNDERLIN=0 halts underlining for subsequent text.
Underlines follow the text baseline. If you use an LANGLE= or ANGLE= option
for the line of text, the underline is drawn at the same angle as the text.
Underlines do not break up to follow rotated characters. See the option ROTATE=
on page 222.
To make the text and the underline the same color, specify a COLOR= before the
UNDERLIN= that precedes the text string. To make the text a different color,
specify COLOR= after the UNDERLIN=.
Note: UNDERLIN= may be reset by ANGLE= or JUSTIFY=, option, or by the
MOVE= option with absolute coordinates. See “Using Options That Can Reset
Other Options” on page 225 for details.
Note: The Java applet and ActiveX control underline text when UNDERLIN=
is specified, but they do not vary the thickness of the line. 4
4
Featured in: “Example 6. Enhancing Titles” on page 238
Not supported by: Java (partial), ActiveX (partial)
224 Using TITLE and FOOTNOTE Statements Chapter 7
But remember that this will cancel all other existing statements of a higher number.
To cancel all current TITLE or FOOTNOTE statements, use the RESET= graphics
option in a GOPTIONS statement:
goptions reset=footnote;
Setting Defaults
You can set default characteristics for titles (including TITLE1 definitions), footnotes,
and notes by using the following graphics options in a GOPTIONS statement:
CTITLE=color
sets the default color for all titles, footnotes, and notes; overridden by the
COLOR= option in a TITLE, FOOTNOTE, or NOTE statement.
CTEXT=text-color
sets the default color for all text; overridden by CTITLE= for titles, footnotes, and
notes.
FTITLE=title-font
sets the default font for TITLE1 definitions; overridden by FONT= in the TITLE1
statement.
FTEXT=text-font
sets the default font for all text, including the TITLE1 statement if FTITLE= is not
used; overridden by the FONT= option a TITLE, FOOTNOTE, or NOTE statement.
HTITLE=height<units>
sets the default height for TITLE1 definitions; overridden by the HEIGHT= option
in the TITLE1 statement.
HTEXT=n<units>
sets the default height for all text, including the TITLE1 statement if HTITLE= is
not used; overridden by the HEIGHT= option a TITLE, FOOTNOTE, or NOTE
statement.
See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page 261
for a complete description of each option.
string. In order for the first option to affect the second string, repeat the option and
position it after the resetting option and before the text string.
For example, this statement produces a two-line title in which only the first line is
underlined:
title underlin=2 ’Line 1’ justify=left ’Line 2’;
To underline Line 2, repeat UNDERLIN= before the second text string and after
JUSTIFY=:
title underlin=2 ’Line 1’ justify=left
underlin=2 ’Line 2’;
CV=
INTERPOL=
WIDTH=
GOPTIONS statement options:
FTITLE=
GUNIT=
HTEXT=
HTITLE=
Sample library member: GAXTMDV1
This example uses SAS datetime values with an AXIS statement’s ORDER= option to
set the major tick marks on the horizontal axis. It adjusts the position of the first and
last major tick marks.
The example also uses HILOCTJ interpolation in a SYMBOL statement to join
minimum and maximum values. The default unit specification for heights in the graph
are percent of the graphics output area as specified by GUNIT= in the GOPTIONS
statement. The GOPTIONS statement also specifies the default fonts for TITLE1 and
for other text.
Set the graphics environment. GUNIT= specifies the units in percent of the graphics
output area. HTITLE= specifies the height for TITLE1 text. HTEXT= specifies the
height for all other text. FTITLE= specifies SWISSB as the font for TITLE1.
goptions reset=global gunit=pct border
cback=white
colors=(black blue green red)
ftitle=swissb ftext=swiss htitle=6
htext=4;
Create the data set. DOWHLC contains the high, low, and close values of the Dow
Jones Industrial index for each business day for a month.
data dowhlc;
input date date9. high low close;
format date date9.;
datalines;
228 Example 1. Ordering Axis Tick Marks with SAS Datetime Values Chapter 7
Prepare the data for a high-low plot. DOWHLC2 generates three records for each
date, storing each date’s high, low, and close values in variable DOW.
data dowhlc2;
set dowhlc;
drop high low close;
dow=high; output;
dow=low; output;
dow=close; output;
Define titles and footnote. HEIGHT=3 in the FOOTNOTE statement overrides the
height specified by HTEXT= in the GOPTIONS statement.
title1 ’Dow Jones High-Low-Close’;
title2 ’January, 1997’;
footnote height=3 justify=right ’GAXTMDV1
Define characteristics of the horizontal axis. ORDER= uses a SAS date value to set
the major tick marks. OFFSET= moves the first and last tick marks to make room for
the tick mark value. COLOR= makes all axis elements red. MAJOR= and MINOR=
modify the size and color of the major and minor tick marks.
axis1 order=(’30DEC96’d to ’03FEB97’d by week)
offset=(3,3)
color=blue
label=none
major=(height=3 width=2)
minor=(number=6 color=red height=2 width=1)
width=3;
Define characteristics of the vertical axis. LABEL=NONE suppresses the AXIS label.
The COLOR= suboption in MINOR= overrides the COLOR= option.
axis2 color=blue
label=none
major=(height=3)
minor=(number=4 color=red height=1)
offset=(2,2);
Generate the plot and assign AXIS definitions. HAXIS= assigns AXIS1 to the
horizontal axis, and VAXIS= assigns AXIS2 to the vertical axis.
SAS/GRAPH Statements Example 2. Specifying Logarithmic Axes 229
This example illustrates the AXIS statement options LOGBASE= and LOGSTYLE=.
The horizontal axis represents pH level. The vertical axis, which represents the
230 Example 2. Specifying Logarithmic Axes Chapter 7
concentration of the hydroxide ion expressed as moles per liter, is scaled logarithmically.
In addition, this example shows how the TICK= parameter of the VALUE= option
modifies individual tick marks.
The example uses the MOVE= option in a TITLE statement to position the title’s
subscript and superscript text.
Assign the libref and set the graphics environment. GUNIT= specifies units of percent
of the graphics output area. VPOS= specifies a resolution for the vertical axis.
goptions reset=global gunit=pct border cback=white
colors=(black blue green red) vpos=250
ftitle=swissb ftext=swiss htitle=5
htext=3;
Create the data set. CONCENTR contains the pH values and the concentration
amount.
data concentr;
input ph conc;
datalines;
1 1E-1
2 1E-2
...more data lines...
13 1E-13
14 1E-14
;
Define title and footnote. MOVE= positions subscript 3 and superscript +. Each new
position is relative to the last position specified by MOVE=.
title1 ’Relationship of pH to H’
move=(-0,-3) h=4 ’3’
move=(+0,+3) h=5 ’O’
move=(+0,+3) h=4 ’+’
move=(-0,-3) h=5 ’ Concentration’;
footnote j=r ’GAXSPLA1 ’;
Define characteristics for horizontal axis. LABEL= uses the JUSTIFY= suboption to
create a descriptive two-line label that replaces the variable name PH. MINOR=NONE
removes all minor tick marks. LENGTH= uses the units specified by the GUNIT=
graphics option to control the length of the horizontal axis.
axis1 label=(h=4 ’Scale of pH Values’
justify=left color=red
h=3 ’More acid’
justify=right color=blue
’More alkaline’)
minor=none
length=60
width=3;
Define characteristics for vertical axis. LOGBASE=10 scales the vertical axis
logarithmically, using a base of 10. Each major tick mark represents a power of 10.
LOGSTYLE=EXPAND displays minor tick marks in logarithmic progression. LABEL=
uses the ANGLE= suboption to place the label parallel to the vertical axis. VALUE=
displays the major tick mark values as 10 plus an exponent. The HEIGHT= suboption
SAS/GRAPH Statements Example 3. Rotating Plot Symbols through the Colors List 231
for each TICK= specification affects only the text following it. Units of CM override the
default PCT specified by GUNIT=.
axis2 logbase=10
logstyle=expand
color=red
label=(angle=90 h=4 color=black
’Concentration (Moles/Liter)’ )
value=(tick=1 ’10’ height=1.5 ’-14’
tick=2 ’10’ height=1.5 ’-13’
tick=3 ’10’ height=1.5 ’-12’
tick=4 ’10’ height=1.5 ’-11’
tick=5 ’10’ height=1.5 ’-10’
tick=6 ’10’ height=1.5 ’-9’
tick=7 ’10’ height=1.5 ’-8’
tick=8 ’10’ height=1.5 ’-7’
tick=9 ’10’ height=1.5 ’-6’
tick=10 ’10’ height=1.5 ’-5’
tick=11 ’10’ height=1.5 ’-4’
tick=12 ’10’ height=1.5 ’-3’
tick=13 ’10’ height=1.5 ’-2’
tick=14 ’10’ height=1.5 ’-1’)
major=(height=.75 cm)
minor=(color=blue height=.5 cm);
Generate the plot and assign AXIS definitions. AXIS1 modifies the horizontal axis
and AXIS2 modifies the vertical axis.
proc gplot data=concentr;
plot conc*ph / haxis=axis1
vaxis=axis2;
run;
quit;
This example specifies a plot symbol on a SYMBOL statement and rotates the symbol
through the colors list. Temperature values in the data are represented by the same
plot symbol in a different color. The example also shows how default symbol sequencing
provides a default plot symbol if a plot needs more plot symbols than are defined.
The example uses the GOPTIONS statement to specify the colors for the color
rotation. It also uses a LEGEND statement to specify a two-line legend label, and to
align the label with the legend values.
Set the graphics environment. COLORS= specifies the colors list. This list is used by
the SYMBOL statement. HSIZE= and VSIZE= specify the external dimensions of the
graph. Units of IN override the default PCT specified by GUNIT=.
goptions reset=global gunit=pct border cback=white
colors=(black blue green red)
ftext=swissb htitle=4 htext=3
hsize=5in vsize=5in;
Create the data set. BACTERIA contains information about the number and size of
bacterial divisions at various temperatures.
data bacteria;
input temp div mass life @@;
datalines;
10 3 10 1 20 22 46 0 30 23 20 9 40 42 16 16 50 33 20 6
10 1 11 2 20 01 44 2 30 21 31 10 40 41 14 12 50 31 21 7
10 4 14 3 20 13 32 4 30 24 34 9 40 43 22 14 50 34 24 2
...more data lines...
10 3 02 2 20 09 32 5 30 26 32 9 40 39 22 15 50 36 22 5
10 2 05 3 20 07 35 4 30 24 35 15 40 37 25 14 50 24 35 4
10 3 08 1 20 05 38 6 30 23 28 9 40 35 28 16 50 33 28 6
SAS/GRAPH Statements Example 4. Creating and Modifying Box Plots 233
Define title and footnote. JUSTIFY= breaks the title into two lines.
title1 ’Effect of Temperature on the Number’
justify=center ’and Size of Bacterial
Divisions’;
footnote1 h=3 j=r ’GSYRPSC1’;
Define symbol characteristics. HEIGHT= specifies a height for the plot symbols.
VALUE= specifies a dot for the plot symbol. Because no color is specified, the symbol is
rotated through the colors list. Because the plot needs a fifth symbol, the default plus
sign is rotated into the colors list to provide that symbol.
symbol1 height=2
value=dot;
Define legend characteristics. LABEL= specifies text for the legend label. J=L
specifies a new line and left-justifies the second string under the first. POSITION=
aligns the top label line with the first (and in this case only) value row. SHAPE=
specifies a width and height for legend values.
legend1 label=(position=(top left)
’Temperature’ j=l ’(Celsius)’)
shape=symbol(4,2);
This example shows how to create box plots and how to specify SYMBOL definitions
so data outside the box-plot range can be represented with data points. It also shows
how to change a box plot’s percentile range to see if the new range encompasses the
data.
The first plot in the example uses a SYMBOL definition with INTERPOL=BOXT20
to specify a box plot with whisker tops at the 80th percentile and whisker bottoms at
the 20th percentile. Data points that are outside this percentile range are represented
with squares.
As illustrated in the following output, the example then changes the SYMBOL
definition to INTERPOL=BOXT10, which expands the whisker range to the 90th
percentile for tops and the 10th percentile for bottoms. There are no data points outside
the new percentile range.
SAS/GRAPH Statements Example 4. Creating and Modifying Box Plots 235
Create the data set. GRADES contains codes to identify each class section, and the
grades scored by students in each section.
data grades;
input section $ grade @@;
datalines;
A 74 A 89 A 91 A 76 A 87 A 93 A 93 A 96 A 55
B 72 B 72 B 84 B 81 B 97 B 78 B 88 B 90 B 74
C 62 C 74 C 71 C 87 C 68 C 78 C 80 C 85 C 82
;
Define symbol characteristics. INTERPOL=BOXT20 specifies a box plot with tops and
bottoms on its whiskers, and the high and low bounds at the 80th and 20th percentiles.
CO= colors the boxes and whiskers. BWIDTH= affects the width of the boxes. VALUE=
specifies the plot symbol that marks the data points outside the range of the box plot.
CV= colors the plot symbols. HEIGHT= specifies a symbol size.
symbol interpol=boxt20
co=blue
bwidth=6
value=square
cv=red
height=4;
This example shows how to fill the area between two plot lines by concatenating two
data sets into one to form a polygon with the data points. It uses a SYMBOL statement
to specify a pattern to fill the polygon and to determine the color of the area fill and the
outline around the area.
The example plots yearly highs and lows for the Dow Jones Industrial Average. It
separates the dependent variables HIGH and LOW to produce an upper plot line and a
lower plot line. The dependent variable is named VALUE and the independent variable
is named YEAR. When concatenated into one data set, AREA, the data sets form the
polygon.
Set the graphics environment.
goptions reset=global gunit=pct border cback=white
colors=(black blue green red)
ftext=swissb htitle=6 htext=3;
SAS/GRAPH Statements Example 5. Filling the Area between Plot Lines 237
Create the data set. STOCKS contains yearly highs and lows for the Dow Jones
Industrial Average, and the dates of the high and low values each year.
data stocks;
input year @7 hdate date9. @17 high
@26 ldate date9. @36 low;
format hdate ldate date9.;
datalines;
1955 30DEC1955 488.40 17JAN1955 388.20
1956 06APR1956 521.05 23JAN1956 462.35
...more data lines...
1994 31JAN1994 3978.36 04APR1994 3593.35
1995 13DEC1995 5216.47 30JAN1995 3832.08
;
Restructure the data so that it defines a closed area. Create the temporary data sets
HIGH and LOW.
data high(keep=year value)
low(keep=year value);
set stocks;
value=high; output high;
value=low; output low;
run;
Define axis characteristics. ORDER= places the major tick marks at 5-year intervals.
axis1 order=(1955 to 1995 by 5)
label=none
major=(height=2)
minor=(number=4 height=1)
offset=(2,2)
width=3;
axis2 order=(0 to 5500 by 500)
label=none
238 Example 6. Enhancing Titles Chapter 7
major=(height=1.5) offset=(0,0)
minor=(number=1 height=1);
This example illustrates some the ways you can format title text. The same options
can be used to format footnotes. The GOPTIONS statement in the example determines
the font and heights used for the first title line and all remaining text in the display.
GOPTIONS also determines that percentages of the graphics output area are used as
the unit of measure for heights in the graph.
Assign the libref and set the graphics environment. FTITLE= assigns the font that is
used by the TITLE1 statement. FTEXT= assigns the font for all other text. HTITLE=
makes the height of TITLE1 7 percent of the graphics output area, the units defined by
the GUNIT= option. HTEXT= makes the height of all other text 5 percent of the
graphics output area.
goptions reset=global gunit=pct border cback=white
colors=(black blue green red)
ftitle=zapfb ftext=swissb htext=5;
Define title1. TITLE1 uses the default font and height defined in the GOPTIONS
statement.
title1 ’This is TITLE1’;
Define TITLE3. Because TITLE2 is not assigned, the output displays a blank line.
UNDERLIN= underlines both text strings.
title3 underlin=1
’TITLE3 Is’
color=red
’ Underlined’;
Define TITLE5. ANGLE= tilts the line of text clockwise 90 degrees and places it at
the right edge of the output.
title5 color=red
angle=-90
’TITLE5 is Angled -90’;
Define TITLE7. ROTATE= rotates each character in the text string at the specified
angle. HEIGHT= overrides HTEXT= in the GOPTIONS statement.
title7 height=4
color=red
rotate=25
’TITLE7 is Rotated’;
Define TITLE9. BLANK= prevents the boxed title from being overwritten by
TITLE10. The first COLOR= specifies the color of the box border, and BCOLOR=
specifies the color of the box background. The second COLOR= specifies the text color.
title9 color=red
box=3
blank=yes
bcolor=red
color=blue
angle=-25
’TITLE9 is Angled in a Red Box’;
240 Example 7. Using BY-group Processing to Generate a Series of Charts Chapter 7
Define TITLE10. In this statement, BOX= draws a box around the first text string.
BOX= is turned off by the MOVE= that uses absolute coordinates and causes a text
break.
title10 color=red
box=1
bcolor=blue
move=(5,20)
font=script
’TITLE10 is in Script and ’
move=(10,12)
height=3
’is Partially Boxed, Positioned with
Explicit Moves,’
move=(15,8)
’and Overlaid by TITLE9’;
Define footnote.
footnote h=3 justify=right ’GTIENTI1 ’;
Display titles and footnote. All existing titles and footnotes are automatically
displayed by the procedure.
proc gslide;
run;
quit;
Create the data set GRAINLDR. GRAINLDR contains data about grain production in
five countries for 1995 and 1996. The quantities in AMOUNT are in thousands of
metric tons. MEGTONS converts these quantities to millions of metric tons.
data grainldr;
length country $ 3 type $ 5;
input year country $ type $ amount;
megtons=amount/1000;
datalines;
1995 BRZ Wheat 1516
1995 BRZ Rice 11236
1995 BRZ Corn 36276
...more data lines...
1996 USA Wheat 62099
1996 USA Rice 7771
1996 USA Corn 236064
;
Suppress the default BY-line and define a title that includes the BY-value. #BYVAL
inserts the value of the BY variable COUNTRY into the title of each report.
options nobyline;
title1 ’Leading #byval(type) Producers’
j=c ’1995 and 1996’;
footnote1 j=r h=3 ’GBYGMSC1 ’;
pattern1 color=green;
Define the axis characteristics for the response axes. ORDER= specifies the range of
values for the response axes. ANGLE=90 in the LABEL= option rotates the label 90
degrees. All the other options remove axis elements. MAJOR=, MINOR=, and VALUE=
remove the tick marks and values. STYLE=0 removes the line. NOPLANE removes the
3D plane.
axis1 order=(0 to 550 by 100)
label=(angle=90 ’Millions of Metric Tons’)
major=none
minor=none
value=none
style=0
noplane;
Define midpoint axis characteristics. SPLIT= defines the character that causes an
automatic line break in the axis values.
axis2 label=none
split=’ ’;
Sort data according to values of BY variable. The data must be sorted before running
PROC GCHART with the BY statement.
proc sort data=grainldr out=temp;
by type;
run;
Generate the vertical bar charts using a BY statement. The BY statement produces a
chart for each value of SITE. The FORMAT statement assigns the $COUNTRY. format
to the chart variable. Assigning AXIS1 to RAXIS= causes all three charts to have the
same response axis.
proc gchart data=temp (where=(megtons gt 31))
by type;
format country $country.;
vbar3d country / sumvar=megtons
outside=sum
descending
shape=hexagon
width=8
coutline=black
cframe=grayaa
maxis=axis2
raxis=axis1 name=’GBYGMSC1’;
run;
quit;
SAS/GRAPH Statements Example 7. Using BY-group Processing to Generate a Series of Charts 243
Example 8. Creating a Simple Web Page with the ODS HTML Statement
Features:
ODS HTML statement options:
BODY=
PATH=
CLOSE
GOPTIONS statement options:
COLORS=
DEVICE=
TRANSPARENCY
NOBORDER (default)
LEGEND statement options:
ACROSS=
LABEL=
MODE=
ORIGIN=
SHAPE=
WHERE statement
Sample library member: GONCSWB1
246 Example 8. Creating a Simple Web Page with the ODS HTML Statement Chapter 7
This example illustrates the simplest way to use the ODS HTML statement to create
an HTML file and a GIF file that you can display in a Web browser. It generates one
body file that displays one piece of SAS/GRAPH output – a map of average per capita
income for four states.
This example also illustrates default pattern behavior with maps and explicit
placement of the legend on the graph. It shows how the default solid map pattern
rotates through every color in a colors list defined in the GOPTIONS statement. By
default, the outline color is the first color in the list, in this case, BLACK.
And it shows how to use a LEGEND statement to arrange and position a legend so it
fits well with the graph’s layout.
Assign the Web-server path. FILENAME assigns the fileref ODSOUT, which is a
destination for the HTML and GIF files produced by the example program. To assign
that location as the HTML destination for program output, ODSOUT is specified later
in the program on the ODS HTML statement’s PATH= option. ODSOUT must point to
a Web-server location if procedure output is to be viewed on the Web.
filename odsout ’path-to-Web-server-space’;
Close the ODS Listing destination for procedure output, and set the graphics
environment. To conserve system resources, ODS LISTING CLOSE closes the Listing
destination for procedure output. Thus, the graphics output is not displayed in the
GRAPH window, although it is written to the graphics catalog and to the GIF files.
COLORS= on the GOPTIONS statement defines a list of four colors for the graph.
ods listing close;
goptions reset=global gunit=pct cback=white
colors=(black blue green red)
ftext=swiss ftitle=swissb htitle=6 htext=4;
Create the data set INCOME. INCOME contains state codes for four states and the
average income of each state.
SAS/GRAPH Statements Example 8. Creating a Simple Web Page with the ODS HTML Statement 247
data income;
input state income;
datalines;
04 19001
35 17106
40 17744
48 19857
;
Assign graphics options for producing the ODS HTML output. DEVICE=GIF causes
the ODS HTML statement to generate the graphics output as GIF files.
TRANSPARENCY causes the graphics output to use the Web-page background as the
background of the graph. Because the default setting NOBORDER is used, the edge of
the graph is not visible on the Web page.
goptions device=gif transparency noborder;
Open the ODS HTML destination. BODY= names the file for storing HTML output.
PATH= specifies the ODSOUT fileref as the destination for all the HTML and GIF files.
ods html body=’income_body.html’
path=odsout;
Define titles and a footnote for the map. By default, any defined titles and footnotes
are included in the graphics output (GIF file).
title ’1994 Personal Income Per Capita’;
title2 f=swissb ’(Arizona, New Mexico, Texas, and Oklahoma)’;
footnote1 h=3 j=r ’GMAP ’;
Define legend characteristics. ACROSS= defines the number of columns in the legend.
ORIGIN= specifies an exact location for the legend. MODE= allows the legend to share
the output area. LABEL= specifies a legend label and left-justifies it above the legend
values. SHAPE= specifies a size and shape for the legend values.
legend across=2
origin=(10,20)
mode=share
label=(position=top
justify=left
’Average Income’)
shape=bar(4,4);
Generate the prism map. Because the NAME= option is omitted, SAS/GRAPH
assigns the default name GMAP to the GRSEG entry in the graphics catalog. This is
the name that is assigned to the GIF file created by the ODS HTML statement.
proc gmap map=maps.us data=income;
format income dollar6.0;
id state;
prism income / discrete
legend=legend;
run;
quit;
Close the ODS HTML destination, and open the ODS Listing destination. You must
close the HTML destination before you can view the output with a browser. ODS
LISTING opens the Listing destination so that the destination is again available for
displaying output during this SAS session.
248 Example 9. Combining Graphs and Reports in a Web Page Chapter 7
Display 7.5 Browser View of Bar Chart and Quarterly Sales Report
Notice that the chart title is displayed outside the graph as part of the HTML file.
Select the link to Total Department Sales to display the second bar chart, as shown in
the following figure.
250 Example 9. Combining Graphs and Reports in a Web Page Chapter 7
Display 7.6 Browser View of Bar Chart and Department Sales Report
Selecting any link for Department Sales displays the corresponding pie chart as
shown in the following figure.
Because the pie charts are stored in one file, you can easily see all three by scrolling
through the file.
SAS/GRAPH Statements Example 9. Combining Graphs and Reports in a Web Page 251
Additional features include AXIS statements that specify the same length for both
midpoint axes, so that the bar charts are the same width even though they have a
different number of bars.
Assign the Web-server path. FILENAME assigns the fileref ODSOUT, which specifies
a destination for the HTML and GIF files produced by the example program. To assign
that location as the HTML destination for program output, ODSOUT is specified later
in the program on the ODS HTML statement’s PATH= option. ODSOUT must point to
a Web-server location if procedure output is to be viewed on the Web.
filename odsout ’path-to-Web-server-space’;
Close the ODS Listing destination for procedure output, and set the graphics
environment. To conserve system resources, ODS LISTING CLOSE closes the Listing
destination for procedure output. On the GOPTIONS statement, HSIZE= and VSIZE=
set the horizontal and vertical size of the graphics output area. DEVICE=GIF causes
the ODS HTML statement to generate the graphics output as GIF files.
TRANSPARENCY causes the graphics output to use the Web-page background as the
background of the graph. BORDER is used so that the border around the graphics
output area will be compatible with the borders that are created for nongraphics output.
ods listing close;
goptions reset=global gunit=pct border
colors=(blue green red) ctext=black
hsize=5in vsize=5in ftitle=zapfb
ftext=swiss htitle=6 htext=4
device=gif transparency;
Create the data set TOTALS. The data set contains quarterly sales data for three
manufacturing sites for one year.
data totals;
length dept $ 7 site $ 8;
input dept site quarter sales;
datalines;
Parts Sydney 1 4043.97
Parts Atlanta 1 6225.26
Parts Paris 1 3543.97
Repairs Sydney 1 5592.82
Repairs Atlanta 1 9210.21
Repairs Paris 1 8591.98
Tools Sydney 1 1775.74
Tools Atlanta 1 2424.19
Tools Paris 1 5914.25
Parts Sydney 2 3723.44
Parts Atlanta 2 11595.07
Parts Paris 2 9558.29
Repairs Sydney 2 5505.31
Repairs Atlanta 2 4589.59
Repairs Paris 2 7538.56
Tools Sydney 2 2945.17
Tools Atlanta 2 1903.99
Tools Paris 2 7868.34
Parts Sydney 3 8437.96
Parts Atlanta 3 6847.91
Parts Paris 3 6789.85
Repairs Sydney 3 4426.46
Repairs Atlanta 3 5011.66
252 Example 9. Combining Graphs and Reports in a Web Page Chapter 7
Open the ODS HTML destination. FRAME= names the HTML file that integrates
the contents and body files. CONTENTS= names the HTML file that contains the table
of contents to the HTML procedure output. BODY= names the file for storing the
HTML output. The contents file links to each of the body files written to the HTML
destination. PATH= specifies the ODSOUT fileref as the HTML destination for all the
HTML and GIF files. NOGTITLE suppresses the graphics titles from the SAS/GRAPH
output and displays them through the HTML page.
ods html frame=’sales_frame.html’
contents=’sales_contents.html’
body=’sales_body1.html’
path=odsout
nogtitle;
Define title and footnote. TITLE1 uses the font and height specified by FTITLE= and
HTITLE= in the GOPTIONS statement.
title1 ’Total Sales By Quarter’;
footnote j=r h=3 ’salesqtr ’;
Define axis characteristics for the first bar chart. In AXIS2, LENGTH= specifies the
length of the midpoint axis.
axis1 order=(0 to 60000 by 20000)
minor=(number=1)
label=none;
axis2 label=none length=70pct
value=(’1Q’ ’2Q’ ’3Q’ ’4Q’);
Suppress the legend label and define the size of the legend values.
legend1 label=none shape=bar(4,4);
Generate the vertical bar chart of quarterly sales. NAME= specifies the name of the
catalog entry. Because the PATH= destination is a file storage location and not a
specific file name, the name SALESQTR.GIF is assigned to the GIF file, matching the
named assigned to the GRSEG on NAME=. DES= specifies the description that is
stored in the graphics catalog and used in the Table of Contents.
proc gchart data=totals;
format sales dollar8.;
vbar3d quarter / discrete
sumvar=sales
shape=cylinder
SAS/GRAPH Statements Example 9. Combining Graphs and Reports in a Web Page 253
subgroup=site
cframe=grayaa
caxis=black
width=12
space=4
legend=legend1
maxis=axis2
raxis=axis1
des=’Total Quarterly Sales’
name=’salesqtr’;
run;
quit;
Sort the data set for the report of quarterly sales. The data must be sorted in order of
the BY variable before running PROC REPORT with BY-group processing.
proc sort data=totals out=qtrsort;
by quarter site;
run;
Reset the footnote and suppress the BY-line. We suppress the by-line because
otherwise #BYVAL inserts the value of the BY variable into the title of each report.
footnote1;
options nobyline;
Generate a report of quarterly sales. Because the HTML body file that references the
GCHART procedure output is still open, the report is stored in that file. The chart and
report are shown in Display 7.5 on page 249.
title1 ’Sales for Quarter #byval(quarter)’;
proc report data=qtrsort nowindows;
by quarter;
column quarter site dept sales;
define quarter / noprint group;
define site / display group;
define dept / display group;
define sales / display sum format=dollar8.;
compute after quarter;
site=’Total’;
endcomp;
break after site / summarize style=rowheader;
break after quarter / summarize style=rowheader;
run;
Open a new body file for the second bar chart and report. Assigning a new body file
closes SALES_BODY1.HTML. The contents and frame files, which remain open, will
contain links to all body files.
ods html body=’sales_body2.html’ path=odsout;
Define axis characteristics. These AXIS statements replace the ones defined earlier.
As before, LENGTH= defines the length of the midpoint axis.
254 Example 9. Combining Graphs and Reports in a Web Page Chapter 7
axis1 label=none
minor=(number=1);
order=(0 to 100000 by 20000)
axis2 label=none length=70pct;
Sort the data set for the report of department sales. The data must be sorted in order
of the BY variable before running PROC REPORT with BY-group processing.
proc sort data=totals out=deptsort;
by dept site;
run;
Reset the footnote, define a report title, and generate the report of department sales.
#BYVAL inserts the value of the BY variable into the title of each report. The chart and
report are shown in Display 7.5 on page 249.
footnote1;
title1 ’Sales for #byval(dept)’;
proc report data=deptsort nowindows;
by dept;
column dept site quarter sales;
define dept / noprint group;
define site / display group;
define quarter / display group;
define sales / display sum format=dollar8.;
compute after dept;
site=’Total’;
endcomp;
break after site / summarize style=rowheader;
break after dept / summarize style=rowheader;
run;
Open a new body file for the pie charts. Assigning a new file as the body file closes
SALES_BODY2.HTML. The contents and frame files remain open. GTITLE displays
the titles in the graph.
ods html body=’sales_body3.html’ gtitle path=odsout;
Sort data set in order of the BY variable before running the GCHART procedure with
BY-group processing.
SAS/GRAPH Statements Example 10. Creating a Bar Chart with Drill-down for the Web 255
Define title and footnote. #BYVAL inserts the value of the BY variable SITE into the
title for each output.
title ’Departmental Sales for #byval(site)’;
footnote j=r h=3 ’salespie ’;
Generate a pie chart for each site. All the procedure output is stored in one body file.
Because BY-group processing generates multiple graphs from one PIE3D statement, the
name assigned by NAME= is incremented to provide a unique name for each piece of
output.
proc gchart data=sitesort;
format sales dollar8.;
by site;
pie3d dept / noheading
coutline=black
sumvar=sales
des=’Department Sales’
name=’salespie’;
run;
quit;
Close the ODS HTML destination, and open the ODS Listing destination.
ods html close;
ods listing;
Example 10. Creating a Bar Chart with Drill-down for the Web
Features:
GOPTIONS statement option:
RESET=
ODS HTML statement options:
BODY=
NOGTITLE
PATH=
Sample library member: GONDDCW1
This example shows you how to create a drill-down graph in which the user can
select an area of the graph in order to display additional information about the data.
The program creates one vertical bar chart of total sales for each site and three reports
that break down the sales figures for each site by department and quarter. The
following figure shows the bar chart of sales.
256 Example 10. Creating a Bar Chart with Drill-down for the Web Chapter 7
Display 7.9 on page 256 shows the PROC REPORT output that appears when you
click on the bar for Atlanta.
For additional information about this program, see “Details” on page 259.
Assign the Web-server path. FILENAME assigns the fileref ODSOUT, which specifies
a destination for the HTML and GIF files produced by the example program. To assign
that location as the HTML destination for program output, ODSOUT is specified later
SAS/GRAPH Statements Example 10. Creating a Bar Chart with Drill-down for the Web 257
in the program on the ODS HTML statement’s PATH= option. ODSOUT must point to
a Web-server location if procedure output is to be viewed on the Web.
filename odsout ’path-to-Web-server-space’;
Close the ODS Listing destination for procedure output, and set the graphics
environment. To conserve system resources, ODS LISTING CLOSE closes the Listing
destination for procedure output. On the GOPTIONS statement, DEVICE=GIF causes
the ODS HTML statement to generate the graphics output as GIF files.
TRANSPARENCY causes the graphics output to use the Web-page background as the
background of the graph.
ods listing close;
goptions reset=global gunit=pct
colors=(black blue green red)
hsize=7 in vsize=5 in ftitle=zapfb
ftext=swiss htitle=6 htext=4
device=gif transparency noborder;
Add the HTML variable to TOTALS and create the NEWTOTAL data set. The HTML
variable SITEDRILL contains the targets for the values of the variable SITE. Each
HREF value specifies the HTML body file and the name of the anchor within the body
file that identifies the target graph.
data newtotal;
set totals;
length sitedrill $40;
if site=’Atlanta’ then
sitedrill=’HREF="report_deptsales.html#IDX1"’;
Open the ODS HTML destination. BODY= names the file for storing HTML output.
PATH= specifies the ODSOUT fileref as the HTML destination for all the HTML and
GIF files. NOGTITLE suppresses the graph titles from the SAS/GRAPH output and
displays them in the HTML.
ods html path=odsout
body=’report_body.html’
nogtitle;
Assign a pattern color for the bars. Each bar in the graph uses the same PATTERN
definition.
pattern color=cyan;
Define axis characteristics. The VBAR3D statement assigns AXIS1 to the response
axis and AXIS2 to the midpoint axis.
axis1 order=(0 to 100000 by 20000)
minor=(number=1)
258 Example 10. Creating a Bar Chart with Drill-down for the Web Chapter 7
label=none;
axis2 label=none offset=(9,9);
Generate the vertical bar chart of total sales for each site. HTML= specifies
SITEDRILL as the variable that contains the name of the target. Specifying HTML=
causes SAS/GRAPH to add an image map to the HTML body file. NAME= specifies the
name of the catalog entry.
proc gchart data=newtotal;
format sales dollar8.;
vbar3d site / discrete
width=15
sumvar=sales
inside=sum
html=sitedrill
coutline=black
cframe=blue
maxis=axis2
raxis=axis1
name=’report3d ’;
run;
quit;
Open the file for the PROC REPORT output. Assigning a new body file closes
REPORT_BODY.HTML.
ods html body=’report_deptsales.html’ path=odsout;
Sort the data set NEWTOTAL. The data must be sorted in order of the BY variable
before running PROC REPORT with BY-group processing.
proc sort data=newtotal;
by site dept quarter;
run;
quit;
Suppress the default BY-line and define a title that includes the BY-value. #BYVAL
inserts the value of the BY variable SITE into the title of each report.
options nobyline;
title1 ’Sales Report for #byval(site)’;
quit;
Close the ODS HTML destination, and open the ODS Listing destination.
ods html close;
ods listing;
Details
This section provides additional information about the pieces of this program and
how they work together to generate SAS/GRAPH output with drill-down functionality.
It describes
3 how an HREF value is built
3 how the HTML= option creates an image map in the HTML file
3 how the HTML file references the SAS/GRAPH output.
The link target is specified by the HTML HREF attribute. The HREF value tells the
Web page where to link to when a user selects the region associated with the value
Atlanta.
For example, clicking on the first bar in the chart links to the target defined by
report_deptsales.html#IDX1. This target is composed of a filename and an anchor.
The file, report_deptsales.html, is generated by the PROC REPORT step. IDX1 is
the anchor that identifies the section of the file that contains the report for the first BY
group, Atlanta.
Because anchor names increment, in order to assign them accurately you must know
how many pieces of output your program generates and in what order. For example,
this table lists in order the pieces of output generated by this example and their default
anchor names:
This option causes SAS/GRAPH to generate in the HTML body file the MAP and
AREA elements that compose the image map. It loads the HREF attribute value from
SITEDRILL into the AREA element. This image map, which is named gqcke00k_map,
is stored in report_body.html (ODS generates unique map names each time you run
the program, so the next time this program runs, the map name will be different):
<MAP NAME="gqcke00k_map">
<AREA SHAPE="POLY"
HREF="report_deptsales.html#IDX3"
COORDS="423,409,423,242,510,242,510,409" >
<AREA SHAPE="POLY"
HREF="report_deptsales.html#IDX2"
COORDS="314,409,314,139,401,139,401,409" >
<AREA SHAPE="POLY"
HREF="report_deptsales.html#IDX1"
COORDS="205,409,205,199,292,199,292,409" >
</MAP>
The AREA element defines the regions within the graph that you can select to link to
other locations. It includes attributes that define the shape of the region (SHAPE=) and
position of the region (COORDS=) as well as the link target (HREF=).
The value assigned to the HREF= attribute is contained in the variable assigned to
HTML=, in this case SITEDRILL.
The IMG element tells the Web page to get the image from the file report3d.gif. It
also tells the Web page to use the image map #report3d_map to define the hot spots of
the bar chart.
See Also
3 For more information on the BY, LABEL, OPTIONS, and WHERE statements in
base SAS software, see SAS Language Reference: Dictionary.
261
CHAPTER
8
Graphics Options and Device
Parameters Dictionary
Introduction 261
Specifying Graphics Options and Device Parameters 261
Specifying Units of Measurement 262
Dictionary of Graphics Options and Device Parameters 262
Introduction
This chapter provides a detailed description of all of the graphics options and device
parameters used with SAS/GRAPH software. These include
3 all graphics options used by the GOPTIONS statement
3 all device parameters that can be specified as options in the ADD and MODIFY
statements in the GDEVICE procedure
3 all device parameters that appear as fields in the GDEVICE windows.
The descriptions provide the syntax, defaults, and required information for each
option and parameter.
The graphics options and device parameters are intermixed and listed alphabetically.
When the graphics option and device parameter have the same name, they are
discussed in the same dictionary entry and the description uses only that name and
does not distinguish between the option and the parameter except where the distinction
is necessary.
For a list of all the graphics options, see “GOPTIONS Statement” on page 146. For a
list of all the device parameters, see “ADD Statement” on page 921.
If the syntax for the graphics option and the device parameter is different, both
forms are shown. If the syntax is the same, one form is shown.
Note: The values that you specify for any option or parameter must be valid for the
device. If you specify a value that exceeds the device’s capabilities, SAS/GRAPH
software reverts to values that can be used with the device. 4
ADMGDF
Specifies whether to write an ADMGDF or GDF file when the GSFNAME= and GSFMODE= graphics
options are used with a GDDM device driver.
Used in: GOPTIONS statement
Default: NOADMGDF
Restriction: GDDM device drivers on IBM mainframe systems only
Syntax
ADMGDF | NOADMGDF
ADMGDF
instructs the GDDM device driver to write out an ADMGDF file.
NOADMGDF
instructs the GDDM device driver to write out a GDF file.
ASPECT
Sets the aspect ratio for graphics elements.
Graphics Options and Device Parameters Dictionary AUTOCOPY 263
Syntax
ASPECT=scaling-factor
scaling-factor
is a nonnegative integer or real number that determines the ratio of width to height
for graphics elements. If you specify ASPECT=1, each graphics element has equal
horizontal and vertical scaling factors; ASPECT=2 scales the graphics element twice
as wide as its height; and so on. If ASPECT= is not specified or is set to 0 or null,
SAS/GRAPH uses the aspect ratio of the hardware device.
Details
The aspect ratio affects many graphics characteristics, such as the shape of software
characters and the roundness of pie charts. Some graphics drivers do not produce
correct output if the aspect ratio is anything other than the default. When you use a
device that uses local scaling (that is, the device itself can scale the output, for example,
some plotters), use ASPECT= to tell SAS/GRAPH the scaling factor. If you change
ASPECT, you can use the GTESTIT procedure to run a sample graphics output to
inspect the effects of the changes.
Note: You may get more reliable results if you use the default aspect ratio and use
the HSIZE= and VSIZE= graphics options to set the dimensions. 4
AUTOCOPY
Specifies whether to generate hardcopy automatically.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Defaults: GOPTIONS: NOAUTOCOPY; GDEVICE: AUTOCOPY=N
Restrictions: device dependent; not supported by Java or ActiveX
Syntax
GOPTIONS: AUTOCOPY | NOAUTOCOPY
GDEVICE: AUTOCOPY=Y | N
AUTOCOPY
AUTOCOPY=Y
prints a copy of the graph automatically.
NOAUTOCOPY
AUTOCOPY=N
264 AUTOFEED Chapter 8
suppresses printing a copy of the graph. A blank Autocopy field in the Parameters
window is the same as AUTOCOPY=N.
Details
AUTOCOPY is used only for older terminals that have printers attached directly to the
device.
AUTOFEED
Specifies whether devices with continuous paper or automatic paper feed should roll or feed the
paper automatically for the next graph.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Defaults: GOPTIONS: AUTOFEED (if a device is specified); GDEVICE: AUTOFEED=Y
Restrictions: device dependent; not supported by Java or ActiveX
See also: PPDFILE
Syntax
GOPTIONS: AUTOFEED | NOAUTOFEED
GDEVICE: AUTOFEED=Y | N
AUTOFEED
AUTOFEED=Y
causes the device to feed new paper automatically for the next graph. A blank
Autofeed field in the Parameters window is the same as AUTOFEED=Y.
NOAUTOFEED
AUTOFEED=N
suppresses the automatic paper feed.
Details
For PostScript devices, if AUTOFEED is unaltered, the PostScript file is unchanged. If
you specify NOAUTOFEED and do not select a PPD file with the PPDFILE option, a
PostScript Level 1 manualfeed command is added to the driver output. If you specify
NOAUTOFEED and select a PPD that contains a manualfeed option, the procedure
code for that manualfeed option is sent. If there is no manualfeed option in the PPD, no
manualfeed code is sent. See “PPDFILE” on page 337.
AUTOSIZE
Controls whether to change the size of the character cells in order to preserve the number of rows
and columns specified in the device entry.
Graphics Options and Device Parameters Dictionary BINDING 265
Syntax
AUTOSIZE=ON | OFF | DEFAULT
ON
changes the cell size in order to preserve the number of rows and columns.
OFF
preserves the device’s original cell size and temporarily changes the number of rows
and columns.
DEFAULT
uses the default setting (ON or OFF) that is controlled by DEVOPTS bit 50 (see
“DEVOPTS” on page 281).
Details
AUTOSIZE is useful when you change the size of the graphics display area using one or
more of the options PAPERSIZE, XPIXELS, YPIXELS, XMAX, or YMAX. It lets you
control image text size without using PROC GDEVICE. Typically, AUTOSIZE is on for
most image drivers and off for all other types of drivers.
Note: If you use HSIZE of VSIZE, the character cell size changes regardless of the
AUTOSIZE setting. 4
BINDING
Specifies which edge of the document is the binding edge.
Used in: GOPTIONS statement OPTIONS statement
Default: DEFAULTEDGE
PostScript and PCL printers only. PostScript printers require a PPD file.
Restrictions:
Not supported by Java or ActiveX.
See also: DUPLEX, PPDFILE
Syntax
BINDING=DEFAULTEDGE | LONGEDGE | SHORTEDGE
Details
BINDING controls how the page is flipped when DUPLEX is in effect. It does not
change the orientation of the graph. DEFAULTEDGE refers to the hardware’s
266 BORDER Chapter 8
factory-default setting. LONGEDGE and SHORTEDGE refer to the paper’s long and
short edges.
For PostScript printers, a PPD file must also be specified, using the PPDFILE=
option. The PPD file contains the command that SAS/GRAPH needs to request the
appropriate binding method on the printer being used. If a PPD file is not specified,
BINDING= is ignored because SAS/GRAPH will lack the command needed to request
the binding method.
BORDER
Specifies whether to draw a border around the graphics output area.
Used in: GOPTIONS statement
Default: NOBORDER
Syntax
BORDER | NOBORDER
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245 and “Example 9. Combining Graphs and Reports in a Web
Page” on page 248
Details
The placement of the border on the display is defined by the HSIZE= and VSIZE=
graphics options, if used. Otherwise the placement is defined by the XMAX and YMAX
device parameters.
CBACK
Specifies the background color of the graphics output.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Gcolors window
Default: as specified in the Gcolors window
Syntax
CBACK=background-color
background-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Graphics Options and Device Parameters Dictionary CELL 267
Details
The CBACK= option is valid on all devices but may be ignored by some (for example,
plotters). Specify the default in the Gcolors window of the device entry.
Note: This option overrides the Background and Foreground style attributes in the
graph styles. For more information on graph styles, refer to the TEMPLATE procedure
documentation in SAS Output Delivery System: User’s Guide. 4
If you explicitly specify a background color with the CBACK= option, the background
color you select should contrast with the foreground colors.
If the IBACK= option is in effect, an image will appear in the background in place of
the color specified with the CBACK= option.
CBY
Selects the color of the BY lines that appear in the graphics output.
Used in: GOPTIONS statement
Default: (1) CTEXT= graphics option, if used; (2) first color in current colors list
Restriction: not supported by Java or ActiveX
Syntax
CBY=BY-line-color
BY-line-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Details
When you use a BY statement with a SAS/GRAPH procedure to process a data set in
subgroups, each graph produced by that procedure is headed by a BY line that displays
the BY variables and their values that define the current subgroup.
CELL
Controls whether to use cell alignment.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: CELL | NOCELL
268 CHARACTERS Chapter 8
GDEVICE: CELL=Y | N
CELL
CELL=Y
causes the device to use cell alignment, in which case SAS/GRAPH attempts to place
hardware (or simulated hardware) characters inside character cells. This restriction
on the location of characters means that in some cases the SAS/GRAPH procedure
may generate axes that do not occupy the entire procedure output area or may be
unable to create the requested graph. A blank Cell field in the Parameters window
is the same as CELL=Y.
NOCELL
CELL=N
suppresses cell alignment, causing the procedure to use the entire procedure output
area and place axis and tick mark labels without regard to cell alignment.
Details
Specify N in the device entry or use NOCELL in a GOPTIONS statement if you want to
preview a graph on a cell-aligned display but intend to produce the final graph on a
device that is not cell-aligned, such as a pen plotter.
CHARACTERS
Specifies whether the device’s hardware font is used when no font or FONT=NONE is specified in a
SAS statement.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Defaults: GOPTIONS: CHARACTERS; GDEVICE: CHARACTERS=Y
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: CHARACTERS | NOCHARACTERS
GDEVICE: CHARACTERS=Y | N
CHARACTERS
CHARACTERS=Y
causes SAS/GRAPH to use the device’s default hardware font when you do not
specify a font in a SAS program. A blank Characters field in the Parameters
window is the same as CHARACTERS=Y.
NOCHARACTERS
CHARACTERS=N
causes SAS/GRAPH to draw the characters using the SIMULATE font and
suppresses the use of all hardware fonts, regardless of values you specify in other
SAS statements.
Graphics Options and Device Parameters Dictionary CHARTYPE 269
Details
The hardware font is not used if you changed the HPOS= and VPOS= graphics options
from the default, or if you used the HEIGHT= option in a SAS statement and the device
does not have scalable characters.
CHARREC
Specifies a hardware font for a device by associating a CHARTYPE number with a hardware font.
Also defines a default size to use with that font.
Used in: GDEVICE procedure
Default: device dependent
Syntax
CHARREC=(charrec-list(s))
charrec-list
a list of values that correspond to the fields in the Chartype window. Charrec-list has
this form:
type, rows, cols, ’font’, ’Y’ | ’N’
type is the CHARTYPE number and can be an integer from 0 to 9999.
(See “CHARTYPE” on page 269 for more information.)
rows is the number of rows of text in the font that will fit on the
display. (See “ROWS” on page 350 for more information.)
cols is the number of columns of text in the font that will fit on the
display. (See “COLS” on page 274 for more information.)
font is a character string enclosed in quotation marks that contains
the name of the corresponding hardware font on the device. (See
“FONT NAME” on page 292 for more information.)
Y represents a scalable font. A scalable font can be displayed at any
size. (See “SCALABLE” on page 351 for more information.)
N represents a nonscalable font. A nonscalable font can be displayed
only at a fixed size. (See “SCALABLE” on page 351 for more
information.)
For example, these values assign the device’s Helvetica font to be the first
hardware font in the CHARTYPE window of the driver entry:
charrec=(1, 100, 75, ’helvetica’, ’y’)
CHARTYPE
Selects the number of the default hardware character set.
270 CIRCLEARC Chapter 8
Syntax
CHARTYPE=hardware-font-chartype
hardware-font-chartype
is a nonnegative integer from 0 to 999. Hardware-font-chartype refers to the actual
number for the hardware font you want to use as listed in the Chartype window of
the device entry for the selected device driver. By default, CHARTYPE is 0, which is
the default hardware font for the device.
CIRCLEARC
Specifies whether SAS/GRAPH should use the device’s hardware circle-drawing capability, if
available.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: CIRCLEARC | NOCIRCLEARC
GDEVICE: CIRCLEARC=Y | N
CIRCLEARC
CIRCLEARC=Y
causes SAS/GRAPH to use the built-in hardware circle- and arc-drawing capability of
the device. A blank Circlearc field in the Parameters window is the same as
CIRCLEARC=Y.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
device drivers do not try to use the capability if the device does not have it.
NOCIRCLEARC
CIRCLEARC=N
causes SAS/GRAPH to use software move and draw commands to draw circles and
arcs.
CMAP
Specifies a color map for the device.
Graphics Options and Device Parameters Dictionary COLLATE 271
Syntax
CMAP=(’from-color : to-color’ < ...,’from-color-n : to-color-n’>)
from-color
specifies the name you want to assign to the color designated by the color value. In
the Colormap window, enter this value in the From field.
to-color
specifies any SAS/GRAPH color name up to eight characters long. In the Colormap
window, enter this value in the To field. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information on specifying colors.
Details
Once you have defined the color mapping, you use the new color name in any color
option. For example, if your device entry maps the color name DAFFODIL to the SAS
color value PAOY, you can specify the following:
pattern1 color=daffodil;
and the driver will map this to the color value PAOY.
COLLATE
Specifies whether to collate the output, if collation is supported by the device.
Used in: GOPTIONS statement; OPTIONS statement
Default: NOCOLLATE
hardware dependent, PostScript printers require a PPD file; not supported
Restriction:
by Java or ActiveX
See also: GPROLOG, PPDFILE
Syntax
COLLATE | NOCOLLATE
Details
A limited number of printers can collate output, which means to separate each copy
of printed output when you print multiple copies of output.
For PostScript printers, if a device’s PPD file has Collate defined as "True", the
COLLATE option is supported.
For PCL printers that support collation, use the GPROLOG= option to specify a
Printer Job Language (PJL) command to enable the collation. For information on the
272 COLORS Chapter 8
appropriate PJL command, consult the Printer Commands section of your printer’s user
manual.
COLORS
Specifies the foreground colors used to produce your graphics output if you do not specify colors
explicitly in program statements.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Gcolors window
Default: device dependent
Syntax
GOPTIONS: COLORS=<(colors-list | NONE)>
GDEVICE: COLORS=(<colors-list> )
colors-list
specifies one or more SAS color names. If you specify more than one color, separate
each name with a blank. See Chapter 6, “SAS/GRAPH Colors and Images,” on page
91 for information on specifying colors and using a colors list.
To change some of the colors in the colors list and retain others, you can use a null
value for colors you do not want to change. For example, to change COLORS=(RED
GREEN BLUE) to COLORS=(WHITE GREEN BROWN), you can specify
COLORS=(WHITE,,BROWN).
NONE
tells SAS/GRAPH to use only the colors that you explicitly specify in program
statements and to ignore the device’s default colors list.
Note: If you specify COLORS=(NONE) and omit a color specification for a
graphics element, such as patterns, SAS/GRAPH selects at random one of the colors
already specified in your program. 4
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on page
231
Details
The order of the colors in the list is important when you use default colors. For
example, the colors used for titles, axes, and surfaces in the G3D procedure are
assigned by default according to their position in the colors list.
Note: Colors may be assigned to graph elements in different orders by different
devices such as Java and ActiveX. 4
If you omit or reset COLORS=, SAS/GRAPH uses the default colors list for the
current device. To explicitly reset the colors list to the device default, specify either
goptions colors=;
goptions colors=();
Graphics Options and Device Parameters Dictionary COLORTYPE 273
If you use default patterns with a colors list specified by COLORS=, the patterns
rotate through every color in the list. If the colors list contains only one color, for
example COLORS=(BLUE), the solid pattern is skipped and the patterns rotate
through only the appropriate default hatch patterns for the graph.
Note: By default, if black is the first color in a device’s colors list, default pattern
rotation skips black as a pattern color, but uses black as the area-outline color. Thus,
the outline color is never the same as an area’s fill color. Using COLORS= to change
the colors list changes this default pattern behavior. When COLORS= is used, all colors
in the specified colors list are used in color rotation, and the outline color is the first
color in the specified colors list. Thus, the outline color will match any area using the
first color as its fill. 4
See “PATTERN Statement” on page 169 for more information on pattern rotation.
COLORTBL
An eight-character field in the Gcolors window that is not currently implemented. SAS/GRAPH
ignores any value entered into this field.
COLORTYPE
Specifies the color space used by the user-written part of the Metagraphics device driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Default: NAME
Syntax
COLORTYPE=NAME | RGB | HLS | GRAY | CMY | CMYK | HSV | HSB
Details
Use the COLORTYPE device parameter also to specify the color-naming scheme that is
used for devices that support more than one color-naming scheme.
For information about Metagraphics drivers, contact Technical Support.
COLS
Sets the number of columns that the hardware font uses.
Used in: GDEVICE Chartype window; GDEVICE procedure; CHARREC= option
Default: 0
See also: CHARREC
Syntax
See “CHARREC” on page 269 for syntax.
Details
If you are using a device driver from SASHELP.DEVICES, this parameter is already set
for hardware fonts that have been defined for your installation. If you are adding to or
modifying the hardware fonts available for a particular device driver, specify a positive
value for the COLS device parameter. If COLS is greater than 0, it overrides the values
of the LCOLS and PCOLS device parameters. For scalable fonts, you can specify 1 for
COLS, and the actual number of columns will be computed based on the current text
width.
CPATTERN
Selects the default color for PATTERN definitions when a color has not been specified.
Used in: GOPTIONS statement
Default: first color in current colors list
Restriction: not supported by Java or ActiveX
Syntax
CPATTERN=pattern-color
pattern-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Graphics Options and Device Parameters Dictionary CTEXT 275
Details
CPATTERN= is overridden by any color specification in a PATTERN statement. For
details on how CPATTERN= affects the PATTERN statement, see “The Effect of the
CPATTERN= Graphics Option” on page 180.
If you specify CPATTERN=, the solid pattern is skipped and the patterns rotate
through only the appropriate default hatch patterns for the graph. See “PATTERN
Statement” on page 169 for more information on pattern rotation.
CSYMBOL
Specifies the default color for SYMBOL definitions when a color has not been specified.
Used in: GOPTIONS statement
Default: first color in current colors list
Restriction: not supported by Java or ActiveX
Syntax
CSYMBOL=symbol-color
symbol-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Details
CSYMBOL= is overridden by any color specification in a SYMBOL statement. See
“SYMBOL Statement” on page 183.
CTEXT
Selects the default color for all text and the border.
Used in: GOPTIONS statement
Default: black for Java and ActiveX devices; for other devices, the first color in current
colors list
See also: CTITLE
Restriction: partially supported by Java
Syntax
CTEXT=text-color
276 CTITLE Chapter 8
text-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Details
The CTITLE= graphics option overrides CTEXT= for all titles, notes, and footnotes, as
well as the border. Any other color specifications for text in SAS statements also
override the value of CTEXT=.
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
CTITLE
Selects the default color for all titles, footnotes, and notes, and the border.
Used in: GOPTIONS statement
Default: (1) color specified by CTEXT=, if used; (2) black for Java and ActiveX devices;
for other devices, the first color in current colors list
See also: CTEXT
Syntax
CTITLE=title-color
title-color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for information about specifying colors.
Details
Any color specification in a TITLE, FOOTNOTE, or NOTE statement overrides the value
of CTITLE= for the text. The border, however, still uses the color specified in CTITLE=.
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
DASH
Specifies whether to use the device’s hardware dashed-line capability, if available.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Graphics Options and Device Parameters Dictionary DASHLINE 277
Syntax
GOPTIONS: DASH | NODASH
GDEVICE: DASH=Y | N
DASH
DASH=Y
causes SAS/GRAPH to use the built-in hardware dashed-line drawing capability of
the device when generating graphics output. A blank Dash field in the Parameters
window is the same as DASH=Y.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
device drivers do not try to use the capability if the device does not have it.
NODASH
DASH=N
causes SAS/GRAPH to draw the dashed lines.
DASHLINE
Specifies which dashed lines should be generated by hardware means if possible.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
See also: DASH
Syntax
DASHLINE=’dashed-line-hex-string’X
dashed-line-hex-string
is a hexadecimal string 16 characters long that must be completely filled. Each bit in
the string corresponds to a line type. See Figure 7.22 on page 208 for line types that
correspond to each bit.
To use line type 1, turn on bit 1; to use line type 2, turn on bit 2; and so on. For
example, in the following option the first byte is ’1000’; only bit 1 is on and only line
type 1 is selected:
dashline=’8000000000000000’x
Details
If the DASH device parameter is N in the device entry or if NODASH is used in a
GOPTIONS statement, SAS/GRAPH ignores the hexadecimal string in the DASHLINE
device parameter.
DASHSCALE
Scales the lengths of the dashes in a dashed line.
Used in: GOPTIONS statement
Default: DASHSCALE=1
Restriction: not supported by Java or ActiveX
Syntax
DASHSCALE=scaling-factor
scaling-factor
can be any number greater than 0. For example, GOPTIONS DASHSCALE=.5
reduces any existing dash length by one-half.
Details
Only dashes or spaces with lengths greater than one pixel are scaled. Dots are not
scaled because their length is effectively zero. DASHSCALE= always uses software line
styles instead of the device’s hardware dashed line capabilities.
DELAY
Controls the amount of time between graphs in the animation sequence.
Used in: GOPTIONS statement
Default: 0
Restriction: GIFANIM driver only; not supported by all browsers
Syntax
DELAY=delay-time
delay-time
specifies the length of time between graphs in units of 0.01 seconds. For example, to
specify a delay of .03 seconds, specify DELAY=3.
Graphics Options and Device Parameters Dictionary DEVICE 279
Details
SAS/GRAPH puts the DELAY= value into the image file. Based on this value, the
browser determines how to display the series of graphs.
DESCRIPTION
Provides a description of the device entry.
Alias: DES
Used in: GDEVICE procedure GDEVICE Detail window
Default: none
Syntax
DESCRIPTION=’text-string’
text-string
is a string up to 256 characters long. This is a comment field and does not affect the
graphics output.
DEVADDR
Specifies the location of the device to which the output of device drivers is sent.
Used in: GOPTIONS statement
Default: host dependent
Restriction: IBM mainframe systems only
Syntax
DEVADDR=device-address
DEVICE
Specifies the device driver to which SAS/GRAPH sends the procedure output. The device driver
controls both the form and destination of the output.
Alias: DEV
Used in: GOPTIONS statement OPTIONS statement
280 DEVMAP Chapter 8
Syntax
DEVICE=device-entry
device-entry
specifies the name of a device entry that is stored in a device catalog.
Details
A device driver can direct graphics output to a hardware device, such as a terminal or a
printer, or can create an external file in another graphics file format, such as TIF, GIF,
or PostScript. Some device drivers also generate both graphics files and HTML files
that can be viewed with a Web browser.
Usually a device driver is assigned by default. If a default driver is not assigned or if
you specify RESET=ALL in a GOPTIONS statement, and you do not specify a device
driver, SAS/GRAPH prompts you to enter a driver name when you execute a procedure
that produces graphics output. If you are producing a graph to the screen and the
Graph window is active, SAS/GRAPH selects the display driver for you automatically.
For a description of device drivers and for more information on selecting a device
entry and changing device parameters, see Chapter 3, “Device Drivers,” on page 41.
For information on using device drivers to display and print graphics output, see
Chapter 4, “SAS/GRAPH Output,” on page 47.
For information on using device drivers to export graphics output to external files,
see “About Exporting SAS/GRAPH Output” on page 59. For information on using device
drivers to create output for the Web, see “Generating Web Presentations” on page 382.
DEVMAP
Specifies the device map to be used when hardware fonts are used.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
DEVMAP=device-map-name | NONE
device-map-name
is a string up to eight characters long that is the name of the device map entry. See
Chapter 34, “The GKEYMAP Procedure,” on page 983 for details.
NONE
specifies that you do not want to use a device map. This may cause text to be
displayed incorrectly or not at all.
Graphics Options and Device Parameters Dictionary DEVOPTS 281
Details
Device maps usually are used only when national characters appear in the text and you
want them to display properly.
DEVOPTS
Specifies the hardware capabilities of the device.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Syntax
DEVOPTS=’hardware-capabilities-hex-string’X
hardware-capabilities-hex-string
is a hexadecimal string 16 characters long that must be completely filled. The
following table lists the hardware capabilities of each bit:
Bit On Capability
0 hardware circle generation
9 not used
10 not used
Bit On Capability
24 not used
25 polyline supported
26 polymarker supported
27 graphics clipping supported
28 not used
29 linkable device driver
Bit On Capability
54 ActiveX device
55 Java device
Details
Each capability in the table corresponds to a bit in the value of the DEVOPTS device
parameter. For example, if your device can generate hardware pie fills, the second bit
in the first byte of the DEVOPTS string should be turned on if you want the driver to
use that capability. If your device is capable of generating only hardware circles and pie
fills, specify a value of ’C000000000000000’X as your DEVOPTS value (the first byte is
’1100’ so the first 2 bits of the first byte are set to 1). Many of the hardware capabilities
specified in the DEVOPTS string are overridden by graphics options or other device
parameters.
CAUTION:
Do not modify the DEVOPTS device parameter unless you are building a Metagraphics
driver. If you want to prevent an Institute-supplied driver from using certain hardware
capabilities, change the specific device parameter or use the corresponding graphics
option. 4
If the DEVOPTS string indicates that a capability is available, the driver uses it
unless it is explicitly disabled by another device parameter or graphics option. If the
DEVOPTS string indicates that the capability is not available, it is not used by the
driver, even if the corresponding device parameter or graphics option indicates that it
should be used. For example, if the DEVOPTS value indicates that the device can do a
hardware pie fill, the driver uses the hardware pie fill capability unless the PIEFILL
device parameter is set to N or NOPIEFILL has been specified in a GOPTIONS
statement. However, if the DEVOPTS device parameter indicates that the device
cannot do a hardware pie fill, the driver does not attempt to use one, even if the
PIEFILL device parameter is set to Y or PIEFILL is used in a GOPTIONS statement.
DEVTYPE
Specifies the information required by SAS/GRAPH routines to determine the nature of the output
device.
Used in: GDEVICE procedure; GDEVICE Host File Options window
Default: device dependent
Syntax
DEVTYPE=device-type
device-type
is a string eight characters long containing either blanks or some token name that is
interpreted by the host. Device-type can be:
284 DISPLAY Chapter 8
GTERM
indicates that the output device is a graphics device that will be receiving graphics
data; most device drivers use this value.
G3270
indicates that the output device is an IBM 3270 graphics data stream. If your
device is an IBM 3270 type of device, DEVTYPE= must be G3270.
Note: GTERM and G3270 are SAS/GRAPH device types. Other valid values depend
on your operating environment. DEVTYPE supports any of the device-type values
supported on the FILENAME statement. Refer to the SAS Help facility for the device
types the FILENAME statement supports in your operating environment. In most
cases, this field should not be changed. 4
DISPLAY
Specifies whether output is displayed on the graphics device but does not affect whether a graph
is placed in a catalog.
Used in: GOPTIONS statement
Default: DISPLAY
Restriction: not supported by Java or ActiveX
Syntax
DISPLAY | NODISPLAY
Details
In most cases, NODISPLAY suppresses all output except the catalog entry written to
the catalog selected in the GOUT= option. Therefore, you usually specify NODISPLAY
when you want to generate a graph in a catalog but do not want to display the graph on
your monitor or terminal while the catalog entry is being produced.
DISPOSAL
Specifies what happens to the graphic after it is displayed.
Used in: GOPTIONS statement
Default: NONE
Restriction: GIFANIM driver only
Syntax
DISPOSAL=NONE | BACKGROUND | PREVIOUS | UNSPECIFIED
Graphics Options and Device Parameters Dictionary DRVQRY 285
NONE
causes the graphic to be left in place after displaying. This is the default.
BACKGROUND
causes the background color to be returned and the graph erased after displaying.
PREVIOUS
causes the graphic area to be restored with what was displayed in the area previously.
UNSPECIFIED
indicates that no action is necessary.
Details
In Version 6, the ERASE | NOERASE graphics option performed this function for the
GIFANIM driver.
DRVINIT
Specifies host commands to be executed before driver initialization.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host Commands
window
Restriction: not supported by Java or ActiveX
Syntax
DRVINIT1=’system-command(s)’
DRVINIT2=’system-command(s)’
system-command(s)
specifies a character string that is a valid system command and can be in upper- or
lowercase letters. You can include more than one command in the string if you
separate the commands with a command delimiter, which is host-specific; for
example, some operating environments use a semicolon. The length of the entire
string cannot exceed 72 characters.
Details
The DRVINIT command is executed before the driver is initialized. DRVINIT is
typically used with FILECLOSE=DRIVERTERM to allocate a host file needed by the
device driver.
DRVQRY
Specifies whether the device can be queried for information about the current device configuration.
Used in: GDEVICE procedure GDEVICE Detail window
286 DRVTERM Chapter 8
Syntax
DRVQRY | NODRVQRY
Details
Generally, this setting is device dependent and you should not change it.
DRVTERM
Specifies host commands to be executed after the driver terminates.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host Commands
window
Restriction: not supported by Java or ActiveX
Syntax
DRVTERM1=’system-command(s)’
DRVTERM2=’system-command(s)’
system-command(s)
specifies a character string that is a valid system command and can be in upper- or
lowercase letters. You can include more than one command in the string if you
separate the commands with a command delimiter, which is host-specific; for
example, some operating environments use a semicolon. The length of the entire
string cannot exceed 72 characters.
Details
The DRVTERM command is executed after the driver terminates. DRVTERM is
typically used with FILECLOSE=DRIVERTERM to de-allocate a host file and execute
utility programs that send the data to the graphics device. For example, DRVTERM
might specify commands to send the file to a host print queue.
DUPLEX
Specifies whether to use duplex printing if available on the device.
Used in: GOPTIONS statement; OPTIONS statement
Default: NODUPLEX
Restriction: duplex printers only
Graphics Options and Device Parameters Dictionary ERASE 287
Syntax
DUPLEX | NODUPLEX
Details
When DUPLEX is on, the driver sets up the printer for duplex operation. Before
producing the first graph, set GSFMODE=REPLACE on the GOPTIONS statement, and
DUPLEX on an OPTIONS or GOPTIONS statement. You can also use the BINDING=
option in conjunction with DUPLEX. Before producing the second graph, set
GSFMODE=APPEND on the GOPTIONS statement so that the driver knows to place
succeeding graphs on the next available side of paper.
If DUPLEX is in effect, the page’s inside (binding) margin is set equal to the current
HORIGIN setting, and the outside margin is set equal to
XMAX − HSIZE − HORIGIN
In terms of even- and odd-numbered pages, this means the following:
odd-numbered HORIGIN determines the left margin, and XMAX-HSIZE-HORIGIN
pages determines the right margin
even-numbered XMAX-HSIZE-HORIGIN determines the left margin, and HORIGIN
pages determines the right margin
For PostScript printers, if you do not use the PPDFILE= option to specify a PPD
(PostScript Printer Description) file, a generic PostScript Level 1 duplex command is
added to the driver output. If PPDFILE= is used, the duplex command is obtained from
the PPD file.
ERASE
Specifies whether to erase graph after display.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Defaults: GOPTIONS: NOERASE; GDEVICE: ERASE=N
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: ERASE | NOERASE
GDEVICE: ERASE=Y | N
ERASE
ERASE=Y
288 EXTENSION Chapter 8
causes the graph to be erased when you press RETURN after the graph has been
displayed.
NOERASE
ERASE=N
causes the graph to remain on the display when you press RETURN after the graph
has been displayed. A blank Erase field in the Parameters window is the same as
ERASE=N.
Details
ERASE is useful for those devices that overlay the graphics area and the message area
– that is, those devices that have separate dialog and graphics areas. On other devices,
the graph is erased.
EXTENSION
Specifies the file extension for an external graphics file.
Used in: GOPTIONS statement
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: GACCESS, GSFNAME
Syntax
EXTENSION=’file-type’
file-type
a string up to eight characters long that is a file extension, such as GIF or CGM, that
you want to append to an external file.
Details
The extension specified on EXTENSION= is used when the output destination is a
storage location. The extension is ignored when the output destination is a file. To
specify the output destination, you can use a FILENAME statement, or the graphics
options GACCESS= or GSFNAME=.
Assuming the output destination is a storage location,
3 if EXTENSION=’.’, no extension is added to the file name
3 if EXTENSION=’ ’or EXTENSION= is not used, the driver’s default extension is
added to the file name
3 if the driver has no default extension, SAS/GRAPH uses the default extension
.GSF.
FASTTEXT
Specifies whether to use integer-based font processing for faster font rendering.
Graphics Options and Device Parameters Dictionary FCACHE 289
Syntax
FASTTEXT | NOFASTTEXT
FBY
Selects the font for BY lines.
Used in: GOPTIONS statement
Default: (1) font specified by FTEXT=, if used; (2) default hardware font
Restriction: not supported by Java or ActiveX
See also: “BY Statement” on page 141
Syntax
FBY=BY-line-font
BY-line-font
specifies the font for all BY-lines on the graphics output. See Chapter 5, “SAS/
GRAPH Fonts,” on page 75 for information about specifying fonts.
Details
When you use a BY statement with a SAS/GRAPH procedure to process a data set in
subgroups, each graph produced by that procedure is headed by a BY line that displays
the BY variables and their values that define the current subgroup.
FCACHE
Specifies the number of software fonts to keep open at one time.
Used in: GOPTIONS statement
Default: FCACHE=3
Restriction: not supported by Java or ActiveX
Syntax
FCACHE=number-fonts-open
290 FILECLOSE Chapter 8
number-fonts-open
specifies the number of software fonts to keep open. Number-fonts-open must be
greater than or equal to zero.
Details
Each font requires from 4K to 10K memory. Graphs that use many fonts may run
faster if you set the value of number-fonts-open to a higher number. However, graphs
that use multiple fonts may require too much memory on some computer systems if all
the fonts are kept open. In such cases, set the value of number-fonts-open to a lower
number to conserve memory.
FILECLOSE
Controls when the graphics stream file (GSF) is closed when you are using the device driver to
send graphics output to a hardcopy device.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: DRIVERTERM (if a device is specified)
Restriction: not supported by Java or ActiveX
See also: “About Exporting SAS/GRAPH Output” on page 59
Syntax
FILECLOSE=DRIVERTERM | GRAPHEND
DRIVERTERM
DRIVER
closes the GSF and makes it available to the device after all graphs have been
produced and the procedure or driver terminates. A host command may be needed to
actually send the GSF to the device. Host commands may be specified with the
DRVINIT or DRVTERM parameters or entered in the Host File Options window of
the device entry.
If multiple graphs are produced by a procedure, this specification creates one large
file. Specifying DRIVERTERM is appropriate for batch processing because it is
slightly more efficient to allocate the file only once.
GRAPHEND
GRAPH
closes the GSF after each separate graph is produced and releases it to the device
before sending another. This method creates smaller files if multiple graphs are
produced by a procedure. You can specify a command that sends the graph to the
device with the POSTGRAPH parameter or use the Host File Options window.
Specifying GRAPHEND is appropriate for drivers that are used interactively, or
for devices that require only one graph per physical file.
Graphics Options and Device Parameters Dictionary FILL 291
FILEONLY
Specifies whether a file or a storage location is the default destination for graphics output.
Used in: GOPTIONS statement
Default: device dependent
Restriction: FILEONLY ignored if the device requires the output destination to be a
storage location; not supported by Java or ActiveX
See also: DEVOPTS, GSFNAME
Syntax
FILEONLY | NOFILEONLY
FILEONLY
specifies that a file rather than a storage location is the default destination for
graphics output.
NOFILEONLY
specifies that a storage location is the default destination for graphics output, unless
a file of the same name exists.
Details
Most devices use FILEONLY as the default. However, devices that require the output
destination to be a storage location use NOFILEONLY as the default. For example, the
HTML and WEBFRAME devices require a storage location because they produce two
types of output (HTML files and GIF image files) that cannot be written to the same file.
To determine what the default is for a particular device, look at the settings for
DEVOPTS bits 48 and 49.
For more information, see “Exporting SAS/GRAPH Output with Program
Statements” on page 62.
FILL
Specifies whether to use the device’s hardware rectangle-fill capability.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Restriction: not supported by Java or ActiveX
Default: device dependent
Syntax
GOPTIONS: FILL | NOFILL
GDEVICE: FILL=Y | N
292 FILLINC Chapter 8
FILL
FILL=Y
causes SAS/GRAPH to use the built-in hardware rectangle-filling capability of the
device. A blank Fill field in the Parameters window is the same as FILL=Y.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
does not try to use the capability if your device does not support it.
NOFILL
FILL=N
causes SAS/GRAPH to use software fills to fill rectangles.
FILLINC
Specifies the number of pixels to move before drawing the next line in a software fill of a solid
area.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: FILL, PIEFILL, POLYGONFILL
Syntax
FILLINC= 0...9999
Details
In order for FILLINC to have any effect, a software fill must be used. To force a
software fill, use the options NOFILL, NOPIEFILL, and NOPOLYGONFILL in a
GOPTIONS statement.
If FILLINC is set to 0 or 1, adjacent lines are used (solid fill with no gaps). If
FILLINC is set to 2, a pixel-width line is skipped before drawing the next line of a fill.
This option can be useful for keeping plotters from over saturating a solid area and
for speeding the plotting. Some inks spread on paper. The type of paper used also can
affect ink spread.
FONT NAME
Specifies the hardware font associated with CHARTYPE.
Used in: GDEVICE Chartype window; GDEVICE procedure; CHARREC= option
Required if adding or modifying a CHARREC
See also: CHARREC
Syntax
See “CHARREC” on page 269 for syntax.
Graphics Options and Device Parameters Dictionary FORMAT 293
Details
Use FONT NAME if you are adding to or modifying the hardware fonts available for a
particular device driver. The fonts that you specify must be valid for the output device.
If you are using an Institute-supplied device entry, this parameter already is set for
most available hardware fonts.
FONTRES
Controls the resolution of software fonts.
Used in: GOPTIONS statement
Default: NORMAL
Restriction: not supported by Java or ActiveX
See also: FASTTEXT, FCACHE, RENDER, RENDERLIB, SWFONTRENDER
Syntax
FONTRES=NORMAL | PRESENTATION
NORMAL
renders fonts in memory using integer rendering routines, which improves character
drawing speed for most host systems. NORMAL has the same effect as specifying the
default values for these graphics options.
render=memory
renderlib=saswork
fasttext
fcache=0
PRESENTATION
disables the storage or use of rendered versions of Bitstream fonts, but produces the
fonts at their highest resolution. FONTRES=PRESENTATION has the same effect
as specifying these graphics options:
render=none
renderlib=saswork
nofasttext
fcache=3
FORMAT
Sets the file format of the metacode file produced by the Institute-supplied part of the
Metagraphics device driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Default: CHARACTER
Restriction: Used only with user-supplied Metagraphics drivers.
294 FTEXT Chapter 8
Syntax
FORMAT=CHARACTER | BINARY
Details
A blank field defaults to CHARACTER. For information about Metagraphics drivers,
contact Technical Support.
FTEXT
Selects the default font for all text.
Used in: GOPTIONS statement
Default: Default hardware font (except the first title)
Restriction: partially supported by Java or ActiveX
See also: FTITLE
Syntax
FTEXT=text-font
text-font
specifies the font for all text on the graphics output. See Chapter 5, “SAS/GRAPH
Fonts,” on page 75 for information about specifying fonts.
Details
The FTITLE= graphics option overrides FTEXT= for the first title. Not all fonts are
supported by the ActiveX and Java devices.
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
FTITLE
Selects the default font for the first TITLE line.
Used in: GOPTIONS statement
Default: (1) font specified by FTEXT=, if used; (2) SWISS font
Graphics Options and Device Parameters Dictionary FTRACK 295
Syntax
FTITLE=title-font
title-font
specifies the font for the TITLE1 statement. See Chapter 5, “SAS/GRAPH Fonts,” on
page 75 for information about specifying fonts.
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values” on
page 226 and “Example 6. Enhancing Titles” on page 238
Details
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
FTRACK
Controls the amount of space between letters in the Institute-supplied Bitstream fonts (Brush,
Century, Swiss, and Zapf).
Used in: GOPTIONS statement
Default: TIGHT
Restriction: not supported by Java or ActiveX
Syntax
FTRACK=LOOSE | NONE | NORMAL | TIGHT | TOUCH | V5
LOOSE
leaves the most visible space between characters and produces a longer string.
NONE
spacing depends on the size of the font. NONE might produce a shorter or longer
string than LOOSE for the same font at different point sizes, because some sizes add
space between the characters while others remove it.
NORMAL
is the recommended setting.
TIGHT
reduces the space between characters.
296 GACCESS Chapter 8
TOUCH
leaves the least visible space between characters.
V5
places a fixed amount of space between the characters and does not adjust for the
shape of the character; that is, it does not support kerning. This spacing is
compatible with Version 5 Bitstream fonts.
Details
The spacing you specify with FTRACK= affects all Bitstream text in a graph. For
example, you cannot produce TIGHT Century type and LOOSE Zapf type
simultaneously. This option has no effect on other font types.
Because the value of FTRACK= is stored with the graph, the spacing that you specify
when the graph is created is always used when the graph is replayed.
GACCESS
Specifies the format or the destination or both of graphics data written to a device or graphics
stream file (GSF).
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
GACCESS=output-format | ’output-format destination’
output-format
specifies the format or the destination (the SAS log or a fileref) of the graphics data.
Output-format varies according to the operating environment. These values can be
specified in all operating environments:
SASGASTD
specifies that a continuous stream of data is written. SASGASTD is the default for
most devices and is typically appropriate when the output file will be sent directly
to a device. If you specify GACCESS=SASGASTD, use the GSFNAME= and
GSFMODE= graphics options or device parameters to direct your graphics output
to a GSF.
SASGAEDT
specifies that the file be host-specific editable format. Some hosts allow editing by
inserting characters at the end of each record. SASGAEDT is typically used when
the output file is to be edited later. If you specify GACCESS=SASGAEDT, use the
GSFNAME= and GSFMODE= graphics options or device parameters to direct your
graphics output to a GSF.
SASGAFIX
specifies that fixed-length records be written. (The record length is controlled by
the value of the GSFLEN= graphics option or device parameter or the sixth byte of
Graphics Options and Device Parameters Dictionary GCLASS 297
the PROMPTCHARS value.) The records are padded with blanks where necessary.
SASGAFIX is typically used when the output file will be transferred to a computer
that requires fixed-length records. If you specify GACCESS=SASGAFIX, use the
GSFNAME= and GSFMODE= graphics options or device parameters to direct your
graphics output to a GSF.
Note: The value of the GPROTOCOL= graphics option or device parameter can
greatly affect the length of the records; for example, if GPROTOCOL=SASGPLCL,
the length of the records is doubled. 4
SASGALOG
specifies that records are to be written to the SAS log.
GSASFILE
specifies that the records are to be written to the destination whose fileref is
GSASFILE. The fileref can point to a specific external file or to an aggregate file
location. See “FILENAME Statement” on page 28 for more information on
specifying a fileref.
’output-format destination’
specifies the destination in addition to one of these output format values: SASGASTD,
SASGAEDT, or SASGAFIX. Destination is the physical name of an external file or
aggregate file location, or of a device. For details on specifying the physical name of a
destination, see the SAS documentation for your operating environment.
This form is not available in all operating environments. See “About Graphics
Stream Files” on page 60 for more information on creating graphics stream files.
Note: In the Gaccess field of the Host File Options window, you can specify a
destination without an output format, in which case the format defaults to
SASGASTD. When you specify a value in the Gaccess field, you do not need to quote
it. 4
Operating Environment Information: Depending on your operating environment, you
may be able to specify other values for GACCESS=. See the SAS companion for your
operating environment for additional values. 4
GCLASS
Specifies the output class for IBM printers
Used in: GOPTIONS statement
Default: GCLASS=G
Restriction: used only with IBM3287 and IBM3268 device drivers on z/OS systems only
Syntax
GCLASS=SYSOUT-class
Details
Specifies the SYSOUT class to which the IBM3287 and IBM3268 device driver
output is written.
298 GCOPIES Chapter 8
GCOPIES
Sets the current and maximum number of copies to print.
Used in: GOPTIONS statements; GDEVICE Parameters window; GDEVICE procedure;
OPTIONS statement
Defaults: GOPTIONS: GCOPIES=(0,20) GDEVICE: GCOPIES=0
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: GCOPIES=(<current-copies><,max-copies>)
GDEVICE: GCOPIES=current-copies
current-copies
is a nonnegative integer ranging from 0 through 255, but it cannot exceed the
max-copies value specified. A value of 0 or 1 produces a single copy.
max-copies
is a nonnegative integer ranging from 1 through 255.
If you do not specify GCOPIES, a default number of copies is searched for in this
order:
1 the number of copies specified on an OPTIONS COPIES setting
2 0 current copies, and 20 maximum copies.
Details
Not all devices have the capability to print multiple copies. See the Gcopies field in the
Parameters window for your device to determine its capabilities.
GDDMCOPY
Instructs the driver to issue either an FSCOPY or GSCOPY call to GDDM when AUTOCOPY is in
effect.
Used in: GOPTIONS statement
Default: FSCOPY
Restriction: GDDM device drivers on IBM mainframe systems only
See also: AUTOCOPY
Syntax
GDDMCOPY=FSCOPY | GSCOPY
Graphics Options and Device Parameters Dictionary GDEST 299
FSCOPY
used when sending output to an IEEE attached plotter.
GSCOPY
used when creating an ADMPRINT file for output on 3287-type printers.
GDDMNICKNAME
Selects a GDDM nickname for the device to which output is sent.
Alias: GDDMN
Used in: GOPTIONS statement
Restriction: GDDM device drivers on IBM mainframe systems only
Syntax
GDDMNICKNAME=nickname
Details
Refer to the SAS Help facility for details on using GDDM drivers and options.
GDDMTOKEN
Selects a GDDM token for the device to which output is sent.
Alias: GDDMT
Used in: GOPTIONS statement
Restriction: GDDM device drivers on IBM mainframe systems only
Syntax
GDDMTOKEN=token
Details
Refer to the SAS Help facility for details on using GDDM drivers and options.
GDEST
Specifies the JES SYSOUT destination for IBM printers.
Used in: GOPTIONS statement
Default: LOCAL
300 GEND Chapter 8
Restriction: used only with IBM3287 and IBM3268 device drivers on z/OS systems
Syntax
GDEST=destination
GEND
Appends an ASCII string to every graphics data record that is sent to a device or file.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Gend window
Restriction: not supported by Java or ActiveX
See also: GSTART
Syntax
GEND=’string’ <...’string-n’>
’string’
can be either of the following:
’hex-string’X
’character-string’
In a GOPTIONS statement or in the GDEVICE procedure ADD or MODIFY
statement, you can specify multiple strings with the GEND= option. In this case, you
can mix the formats, specifying some as ASCII hexadecimal strings and some as
character strings. Multiple strings are concatenated automatically.
In the GEND window, enter the hexadecimal string without either quotation
marks or a trailing x. Note, however, that the string must be entered as a
hexadecimal string.
PROC GOPTIONS always reports the value as a hexadecimal string.
Details
GEND is useful if you are creating a file and want to insert a carriage return at the end
of every record. You can also use GEND in conjunction with the GSTART= graphics
option or device parameter.
If you must specify the long and complicated initialization strings required by some
devices (for example, PostScript printers), it is easier to use the GOPTIONS GEND=
option rather than the GDEVICE Gend window because it is easier to code the string as
text with GEND= than it is to convert the string to its ASCII representation, which is
required to enter the string in the GDEVICE Gend window.
Note: On non-ASCII hosts, only ASCII hexadecimal strings produce consistent
results in all instances because of the way the character strings are translated. In
addition, the only way to specify a value for GEND that can be used by all hosts is to
use an ASCII hexadecimal string; therefore, using an ASCII hexadecimal string to
specify a value for GEND is the recommended method. 4
Graphics Options and Device Parameters Dictionary GFORMS 301
GEPILOG
Sends a string to a device or file after all graphics commands are sent.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Gepilog window
Restriction: not supported by Java or ActiveX
See also: PREGEPILOG, POSTGEPILOG
Syntax
GEPILOG=’string’ <...’string-n’>
’string’
can be either of the following:
’hex-string’X
’character-string’
In a GOPTIONS statement or in the GDEVICE procedure ADD or MODIFY
statement, you can specify multiple strings with the GEPILOG= option. In this case,
you can mix the formats, specifying some as ASCII hexadecimal strings and some as
character strings. Multiple strings are concatenated automatically.
In the Gepilog window, enter the hexadecimal string without either quotation
marks or a trailing x. Note, however, that the string must be entered as a
hexadecimal string.
PROC GOPTIONS always reports the value as a hexadecimal string.
Details
GEPILOG can be used in conjunction with the GPROLOG= graphics option or device
parameter.
If you must specify the long and complicated initialization strings required by some
devices (for example, PostScript printers), it is easier to use the GOPTIONS GEPILOG=
option rather than the Gepilog window because it is easier to code the string as text
with GEPILOG= than it is to convert the string to its ASCII representation, which is
required to enter the string in the Gepilog window.
Note: On non-ASCII hosts, only ASCII hexadecimal strings produce consistent
results in all instances because of the way the character strings are translated. In
addition, the only way to specify a value for GEPILOG that can be used by all hosts is
to use an ASCII hexadecimal string; therefore, using an ASCII hexadecimal string to
specify a value for GEPILOG is the recommended method. 4
GFORMS
Specifies the JES form name for IBM printers.
Used in: GOPTIONS statement
Default: STD
302 GOUTMODE Chapter 8
Restriction: used only with IBM3287 and IBM3268 device drivers on z/OS systems only
Syntax
GFORMS=’forms-code’
GOUTMODE
Appends to or replaces the graphics output catalog.
Used in: GOPTIONS statement
Default: APPEND
Restriction: not supported by Java or ActiveX
Syntax
GOUTMODE=APPEND | REPLACE
APPEND
adds each new graph to the end of the current catalog.
REPLACE
replaces the contents of the catalog with the graph or graphs produced by a single
procedure.
CAUTION:
If you specify REPLACE, the entire contents of the catalog are replaced, not just graphs of
the same name. Graphs are added to the catalog for the duration of the procedure,
but when the procedure ends and a new procedure begins, the contents of the catalog
are deleted and the new graph or graphs are added. 4
GPROLOG
Sends a string to device or file before graphics commands are sent.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Gprolog window
Restriction: not supported by Java or ActiveX
See also: PREGPROLOG, POSTGPROLOG
Syntax
GPROLOG=’string’ < ...’string-n’>
Graphics Options and Device Parameters Dictionary GPROTOCOL 303
’string’
can be either of the following:
’hex-string’X
’character-string’
In a GOPTIONS statement or in the GDEVICE procedure ADD or MODIFY
statement, you can specify multiple strings with the GPROLOG= option. In this case,
you can mix the formats, specifying some as ASCII hexadecimal strings and some as
character strings. Multiple strings are concatenated automatically.
In the GPROLOG window, enter the hexadecimal string without either quotation
marks or a trailing x. Note, however, that the string must be entered as a
hexadecimal string.
PROC GOPTIONS always reports the value as a hexadecimal string.
Details
GPROLOG can be used in conjunction with the GEPILOG= graphics option or device
parameter.
If you must specify the long and complicated initialization strings required by some
devices (for example, PostScript printers), it is easier to use the GOPTIONS
GPROLOG= option rather than the GDEVICE Gprolog window because it is easier to
code the string as text with GPROLOG= than it is to convert the string to its ASCII
representation, which is required to enter the string in the GDEVICE Gprolog window.
Note: On non-ASCII hosts, only ASCII hexadecimal strings produce consistent
results in all instances because of the way the character strings are translated. In
addition, the only way to specify a value for GEND that can be used by all hosts is to
use an ASCII hexadecimal string; therefore, using an ASCII hexadecimal string to
specify a value for GEND is the recommended method. 4
GPROTOCOL
Specifies the protocol module to use when routing output directly to a printer or creating a
graphics stream file (GSF) to send to a device attached to your host by a protocol converter.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Restriction: not supported by Java or ActiveX
Default: host dependent
Syntax
GPROTOCOL=module-name
SASGPASC
SASGPAXI*
SASGPCAB*
SASGPCHK*
SASGPDAT*
SASGPDCA*
SASGPHEX
SASGPHYD*
SASGPIDA*
SASGPIDX*
SASGPIMP*
SASGPIOC*
SASGPISI*
SASGPI24*
SASGPLCL*
SASGPNET*
SASGPMIC*
SASGPRTM*
SASGPSCS*
SASGPSTD
SASGPSTE*
SASGPTCX*
SASGPVAT*
SASGP497*
SASGP71
*Valid only for IBM mainframe systems.
Details
GPROTOCOL= specifies whether the graphics data generated by the SAS/GRAPH
device driver should be altered and how the data should be altered. Unless you are
using a protocol converter on an IBM mainframe, most devices do not require that the
data be altered, and ordinarily, you do not have to change the default of GPROTOCOL.
On IBM hosts, the protocol module converts the graphics output to a format that can
be processed by protocol converters. On other hosts, it can be used to produce a file in
ASCII hexadecimal format.
Refer to the SAS Help facility for descriptions of these protocol modules.
Operating Environment Information: GPROTOCOL is valid only in certain operating
environments. 4
Graphics Options and Device Parameters Dictionary GSFLEN 305
GRAPHRC
Specifies whether to return a step code at graphics procedure termination.
Used in: GOPTIONS statement
Restriction:not supported by Java or ActiveX
Default: GRAPHRC
Syntax
GRAPHRC | NOGRAPHRC
GRAPHRC
allows a return code at procedure termination. If the return code is not 0, the entire
job may terminate.
NOGRAPHRC
always returns a step code of 0, even if the SAS/GRAPH program produced errors.
As a result, the entire job’s return code is unaffected by errors in any graphics
procedure. NOGRAPHRC also overrides the ERRABEND system option.
Details
You typically use this option when you are running multiple jobs in a batch
environment. It is useful primarily in an z/OS batch environment.
GSFLEN
Controls the length of records written to the graphics stream file (GSF).
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: PROMPTCHARS
Syntax
GSFLEN=record-length
record-length
must be a nonnegative integer up to five digits long (0...99999). GSFLEN= specifies
the length of the records written by the driver to a GSF or to the device.
If GSFLEN is 0, SAS/GRAPH uses the sixth byte of the PROMPTCHARS string to
determine the length of the records. If the sixth byte of the PROMPTCHARS string
is 00, the device driver sets the record length.
306 GSFMODE Chapter 8
GSFMODE
Specifies the disposition of records written to a graphics stream file (GSF) or to a device or
communications port by the device driver.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: REPLACE
Restriction: not supported by Java or ActiveX
See also: GACCESS, GSFNAME
Syntax
GSFMODE=APPEND | PORT | REPLACE
APPEND
adds the records to the end of a GSF designated by the GACCESS= or GSFNAME=
graphics option or device parameter. If the file does not already exist, it is created.
The destination can be either a specific file or an aggregate file storage location.
If the destination of the GSF is a specific file and you specify APPEND,
SAS/GRAPH will add the new records to an existing GSF of the same name.
If the destination of the GSF is a file location and not a specific file, SAS/GRAPH
will add the records to an external file whose name matches the name of the newly
created catalog entry. For more information on how SAS/GRAPH names catalog
entries, see “Exporting SAS/GRAPH Output with Program Statements” on page 62.
Note: Some viewers of bitmapped output can view only one graph, even though
multiple graphs are stored in the file. Therefore it may appear that a file contains
only one graph when in fact it contains multiple graphs. 4
PORT
sends the records to a device or communications port. The GACCESS= graphics
option or device parameter should point to the desired port or device.
REPLACE
replaces the existing contents of a GSF designated by the GACCESS= or
GSFNAME= graphics option or device parameter. If the file does not exist, it is
created. REPLACE is always the default, regardless of the destination of the GSF.
If the destination of the GSF is a specific file and you specify REPLACE,
SAS/GRAPH will replace an existing GSF with the contents of a newly created GSF
of the same name.
Graphics Options and Device Parameters Dictionary GSFNAME 307
If the destination of the GSF is a file location and not a specific file, SAS/GRAPH
will replace an external file whose name matches the name of the newly created
catalog entry. For more information on how SAS/GRAPH names catalog entries, see
“Exporting SAS/GRAPH Output with Program Statements” on page 62.
Details
When you create a GSF, the GSFNAME= or GACCESS= graphics option or device
parameter controls where the output goes, and GSFMODE= controls how the driver
writes graphics output records. If the output is to go to a file, specify APPEND or
REPLACE. If the output is to go directly to a device or to a communications port,
specify PORT. See “About Graphics Stream Files” on page 60 for more information on
creating a graphics stream file.
GSFNAME
Specifies the fileref of the file or aggregate file location to which graphics stream file records are
written.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Restriction: Not valid for IBM32xx, linkable, Metagraphics, Java, or ActiveX drivers.
See also: GACCESS, GSFMODE
Syntax
GSFNAME=fileref
fileref
specifies a fileref that points to the destination for the graphics stream file (GSF)
output. Fileref must be a valid SAS fileref up to eight characters long and must be
assigned with a FILENAME statement prior to running a SAS/GRAPH procedure
that uses that fileref. The destination specified by the FILENAME statement can be
either a specific file or an aggregate file location. See “FILENAME Statement” on
page 28 for additional information on the FILENAME statement.
Details
Whether the resulting graphs are stored as one file or many files depends on both the
type of destination and the setting of the GSFMODE= option.
If you specify a fileref with GSFNAME= and forget the FILENAME statement that
defines the fileref, and if a destination is specified by the GACCESS= graphics option or
device parameter, SAS/GRAPH assigns that destination to the fileref and sends the
graphics output there. See also “GACCESS” on page 296.
See “About Graphics Stream Files” on page 60 for more information on creating
graphics stream files.
308 GSFPROMPT Chapter 8
GSFPROMPT
Specifies whether to write prompt messages to the graphics stream file (GSF).
Used in: GOPTIONS statement
Default: NOGSFPROMPT
Restriction: not supported by Java or ActiveX
Syntax
GSFPROMPT | NOGSFPROMPT
Details
When the GSF is processed by another program, that program can display the
prompt messages. The default, NOGSFPROMPT, is compatible with Release 6.06.
Although the prompt messages appear if the graphics device is in eavesdrop mode,
they do not wait for user response. If GSFPROMPT is on, the prompt messages are
sent with the GSF to the device, regardless of the status of the graphics options
PROMPT, GACCESS=, GSFMODE=, or GSFNAME=.
GSIZE
Sets the number of lines of display used for graphics for devices whose displays can be divided
into graphics and text areas.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Restriction: not supported by Java or ActiveX
Default: device dependent
Syntax
GSIZE=lines
lines
specifies the number of lines to be used for graphics. Lines is a nonnegative integer
up to three digits long (0...999), and can be larger or smaller than the total number of
lines that can be displayed at one time. If the number is larger, scroll the graph to
see it all. If GSIZE is 0, all lines are used for text.
GSTART
Prefixes every record of graphics data sent to a device or file with a string of characters.
Graphics Options and Device Parameters Dictionary GUNIT 309
Syntax
GSTART=’string <...’string-n’>
’string’
can be either of the following:
’hex-string’X
’character-string’
In a GOPTIONS statement or in the GDEVICE procedure ADD or MODIFY
statement, you can specify multiple strings with the GSTART= option. In this case,
you can mix the formats, specifying some as ASCII hexadecimal strings and some as
character strings. Multiple strings are concatenated automatically.
In the GSTART window, enter the hexadecimal string without either quotation
marks or a trailing x. Note, however, that the string must be entered as a
hexadecimal string.
PROC GOPTIONS always reports the value as a hexadecimal string.
Details
GSTART is useful when sending a file to a device that requires each record be prefixed
with some character. You can use GSTART= in conjunction with the GEND= graphics
option or device parameter.
If you must specify the long and complicated initialization strings required by some
devices (for example, PostScript printers), it is easier to use the GOPTIONS GSTART=
option rather than the GDEVICE Gstart window because it is easier to code the string
as text with GSTART= than it is to convert the string to its ASCII representation,
which is required to enter the string in the GDEVICE Gstart window.
Note: On non-ASCII hosts, only ASCII hexadecimal strings produce consistent
results in all instances because of the way the character strings are translated. In
addition, the only way to specify a value for GEND that can be used by all hosts is to
use an ASCII hexadecimal string; therefore, using an ASCII hexadecimal string to
specify a value for GEND is the recommended method. 4
GUNIT
Specifies the default unit of measure to use with height specifications.
Used in: GOPTIONS statement
Default: CELLS
Restriction: partially supported by Java or ActiveX
310 GWAIT Chapter 8
Syntax
GUNIT=units
units must be one of
CELLS character cells
CM centimeters
IN inches
PCT percentage of the graphics output area
PT points (there are approximately 72 points in an inch).
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values” on
page 226 and “Example 3. Rotating Plot Symbols through the Colors List” on page
231
Details
Used with options in the AXIS, FOOTNOTE, LEGEND, NOTE, SYMBOL, and TITLE
statements and in some graphics options. If you specify a value but do not specify an
explicit unit, the value of the GUNIT= graphics option is used.
GWAIT
Specifies the time between each graph displayed in a series.
Used in: GOPTIONS statement
Default: GWAIT=0
Restriction: not supported by Java or ActiveX
Syntax
GWAIT=seconds
seconds
specifies the number of seconds between graphs. Seconds can be any reasonable
positive integer. By default, GWAIT=0, which means that you must press the
RETURN key between each display in a series of graphs.
Details
GWAIT= enables you to view a series of graphs without having to press the ENTER key
(or the RETURN or END key, depending on your device) between each display. For
example, if you specify GWAIT=5, five seconds elapse between the display of each graph
in a series. If you use the NOPROMPT graphics option, the GWAIT= graphics option is
disabled.
Graphics Options and Device Parameters Dictionary HANDSHAKE 311
GWRITER
Specifies the name of the external writer used with IBM printers.
Used in: GOPTIONS statement
Default: SASWTR
Restriction: Used only with IBM3287 and IBM3268 device drivers on z/OS systems
Syntax
GWRITER=’writer-name’
HANDSHAKE
Specifies the type of flow control used to regulate the flow of data to a hardcopy device.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: host dependent
Restriction: not supported by Java or ActiveX
Syntax
HANDSHAKE=HARDWARE | NONE | SOFTWARE | XONXOFF
HARDWARE
HARD
specifies that SAS/GRAPH instruct the device to use the hardware CTS and RTS
signals. (This is not appropriate for some devices.)
NONE
specifies that SAS/GRAPH send data without providing flow control. Specify NONE
only if the hardware or interface program you are using provides its own flow control.
SOFTWARE
SOFT
specifies that SAS/GRAPH use programmed flow control with plotters in eavesdrop
mode.
XONXOFF
X
specifies that SAS/GRAPH instruct the device to use ASCII characters DC1 and DC3.
(This is not appropriate for some devices.)
Details
HANDSHAKE regulates flow of control by specifying how and if a device can signal to
the host to temporarily halt transmission and then resume it. Flow control is important
312 HBY Chapter 8
because it is possible to send commands to a hardcopy device faster than they can be
executed.
HANDSHAKE can be used when you are using a protocol converter, interface
program, or host computer that can perform XONXOFF or hardware handshaking. You
also can use this option if you are routing output through flow-control programs of your
own, as in a multiple-machine personal computer environment where the graphics
plotter is a shared resource. SAS/GRAPH software sends output to a server (the file
transfer does not require flow control). The server queues incoming graphs and sends
them to the plotter. The server, rather than SAS/GRAPH software, is responsible for
handling flow control.
If you do not use HANDSHAKE, the value in the driver entry is used.
If you use HANDSHAKE=XONXOFF or HANDSHAKE=HARDWARE, SAS/GRAPH
does not actually do the handshaking. It tells the device which type of handshake is
being used. The protocol converter, interface program, or host computer actually does
the handshake.
Note: If you are creating a graphics stream file using a driver for a plotter and you
specify HANDSHAKE=SOFTWARE, the software that you use to send the file to the
plotter must be able to perform a software handshake. You will probably want to
specify one of the alternative values if you route output to a file. 4
HBY
Specifies the height of BY lines generated when you use BY-group processing.
Syntax
HBY=BY-line-height <units>
BY-line-height <units>
specifies the height of BY-line text; by default BY-line-height is 1. If you specify
HBY=0, the BY headings are suppressed. For a description of units, see “Specifying
Units of Measurement” on page 262.
Note: If a value for units is not specified, the current units associated with the
GUNIT graphics option are used. 4
Details
When you use a BY statement with a SAS/GRAPH procedure to process a data set in
subgroups, each graph produced by that procedure is headed by a BY line that displays
the BY variables and their values that define the current subgroup.
Graphics Options and Device Parameters Dictionary HEADERFILE 313
HEADER
Specifies the command that executes a user-supplied program to create HEADER records for the
driver.
Syntax
HEADER=’command’
command
specifies a command that runs a user-written program that creates the file of
HEADER records. Command is a string up to 40 characters long.
Details
For information about Metagraphics drivers, contact Technical Support.
HEADERFILE
Specifies the fileref for the file from which the Metagraphics driver reads HEADER records.
Syntax
HEADERFILE=fileref
fileref
specifies a valid SAS fileref up to eight characters long. Fileref must have been
previously assigned with a FILENAME statement or a host command before running
the Metagraphics driver. See “FILENAME Statement” on page 28 for details.
Details
For information about Metagraphics drivers, contact Technical Support.
314 HORIGIN Chapter 8
HORIGIN
Sets the horizontal offset from the lower-left corner of the display area to the lower-left corner of
the graph.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: not supported by Java or ActiveX
See also: VORIGIN
Syntax
HORIGIN=horizontal-offset < IN | CM | PT>
Details
The display area is defined by the XMAX and YMAX device parameters. By default, the
origin of the graphics output area is the lower-left corner of the display area; the
graphics output is offset from the lower-left corner of the display area by the values of
HORIGIN and VORIGIN. HORIGIN + HSIZE cannot exceed XMAX. See “About the
Graphics Output Area” on page 34 for details.
HOSTSPEC
Stores FILENAME statement options in the device entry.
Used in: GDEVICE procedure; GDEVICE Host File Options window
Syntax
HOSTSPEC=’text-string’
text-string
specifies FILENAME statement options that are valid for the operating environment.
Text-string accepts characters in upper or lower case. See the SAS documentation for
your operating environment for details.
Graphics Options and Device Parameters Dictionary HSIZE 315
Details
HOSTSPEC may be used when the driver dynamically allocates a graphics stream file
or spool file. It can specify the attributes of the file, such as record format or record
length. It cannot be used with Metagraphics drivers.
HPOS
Specifies the number of columns in the graphics output area.
Used in: GOPTIONS statement
Default: device dependent: the value of the LCOLS or PCOLS device parameter
Restriction: not supported by Java or ActiveX
See also: PCOLS, LCOLS, VPOS
Syntax
HPOS=columns
columns
specifies the number of columns in the graphics output area, which is equivalent to
the number of hardware characters that can be displayed horizontally. Specifying
HPOS=0 causes the device driver to use the default hardware character cell width for
the device.
Details
The HPOS= graphics option overrides the values of the LCOLS or PCOLS device
parameters and temporarily sets the number of columns in the graphics output area.
HPOS= does not affect the width of the graphics output area but merely divides it into
columns. Therefore, you can use HPOS= to control cell width.
The values specified in the HPOS= and VPOS= graphics options determine the size
of a character cell for the graphics output area and consequently the size of many
graphics elements, such as hardware text. The larger the size of the HPOS= and
VPOS= values, the smaller the size of each character cell.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
HSIZE
Sets the horizontal size of the graphics output area.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: partially supported by Java or ActiveX
See also: VSIZE, XMAX
316 HTEXT Chapter 8
Syntax
HSIZE=horizontal-size <IN | CM | PT>
Featured in: “Example 3. Rotating Plot Symbols through the Colors List” on page
231
HTEXT
Specifies the default height of the text in the graphics output.
Used in: GOPTIONS statement
Default: 1 cell
Restriction: partially supported by Java
Syntax
HTEXT=text-height <units>
text-height <units>
specifies the height of the text; by default text-height is 1. For a description of units,
see “Specifying Units of Measurement” on page 262.
Note: If a value for units is not specified, the current units associated with the
GUNIT graphics option are used. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values” on
page 226
Details
HTEXT= is overridden by the HTITLE= graphics option for the first TITLE line.
Graphics Options and Device Parameters Dictionary IBACK 317
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
HTITLE
Selects the default height used for the first TITLE line.
Used in: GOPTIONS statement
Default: 2 cells unless HTEXT= is used
Syntax
HTITLE=title-height <units>
title-height <units>
specifies the height of the text in the TITLE1 statement. By default, title-height is 2.
For a description of units, see “Specifying Units of Measurement” on page 262.
Note: If a value for units is not specified, the current units associated with the
GUNIT graphics option are used. 4
Featured in: “Example 1. Ordering Axis Tick Marks with SAS Datetime Values” on
page 226
Details
If you omit HTITLE=, TITLE1 uses the height specified by the HTEXT= graphics
option, if used.
Note: When you use ODS to send graphics to an HTML destination, and titles and
footnotes are rendered as part of the HTML body file instead of the graphic image, you
must specify the ODS USEGOPT statement for this option to work. See “Controlling
Titles and Footnotes with ODS Output” on page 492 for more information. 4
IBACK
Specifies an image file to display in a graph’s background area.
partially supported by Java
Restriction:
See also: CBACK, IMAGESTYLE
Syntax
IBACK=fileref | ’external-file’ | ’URL’
318 ID Chapter 8
fileref
specifies a fileref that points to the image file you want to use. Fileref must be a valid
SAS fileref up to eight characters long and must have been previously assigned with
a FILENAME statement.
external-file
specifies the complete file name of the image file you want to use. The format of
external-file varies across operating environments.
URL
specifies the URL of the image file that you want to use.
Details
The image can be used with any procedures that produce a picture or support the
CBACK= option. The IBACK option is supported by the Graph applet and the Map
applet, but it is not supported by the Contour applet. See Chapter 9, “Introducing SAS/
GRAPH Output for the Web,” on page 369 for information about these applets.
This option overrides the BackGroundImage and Image styles attribute in the graph
styles. For more information on graph styles, refer to the TEMPLATE procedure
documentation in SAS Output Delivery System: User’s Guide.
ID
Specifies the description string used by the Metagraphics driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
ID=’description’
description
is a character string up to 70 characters long. If this field is blank, the name and
description of the graph as specified in the PROC GREPLAY window of the
GREPLAY procedure are used.
Details
For information about Metagraphics drivers, contact Technical Support.
IMAGEPRINT
Enables or disables image output
Used in: GOPTIONS statement
Graphics Options and Device Parameters Dictionary INTERACTIVE 319
Default: IMAGEPRINT
Restriction: not supported by Java or ActiveX
Syntax
IMAGEPRINT | NOIMAGEPRINT
IMAGEPRINT
default value specifies that any images are to be included in graphics output.
NOIMAGEPRINT
specifies that images are to be withheld from graphics output.
IMAGESTYLE
Specifies the way to display the image file that is specified on the IBACK= option.
Default: TILE
Restriction: not supported by Java
Syntax
IMAGESTYLE= TILE | FIT
TILE
tile the image within the specified area. This copies the images as many times as
needed to fit the area.
FIT
fit the image within the background area. This stretches the image, if necessary.
Details
Note: This option overrides the BackGroundImage and Image styles attribute in the
graph styles. For more information on graph styles, refer to the TEMPLATE procedure
documentation in SAS Output Delivery System: User’s Guide. 4
INTERACTIVE
Sets level of interactivity for Metagraphics driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Default: USER
Restriction: Used only with user-supplied Metagraphics drivers.
320 INTERLACED Chapter 8
Syntax
INTERACTIVE=USER | GRAPH | PROC
USER
specifies that the user-written part of the driver be executed outside of SAS/GRAPH.
PROC
specifies that the user-written part of the Metagraphics driver be invoked after the
procedure is complete.
GRAPH
specifies that the user-written part be invoked for each graph.
Details
For information about Metagraphics drivers, contact Technical Support.
INTERLACED
Specifies whether images are to be displayed as they are received in the browser.
Used in: GOPTIONS statement
Default: NONINTERLACED
Restriction: driver dependent, GIF series of drivers only
Syntax
INTERLACED | NONINTERLACED
Details
With interlacing it is possible to get a rough picture of what a large image will look
like before it is completely drawn in your browser. Your browser may allow you to set
an option that will determine how images are displayed.
INTERPOL
Sets the default interpolation value for the SYMBOL statement.
Used in: GOPTIONS statement
Restriction: not supported by Java or ActiveX
Syntax
INTERPOL=interpolation-method
Graphics Options and Device Parameters Dictionary KEYMAP 321
interpolation-method
specifies the default interpolation to be used when the INTERPOL= option is not
specified in the SYMBOL statement. See “SYMBOL Statement” on page 183 for the
complete syntax of all interpolation methods.
ITERATION
Specifies the number of times to repeat the animation loop.
Used in: GOPTIONS statement
Default: 0
Restriction: GIFANIM driver only
Syntax
ITERATION=iteration-count
iteration-count
specifies the number of times that your complete GIF animation loop is repeated. It
is assumed that the animation is always played once; this option specifies how many
times the animation is repeated. Iteration-count can be a number from 0...65535. A
value of 0 causes the animation to loop continuously.
Details
In Version 6, the GCOPIES graphics option controlled iteration for the GIFANIM driver.
KEYMAP
Selects the keymap to use.
Used in: GOPTIONS statement
Default: installation dependent
Restriction: not supported by Java or ActiveX
Syntax
KEYMAP=key-map-name | NONE
key-map-name
specifies the name of a keymap. See Chapter 34, “The GKEYMAP Procedure,” on
page 983 for details.
322 LCOLS Chapter 8
NONE
suppresses the keymap assigned by default to a non-U.S. keyboard. If you specify
KEYMAP=NONE, text may display incorrectly or not at all.
Details
Non-default key maps usually are used only with non-U.S. keyboards.
LCOLS
Sets the number of columns in the graphics output area for landscape orientation.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: HPOS, LROWS, PCOLS
Syntax
LCOLS=landscape-columns
landscape-columns
must be a nonnegative integer up to three digits long (0...999).
Details
Either the LROWS and LCOLS pair of device parameters or the PROWS and PCOLS
pair of device parameters are required and must be nonzero.
The HPOS= graphics option overrides the value of LCOLS.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
LFACTOR
Selects the default hardware line thickness.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Used only with devices that can draw hardware lines of varying
Restriction:
thicknesses. Not supported by Java or ActiveX.
Syntax
LFACTOR=line-thickness-factor
Graphics Options and Device Parameters Dictionary MAXCOLORS 323
line-thickness-factor
can range from 0 through 9999. A value of 0 for LFACTOR is the same as a factor of
1. Lines are drawn line-thickness-factor times as thick as normal.
Details
LFACTOR is useful when you are printing graphics output on a plotter. Depending on
the orientation and type of device, some plotters may require LFACTOR=10 to get the
same thickness of lines as on the display of some devices.
LROWS
Sets the number of rows in the graphics output area for landscape orientation.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: LCOLS, PROWS, VPOS
Syntax
LROWS=landscape-rows
landscape-rows
is a nonnegative integer up to three digits long (0...999).
Details
Either the LROWS and LCOLS pair of device parameters or the PROWS and PCOLS
pair of device parameters are required and must be nonzero.
The VPOS= graphics option overrides the value of LROWS.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
MAXCOLORS
Sets the total number of colors that can be displayed at once.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
See also: PENMOUNTS
Syntax
MAXCOLORS=number-of-colors
324 MAXPOLY Chapter 8
number-of-colors
must be an integer in the range 2 through 256. The total number of colors includes
the foreground colors plus the background color.
Details
The PENMOUNTS= graphics option overrides the value of MAXCOLORS.
MAXPOLY
Sets the maximum number of vertices for hardware-drawn polygons.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Syntax
MAXPOLY=number-of-vertices
number-of-vertices
is a nonnegative integer up to four digits long. A value of 0 means that there is no
limit to the number of vertices that can be specified in the hardware’s
polygon-drawing command. The maximum value of MAXPOLY depends on the
number of vertices your device can process.
MODEL
Specifies the model number of the output device.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
Syntax
MODEL=model-number
model-number
is a nonnegative integer up to five digits long that is the Institute-designated model
number for the corresponding device. It is not the same as a manufacturer’s model
number.
Details
Do not change this field in Institute-supplied drivers or in drivers that you copy from
Institute-supplied drivers.
Graphics Options and Device Parameters Dictionary OFFSHADOW 325
MODULE
Specifies the name of the corresponding executable driver module for the device.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
Syntax
MODULE=driver-module
driver-module
is a literal string up to eight characters long. All standard driver modules begin with
the characters SASGD.
Details
Do not change this field in Institute-supplied drivers or in drivers that you copy from
Institute-supplied drivers.
NAK
Specifies the negative response for software handshaking for Metagraphics drivers.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
NAK=’negative-handshake-response’X
negative-handshake-response
is a hexadecimal string up to 16 characters long.
Details
For information about Metagraphics drivers, contact Technical Support.
OFFSHADOW
Controls the width and depth of the drop shadow in legend frames.
Used in: GOPTIONS statement
326 PAPERDEST Chapter 8
Syntax
OFFSHADOW=(x <units>, y <units>) | (x,y) <units>
x,y
specify the width (x) and depth (y) of the drop shadow generated by the LEGEND
statement.
If a value for units is not specified, the current units associated with the GUNIT
graphics option are used. For a description of units, see “Specifying Units of
Measurement” on page 262.
Details
The values specified by OFFSHADOW= are used with the CSHADOW= and CBLOCK=
options in a LEGEND statement. For details, see “LEGEND Statement” on page 151.
PAPERDEST
Specifies which output bin the printer should use if multiple bins are available on the device.
Used in: GOPTIONS statement; OPTIONS statement
Default: 1 (the upper output bin)
Restrictions: hardware dependent, PostScript printers require a PPD file; not supported
by Java or ActiveX
See also: PAPERSOURCE, PPDFILE
Syntax
PAPERDEST=bin
bin
specifies the name or number of the output bin. Values for bin depend on the type of
printer and can be one of the following:
bin the name or number of the output bin – for example,
PAPERDEST=4, PAPERDEST=BIN2, PAPERDEST=SIDE
’long bin name’ a character string that is the name of the output bin – for
example, PAPERDEST=’Top Output Bin’. Names with blanks or
special characters must be quoted.
For PostScript printers, the value for bin must correspond to an OutputBin value
in the PPD file.
For PCL printers, consult the printer’s documentation for valid bin values. If a
numeric value exceeds the maximum bin value allowed for the printer, a warning
Graphics Options and Device Parameters Dictionary PAPERLIMIT 327
message is issued . For string values, the string is checked against a list of strings
that are valid for the driver (for example, ’UPPER’, ’LOWER’, or
’OPTIONALOUTBINn’, where n is the bin number). If the string is not valid for the
driver, a warning message is issued.
PAPERFEED
Specifies the increment of paper that is ejected when a graph is completed.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Default: PAPERFEED=0.0 IN
Restriction: device dependent; not supported by Java or ActiveX
Syntax
PAPERFEED=feed-increment <IN | CM>
Details
PAPERFEED does not control the total length of the ejection. If you specify
PAPERFEED=1, the driver ejects paper in 1-inch increments until the total amount of
paper ejected is at least half an inch greater than the size of the graph last printed. If
you specify PAPERFEED=8.5 IN, the paper is ejected in increments of 8.5 inches,
measuring from the origin of the first graph.
PAPERFEED is provided mainly for plotters that use fanfold or roll paper. If you are
using fanfold paper, specify a value for PAPERFEED that is equal to the distance
between the perforations.
PAPERLIMIT
Sets the width of the paper used with plotters.
Used in: GOPTIONS statement
Default: maximum dimensions specified in the device driver
Restriction: ZETA plotters and KMW rasterizers
Syntax
PAPERLIMIT=width <IN | CM>
328 PAPERSIZE Chapter 8
Details
If you want to use a driver with a device that has a larger plotting area than the device
for which the driver is intended (for example, using the ZETA887 driver with a ZETA
836 plotter), the PAPERLIMIT= graphics option can be used to override the size limit of
the driver.
PAPERSIZE
Specifies the name of a paper size.
Used in: GOPTIONS statement; OPTIONS statement
Default: device dependent
Restriction: hardware dependent, PostScript printers require a PPD file; not supported
by Java or ActiveX
See also: PAPERSOURCE, PPDFILE
Syntax
PAPERSIZE=’size-name’
size-name
specifies the name of a paper size, such as LETTER, LEGAL, or A4.
If you do not specify PAPERSIZE=, the PAPERSIZE= setting on an OPTIONS
statement is used. If no OPTIONS statement sets a paper size, the value for paper
size is device dependent:
3 The universal printing devices use the size specified in the Page Setup dialog.
3 All other printer devices use the LETTER paper size.
Details
Typically, you might use PAPERSIZE= with the Output Delivery System (ODS). For
some printers, PAPERSIZE= overrides the PAPERSOURCE= selection.
For PostScript devices, the name must match the name of a paper size in the PPD
file. Refer to the PPD file for a list of valid names. Size-name is case-insensitive and
can contain a subset of the full name. For example, if the name in the PPD file is
*PageSize A4/A4, you can specify PAPERSIZE=’A4’. If a PPD file is not specified,
PAPERSIZE= is ignored.
For PCL devices, the device driver searches the SAS Registry for supported paper
size values. To see the supported list of sizes, submit the following statements:
proc registry listhelp
startat=’options\papersize’;
run;
Graphics Options and Device Parameters Dictionary PAPERTYPE 329
For more information about the SAS Registry, refer to the SAS Help facility.
PAPERSOURCE
Specifies which paper tray the printer should use if multiple trays are available on the device.
Used in: GOPTIONS statement; OPTIONS statement
Default: device dependent
Restriction: hardware dependent, PostScript printers require a PPD file; not supported
by Java or ActiveX
See also: PAPERDEST, PAPERSIZE, PPDFILE
Syntax
PAPERSOURCE=tray
tray
specifies the name or number of the paper tray. Values for tray depend on the type of
printer and can be one of the following:
tray the name or number of the paper tray, for example,
PAPERSOURCE=3, PAPERSOURCE=TRAY3,
PAPERSOURCE=Upper
’long tray name’ a character string that is the name of the paper tray, for example,
PAPERSOURCE=’Optional Output Tray’. Names with blanks or
special characters must be quoted.
Details
On some printers, if PAPERSIZE= is also specified, it overrides the setting on
PAPERSOURCE=.
For PostScript printers, a tray number, such as PAPERSOURCE=’tray3’, must
correspond to an InputSlot value in the PPD file.
For PCL printers, consult the printer’s documentation for valid tray values. If a
numeric value exceeds the maximum tray value allowed for the printer, a warning
message is issued . For string values, the string is checked against a list of strings that
are valid for the driver:
3 ’AUTO’
3 ’HCI’ or ’HCIn’, where n is a number from 2 to 21
3 ’MANUAL’
3 ’MANUAL_ENVELOPE’
3 ’TRAYn’, where n is 1, 2, or 3.
If the string is not valid for the driver, a warning message is issued.
PAPERTYPE
Specifies the name of a paper type.
330 PATH Chapter 8
Syntax
PAPERTYPE=’type-name’
type-name
specifies the name of a paper type. Valid values depend on the type of printer.
For PostScript devices, type-name must match the name of a paper type in the
PPD file, such as TRANSPARENCY or PLAIN. Refer to the PPD file for a list of valid
names. Type-name is case-insensitive and can contain a subset of the full name. For
example, if the name in the PPD file is *MediaType Plain/Paper you can specify
PAPERTYPE=’PLAIN/PAPER’.
For PCL devices, type-name specifies the name of a paper type that is available on
the current printer, such as GLOSSY, PLAIN, SPECIAL, or TRANSPARENCY.
Consult your printer’s user manual for the complete list of available paper types on
your printer.
Details
For PostScript devices, if a PPD file is not specified, PAPERTYPE= is ignored.
PATH
Sets the increment of the angle for hardware text rotation.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Default: PATH=0
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
PATH=angle-increment
angle-increment
is an integer in the range 0 to 360 that specifies the angle at which to rotate the text
baseline. A value of 0 means that the device uses its default orientation. Specify 0 if
your device does not perform string angling in hardware.
Details
For information about Metagraphics drivers, contact Technical Support.
Graphics Options and Device Parameters Dictionary PCLIP 331
PCLIP
Specifies whether a clipped polygon is stored in its clipped or unclipped form.
Used in: GOPTIONS statement
Default: NOPCLIP
Restriction: not supported by Java or ActiveX
See also: POLYGONCLIP
Syntax
PCLIP |NOPCLIP
PCLIP
stores clipped polygons with the graph in the default catalog WORK.GSEG, or in the
catalog you specify.
NOPCLIP
stores the unclipped form of the polygon and causes the polygon to be clipped when
replayed.
Details
The effects of this option are only seen when you use the graphics editor to edit a graph.
When a procedure produces a graph with intersecting polygons or blanking areas, it
clips portions of the polygons to prevent the ones behind from showing through. When
the graph is created and stored in a catalog, if PCLIP is in effect, the clipped form of
the polygon is stored with it. If NOPCLIP is specified, the complete polygon is stored in
the catalog and the graph is clipped each time it is replayed.
For example, suppose you create a block map like the one in Figure 8.1 on page 331.
The block clips the boundary of the map area polygon. If you specify PCLIP, the map
area polygon is stored in its clipped form, as shown in Figure 8.2 on page 332.
332 PCOLS Chapter 8
NOPCLIP stores the map area in its unclipped form, as shown in Figure 8.3 on page
332.
In this case, when the graph is recalled from the catalog, the map area polygon must
be clipped before it is displayed with the block. If you plan to edit the graph with the
graphics editor, specify NOPCLIP so polygons retain their original form.
PCOLS
Sets the number of columns in the graphics output area for portrait orientation.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: HPOS, LCOLS, PROWS
Syntax
PCOLS=portrait-columns
portrait-columns
must be a nonnegative integer up to three digits long (0...999).
Details
Either the LROWS and LCOLS pair of device parameters or the PROWS and PCOLS
pair of device parameters are required and must be nonzero.
The HPOS= graphics option overrides the value of PCOLS.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
Graphics Options and Device Parameters Dictionary PENSORT 333
PENMOUNTS
Specifies the number of active pens or colors.
Used in: GOPTIONS statement
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: MAXCOLORS
Syntax
PENMOUNTS=active-pen-mounts
active-pen-mounts
specifies the number of pens for a plotter with multiple pens. After the specified
number of pens have been used, you are prompted to change the pens.
Details
For devices that are not pen plotters, PENMOUNTS= can be used to indicate the
number of colors that can be displayed at one time. In this case, PENMOUNTS=
performs the same function as the MAXCOLORS device parameter except that the
value specified for MAXCOLORS includes the background color and PENMOUNTS only
refers to foreground colors. Thus, PENMOUNTS=4 implies MAXCOLORS=5.
PENMOUNTS= overrides the value of the MAXCOLORS device parameter. You can
specify MAXCOLORS= in a GOPTIONS statement as a synonym for PENMOUNTS=.
PENSORT
Specifies whether plotters draw graphics elements in order of color.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Restriction: not supported by Java or ActiveX
Default: device dependent
Syntax
GOPTIONS: PENSORT | NOPENSORT
GDEVICE: PENSORT=Y | N
PENSORT
PENSORT=Y
causes the plotter to draw all graphics elements of one color at one time. For
example, it draws all the red elements in the output, then all the blue elements, and
334 PIEFILL Chapter 8
so forth. This specification is compatible with previous releases. Use it for plotters
with real pens.
NOPENSORT
PENSORT=N
causes the plotter to draw each element as it is encountered, regardless of its color.
For example, the plotter might draw a red circle, then a blue line, and then a red
line, and so forth. This method is best for electrostatic printers implemented with
Metagraphics drivers of TYPE=PLOTTER. In addition, NOPENSORT enables you to
specify non-standard color names.
PIEFILL
Specifies whether to use the device’s hardware pie-fill capability.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: PIEFILL | NOPIEFILL
GDEVICE: PIEFILL=Y | N
PIEFILL
PIEFILL=Y
causes SAS/GRAPH to use the built-in hardware capability of the device, if available,
to fill pies and pie sections. A blank Piefill field in the Parameters window is the
same as PIEFILL=Y.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
does not try to use the capability if your device does not support it.
NOPIEFILL
PIEFILL=N
causes SAS/GRAPH to fill pies and pie sections using software pie fills.
POLYGONCLIP
Specifies the type of clipping used when two polygons overlap.
Used in: GOPTIONS statement
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: PCLIP
Graphics Options and Device Parameters Dictionary POLYGONFILL 335
Syntax
POLYGONCLIP | NOPOLYGONCLIP
POLYGONCLIP
specifies polygon clipping, which enables a clipped polygon to be filled with a
hardware pattern. POLYGONCLIP affects only graphs that have blanking areas or
intersecting polygons.
NOPOLYGONCLIP
specifies line clipping; a polygon that has been line-clipped cannot use a hardware
pattern.
Details
Clipping is the process of removing part of one polygon when two polygons intersect.
For example, in a block map, a block may overlap the boundary of its map area. In this
case, the polygon that makes up the map area is clipped so that you do not see the
boundary line behind the block. (See Figure 8.1 on page 331 for an illustration of a
clipped polygon.) The type of clipping used by a graph affects whether a clipped area
can use hardware patterns.
POLYGONCLIP is affected by the PCLIP graphics option:
POLYGONCLIP with PCLIP or NOPCLIP
all areas can use hardware patterns
NOPOLYGONCLIP with NOPCLIP
all areas use only software patterns
NOPOLYGONCLIP with PCLIP
areas may use either hardware or software patterns depending on the nature of
the clipped polygons.
Under some conditions the polygons may not be clipped correctly. Specifying both
POLYGONCLIP and NOPCLIP will produce the correct graph.
POLYGONFILL
Specifies whether to use the device’s hardware polygon-fill capability.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: POLYGONFILL | NOPOLYGONFILL
GDEVICE: POLYFILL=Y | N
336 POSTGEPILOG Chapter 8
POLYGONFILL
POLYFILL=Y
causes SAS/GRAPH to use the built-in hardware capability of the device to fill
polygons. A blank Polyfill field in the Parameters window is the same as
POLYGONFILL.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
does not try to use the capability if your device does not support it.
NOPOLYGONFILL
POLYFILL=N
causes SAS/GRAPH to use software fills to fill polygons.
POSTGEPILOG
Specifies data to send immediately after the data that is stored in the Gepilog field of the device
entry is sent.
Used in: GOPTIONS statement
Default: Null string
Restriction: not supported by Java or ActiveX
See also: GEPILOG, PREGEPILOG
Syntax
POSTGEPILOG=’string’
’string’
can be either of the following:
’hex-string’X
’character-string’
PROC GOPTIONS always reports the value as a hexadecimal string.
POSTGPROLOG
Specifies the data to send immediately after the data that is stored in the Gprolog field of the
device entry is sent.
Used in: GOPTIONS statement
Default: Null string
Restriction: not supported by Java or ActiveX
See also: GPROLOG, PREGPROLOG
Syntax
POSTGPROLOG=’string’
Graphics Options and Device Parameters Dictionary PPDFILE 337
’string’
can be either of the following:
’hex-string’X
’character-string’
PROC GOPTIONS always reports the value as a hexadecimal string.
POSTGRAPH
Specifies host commands to be executed after the graph is produced.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host Commands
window
Restriction: not supported by Java or ActiveX
See also: FILECLOSE
Syntax
POSTGRAPH1=’system-command(s)’
POSTGRAPH2=’system-command(s)’
system-command(s)
specifies one or more valid system commands. The string can contain upper- or
lowercase characters. Separate multiple commands with a command delimiter, which
is host-specific; for example, some operating environments use a semicolon. The total
length of the string cannot exceed 72 characters. The commands are executed right
after the graph is produced.
Details
If you want to use a host command to send output to the device after each graph
executes, use the POSTGRAPH parameter with FILECLOSE=GRAPHEND.
PPDFILE
Specifies the location of an external file containing PostScript Printer Description (PPD)
information.
Used in: GOPTIONS statement
Restriction: PostScript printers only
BINDING, COLLATE, DUPLEX, PAPERDEST, PAPERSIZE,
See also:
PAPERSOURCE, PAPERTYPE, REVERSE
338 PREGEPILOG Chapter 8
Syntax
PPDFILE=fileref | ’external-file’
fileref
specifies a fileref that points to the PPD file you want to use. Fileref must be a valid
SAS fileref up to eight characters long and must have been previously assigned with
a FILENAME statement. See “FILENAME Statement” on page 28 for additional
information.
external-file
specifies the complete filename of the PPD file you want to use. The format of
external-file varies across operating environments. For details, see the SAS
documentation for your operating environment.
Details
A PostScript Printer Description (PPD) file is a text file that contains commands
required to access features of the device. These files are available from Adobe. Also,
many printer manufacturers provide the appropriate PPD file for their PostScript
printers.
PREGEPILOG
Specifies data to send immediately before the data that is stored in the Gepilog field of the device
entry is sent.
Syntax
PREGEPILOG=’string’
’string’
can be either of the following:
’hex-string’X
’character-string’
PROC GOPTIONS always reports the value as a hexadecimal string.
Graphics Options and Device Parameters Dictionary PREGRAPH 339
PREGPROLOG
Specifies the data to send immediately before the data that is stored in the Gprolog field of the
device entry is sent.
Used in: GOPTIONS statement
Default: Null string
Restriction: not supported by Java or ActiveX
See also: GPROLOG, POSTGPROLOG
Syntax
PREGPROLOG=’string’
’string’
can be either of the following:
’hex-string’X
’character-string’
PROC GOPTIONS always reports the value as a hexadecimal string.
PREGRAPH
Specifies host commands to be executed before the graph is produced.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host Commands
window
Restriction: not supported by Java or ActiveX
See also: FILECLOSE
Syntax
PREGRAPH1=’system-command(s)’
PREGRAPH2=’system-command(s)’
system-command(s)
specifies one or more valid system commands. The string can contain upper- or
lowercase characters. Separate multiple commands with a command delimiter, which
is host-specific; for example, some operating environments use a semicolon. The total
length of the string cannot exceed 72 characters. The commands are executed
immediately before the graph is produced.
Details
The PREGRAPH parameter should be used with FILECLOSE=GRAPHEND.
340 PROCESS Chapter 8
PROCESS
Specifies the command that translates the metafile into commands for the device.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers.
See also: INTERACTIVE
Syntax
PROCESS=’command’
command
specifies the command that translates the metafile produced by the Metagraphics
driver into commands for the device. The command runs your program to produce
the output. Command is a string up to 40 characters long.
Details
PROCESS is required if the value of the INTERACTIVE device parameter is PROC or
GRAPH.
For information about Metagraphics drivers, contact Technical Support.
PROCESSINPUT
Specifies the fileref for the file that contains input for the user-written part of the Metagraphics
driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
PROCESSINPUT=fileref
fileref
specifies a valid SAS fileref up to eight characters long. Fileref must be assigned with
a FILENAME statement or a host command before running the Metagraphics driver.
See “FILENAME Statement” on page 28 for additional information.
Details
For information about Metagraphics drivers, contact Technical Support.
Graphics Options and Device Parameters Dictionary PROMPT 341
PROCESSOUTPUT
Specifies the fileref for the file that receives output from the user-written part of the Metagraphics
driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
PROCESSOUTPUT=fileref
fileref
specifies a valid SAS fileref up to eight characters long. Fileref must be assigned with
a FILENAME statement or a host command before running the Metagraphics driver.
See “FILENAME Statement” on page 28 for additional information.
Details
For information about Metagraphics drivers, contact Technical Support.
PROMPT
Specifies whether prompts are issued.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Restriction: not supported by Java or ActiveX
Default: device dependent
Syntax
GOPTIONS: PROMPT | NOPROMPT
GDEVICE: PROMPT=0...7
PROMPT
causes all prompts to be displayed.
NOPROMPT
suppresses all prompts. NOPROMPT overrides the GWAIT= graphics option.
PROMPT=0...7
in the GDEVICE procedure, specifies the level of prompting:
342 PROMPTCHARS Chapter 8
0 provides no prompting
1 issues startup messages only. Startup messages are messages such as PLEASE
PRESS RETURN TO CONTINUE.
2 signals end of graph if device is a video display or sends message to change paper if
device is a plotter.
Note: If you specify either 0 for the PROMPT device parameter or NOPROMPT
in a GOPTIONS statement for a display device, the display clears immediately after
the graph is drawn. 4
In the GDEVICE Parameters window, the PROMPT parameter consists of four fields
that describe the type of prompt:
start up
issues a message to turn the device on (if the device is a hardcopy device) or the
message PLEASE PRESS RETURN AFTER EACH BELL TO CONTINUE.
end of graph
signals, usually by a bell, when the graph is complete (valid for video displays only).
mount pens
issues a message to mount pens in a certain order and (for certain devices only) to
ask for pen priming strokes for plotters.
change paper
prompts the user to change the paper (valid for plotters only).
Enter an X for each prompt that you want to be given. If no Xs appear in these
fields, no prompt messages are issued, and the device does not wait for you to respond
between graphs.
PROMPTCHARS
Selects the prompt characters to be used by SAS/GRAPH device drivers.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: host dependent
Restriction: not supported by Java or ActiveX
See also: GSFLEN, HANDSHAKE
Graphics Options and Device Parameters Dictionary PROMPTCHARS 343
Syntax
PROMPTCHARS=’prompt-chars-hex-string’X
prompt-chars-hex-string
is an 8-byte hexadecimal string that is specified as 16 hexadecimal characters. In
GDEVICE procedure statements, enclose the string in single quotation marks,
followed by an X. In the Parameters window, enter the hexadecimal string without
either quotation marks or a trailing X.
Note: Bytes 1, 4, and 5 are the safest for you to change because you are most
likely to know the correct value for them. Check with Technical Support before
changing any of the other bytes. 4
The following list describes each byte in the string:
byte 1
is the ASCII code of the system prompt character (for software handshaking). The
system prompt character is the last character that the host sends before waiting
for a response from the plotter. For example, 11 means the host sends an XON or
DC1 character as a prompt. If the host does not send a special character for a
prompt, set this byte to 00.
byte 2
is the ASCII code of the echo-terminator character (for software handshaking).
This character is sent at the beginning of each record.
byte 3
prevents splitting commands across records if the value is 01. If you are creating a
graphics stream file to send to a device at a later time, and there is the possibility
that extra characters will be added between records during transmission, setting
the third byte to 01 reduces the likelihood that the extra characters will be
interpreted as graphics commands and cause stray lines or other device
characters. If the third byte is set to 00, the driver makes the records as long as
possible and splits device commands across records if necessary. Setting the third
byte to 00 is more efficient but is more likely to result in device errors if output is
written to a file and later transmitted to the device.
byte 4
is the line-end character (for software handshaking). It indicates that more data
can be sent. This character is almost always a carriage-return character, 0D.
byte 5
specifies turnaround delay in tenths of a second (for software handshaking). The
turnaround delay is the amount of time the device waits after receiving the
prompt character before sending the line-end character. For example, a value of 05
represents a half-second delay.
byte 6
sets default record length using a hexadecimal value 00–FF. This byte sets the
length of the records sent to the device or to a file. If this byte is set to 00 (the
default), SAS/GRAPH uses the longest record length possible for the device. To
specify an alternate length, set the sixth byte to the hexadecimal value for the
desired length. For example, to generate records of length 80, specify 50 for the
sixth byte. If the GSFLEN device parameter or graphics option is specified, its
value overrides the value of the sixth prompt character.
344 PROWS Chapter 8
Some values of the GPROTOCOL device parameter cause each byte in the data
stream to be expanded to two bytes. This expansion is done after the length of the
record is set by PROMPTCHARS. If you are specifying a value for GPROTOCOL
that does this (for example, SASGPHEX, SASGPLCL, or SASGPAGL), specify a
value for the sixth byte of PROMPTCHARS that is half of the actual record length
desired. For example, a hexadecimal value of 40 (64 decimal) produces a 128-byte
record after expansion by the GPROTOCOL module.
bytes 7 and 8
are unused and should be set to 0000.
Details
PROMPTCHARS is most commonly used to specify parameters used in software
handshaking (see “HANDSHAKE” on page 311), but it also can be used to control the
length of records written by most drivers. You also can use the GSFLEN= graphics
option for this purpose.
PROWS
Sets the number of rows in the graphics output area for portrait orientation.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: LROWS, PCOLS, VPOS
Syntax
PROWS=portrait-rows
portrait-rows
is a nonnegative integer up to three digits long (0...999).
Details
Either the LROWS and LCOLS pair of device parameters or the PROWS and PCOLS
pair of device parameters are required and must be nonzero.
The VPOS= graphics option overrides the value of PROWS.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
QMSG
Specifies whether log messages are held until after the graphics output is displayed.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
Graphics Options and Device Parameters Dictionary RECTFILL 345
Syntax
GOPTIONS: QMSG | NOQMSG
GDEVICE: QMSG=Y | N
QMSG QMSG=Y
queues driver messages while the device is in graphics mode (default for video
devices).
NOQMSG QMSG=N
prevents the queuing of messages (default for plotters, cameras, and printers).
Details
Message queuing is desirable on display devices that do not have a separate dialog and
graphics area. If messages are not queued, they are written to the log as the graphics
output is being generated. This behavior may cause problems on some devices.
A blank Queued messages field in the Parameters window can mean either Y or N,
depending on the device.
RECTFILL
Specifies which rectangle fills should be performed by hardware.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
See also: FILL
Syntax
RECTFILL=’rectangle-fill-hex-string’X
rectangle-fill-hex-string
is a hexadecimal string that is 16 characters long. In GDEVICE procedure
statements, enclose the string in single quotation marks, followed by an X. In the
Parameters window, enter the hexadecimal string without either quotation marks or
a trailing X.
The following table shows which bit position (left-to-right) within the hexadecimal
string controls each fill pattern.
2 R2 10 L5
3 R3 11 X1
346 RENDER Chapter 8
4 R4 12 X2
5 R5 13 X3
6 L1 14 X4
7 L2 15 X5
8 L3 16 S
For example, if you want the driver to use only the L1 and R1 fills in hardware,
the first and sixth bits of the first byte of the hexadecimal string should be turned on,
which corresponds to a value of ’8400000000000000’X (’84’X is equivalent to ’1 0 0 0 0
1 0 0’ in binary). If a particular hardware rectangle fill is not available or not to be
used (as indicated by the value of RECTFILL), the fill is generated by the software.
See “PATTERN Statement” on page 169 for an illustration of the fill patterns.
Details
Note: Not all devices support this capability. If FILL=N is specified or the NOFILL
option is used in a GOPTIONS statement, RECTFILL is ignored. 4
RENDER
Controls the creation and disposition of rendered Bitstream fonts.
Used in: GOPTIONS statement
Default: MEMORY
Restriction: not supported by Java or ActiveX
See also: RENDERLIB
Syntax
RENDER=APPEND | DISK | MEMORY | NONE | READ
APPEND
creates files to store rendered versions of Bitstream fonts if the files do not already
exist, reads previously rendered characters from the font files, and appends rendered
versions of new characters to the font files when the SAS/GRAPH procedure
terminates.
DISK
creates files to store rendered versions of Bitstream fonts if the files do not already
exist, reads previously rendered characters from the font files, and appends rendered
versions of new characters to the font files as they are encountered. This method is
slower on some hosts, but it may work in memory-constrained conditions where the
other rendering methods fail.
Graphics Options and Device Parameters Dictionary REPAINT 347
MEMORY
renders all fonts in memory without creating any font files on disk. Font files are not
used even if they already exist. New characters are not written to existing font files
when SAS/GRAPH procedures terminate.
This is the default and should be the fastest method on hosts that support virtual
memory.
NONE
disables the font rendering features.
READ
reads existing rendered font files but does not create new font files or write new
characters to existing font files. This is useful only when font files already exist in
the rendered font library.
Details
The memory capacity and input/output characteristics of your host system determine
which value for the RENDER= option provides the best performance.
RENDERLIB
Specifies the SAS data library in which rendered font files are stored.
Used in: GOPTIONS statement
Default: WORK
Restriction: not supported by Java or ActiveX
See also: RENDER
Syntax
RENDERLIB=libref
libref
specifies a previously defined libref that identifies the SAS library. The default
library is WORK. See “LIBNAME Statement” on page 29 for more information on
assigning a libref.
REPAINT
Specifies how many times to redraw the graph.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
348 RESET Chapter 8
Syntax
REPAINT=redraw-factor
redraw-factor
is a nonnegative integer up to three digits long (0...999).
Details
Use this option with printers that produce light images after only one pass. This option
also is useful for producing transparencies; multiple passes make the colors more solid
or more intense.
Not all devices have this capability.
RESET
Resets graphics options to their defaults and/or cancels global statements.
Used in: GOPTIONS statement
Syntax
RESET=ALL | GLOBAL | statement-name | (statement-name(s))
ALL
sets all graphics options to defaults and cancels all global statements.
GLOBAL
cancels all global statements (AXIS, FOOTNOTE, LEGEND, PATTERN, SYMBOL,
and TITLE). Options in the GOPTIONS statement are unaffected.
statement-name
resets or cancels only the specified global statements. For example,
RESET=PATTERN cancels all PATTERN statements only. To cancel several
statements at one time, enclose the statement names in parentheses. For example,
RESET=(TITLE FOOTNOTE AXIS).
Note: RESET=GOPTIONS sets all graphics options to defaults but does not
cancel any global statements. 4
Featured in: “Example 10. Creating a Bar Chart with Drill-down for the Web” on
page 255
Details
RESET=ALL or RESET=GOPTIONS must be the first option specified in the
GOPTIONS statement; otherwise, the graphics options that precede RESET= in the
GOPTIONS statement are reset. Other options can follow the RESET= graphics option
in the statement.
Graphics Options and Device Parameters Dictionary ROTATE 349
REVERSE
Specifies whether to print the output in reverse order, if reverse printing is supported by the device.
Used in: GOPTIONS statement
Default: NOREVERSE
hardware dependent, PostScript printers require a PPD file; not supported
Restrictions:
by Java or ActiveX
See also: PPDFILE
Syntax
REVERSE | NOREVERSE
Details
The purpose of REVERSE is to control the stacking order of printer output,
depending on how the printer stacks paper. On some printers, reverse implies using the
alternate output bin (back of the printer).
For PCL devices, REVERSE sends output to the LOWER out bin, which is the
face-up output bin.
For PostScript devices, if the PPD file has an “OutputOrder” entry and one of its
entries is “Reverse,” the device supports reverse order printing and the appropriate
PostScript code to activate reverse will be used. If the PPD file does not have an
“OutputOrder” entry but does have a “PageStackOrder” entry and corresponding
OutputBin value, then reverse order printing is supported indirectly, using the PPD
file’s PageStackOrder/OutputBin entries.
Note: Some PostScript devices implement Reverse as the default output mode for
one of the output bins. In this case, selecting either the “reverse” output bin or
specifying REVERSE mode produces identical results. 4
ROTATE
Specifies whether and how to rotate the graph.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: ROTATE=LANDSCAPE | PORTRAIT ROTATE | NOROTATE
GDEVICE: ROTATE=LANDSCAPE | PORTRAIT
350 ROTATION Chapter 8
ROTATE | NOROTATE
specifies whether to rotate the graph 90 degrees from its default orientation.
ROTATE=LANDSCAPE
specifies landscape orientation (the graph is wider than it is high).
ROTATE=PORTRAIT
specifies portrait orientation (the graph is higher than it is wide).
ROTATION
Sets the increment of the angle by which the device can rotate any given letter in a string of text
in a Metagraphics driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Default: ROTATION=0
Restriction: Used only with user-supplied Metagraphics drivers.
Syntax
ROTATION=angle-increment
angle-increment
specifies the increment of the angle at which to rotate individual characters, for
example, every 5 degrees, every 45 degrees, and so on. Angle-increment is an integer
in the range 0 to 360. A value of 0 means that the device uses its default character
rotation. Specify 0 if your device does not perform hardware character rotation.
Details
For information about Metagraphics drivers, contact Technical Support.
ROWS
Specifies the number of rows the hardware font uses in graphics output.
Used in: GDEVICE Chartype window; GDEVICE procedure; CHARREC= option
Default: 0
See also: CHARREC
Syntax
See “CHARREC” on page 269 for syntax.
Graphics Options and Device Parameters Dictionary SIMFONT 351
Details
If you are using a device driver from SASHELP.DEVICES, this parameter already is set
for hardware fonts that have been defined for your installation. For scalable fonts, you
can specify 1 for ROWS, and the actual number of rows will be computed based on the
current text width. If you are adding to or modifying hardware fonts available for a
particular device driver, specify a positive value for the ROWS device parameter. If
ROWS is greater than 0, it overrides the values of the LROWS and PROWS device
parameters.
SCALABLE
Specifies whether a font is scalable.
Used in: GDEVICE Chartype window; GDEVICE procedure; CHARREC= option
Default: device dependent
See also: CHARTYPE
Syntax
See “CHARREC” on page 269 for syntax.
Details
A hardware font is scalable if it can be used with any combination of rows and columns.
Use the SCALABLE device parameter if you are adding to or modifying the fonts
available for a particular device driver. If you are using a device driver from
SASHELP.DEVICES, this parameter already is set for hardware fonts that have been
defined for your installation.
SIMFONT
Specifies a software font to use if the default hardware font cannot be used.
Used in: GOPTIONS statement
Default: SIMULATE
Restriction: not supported by Java or ActiveX
Syntax
SIMFONT=software-font
software-font
specifies a software font to use instead of the default hardware font. By default, this
is the SIMULATE font, which is stored in the SASHELP.FONTS catalog.
352 SPEED Chapter 8
Details
SAS/GRAPH substitutes the software font specified by the SIMFONT= option for the
default hardware font in these cases:
3 when you use the NOCHARACTERS option in a GOPTIONS statement
3 when you specify a non-default value for the HPOS= or VPOS= graphics option
and your device does not have scalable hardware characters
3 when you replay a graph using a device driver other than the one used to create
the graph
3 when you specify an angle or rotation for your hardware text that the device is not
capable of producing
3 when you specify a hardware font that is not supported by your device.
See Chapter 5, “SAS/GRAPH Fonts,” on page 75 for details.
SPEED
Selects pen speed for plotters with variable speed selection.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
SPEED=pen-speed
pen-speed
specifies a percentage (1 through 100) of the maximum pen speed for the device. For
example, SPEED=50 slows the drawing speed by half. In general, slowing the
drawing speed produces better results.
By default, the value of SPEED is the normal speed for the device.
SWAP
Specifies whether to reverse BLACK and WHITE in the graphics output.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Defaults: GOPTIONS: NOSWAP; GDEVICE: SWAP=N
Restriction: not supported by Java or ActiveX
Syntax
GOPTIONS: SWAP | NOSWAP
Graphics Options and Device Parameters Dictionary SWFONTRENDER 353
GDEVICE: SWAP=Y | N
SWAP
SWAP=Y
swaps BLACK for WHITE and vice versa.
NOSWAP
SWAP=N
does not swap the colors. A blank Swap field in the Parameters window is the same
as SWAP=N.
Details
SWAP does not affect the background color and only affects BLACK and WHITE
foreground colors specified as predefined SAS color names. SWAP ignores BLACK and
WHITE specified in HLS, RGB, or gray-scale format. This option is useful when you
want to preview a graph on a video device and send the final copy to a printer that uses
a white background.
goptions reset=all cback=blue ctitle=black swap;
title1 h=8 ’swap test’;
title2 h=8 ’another title’;
proc gslide border;
run;
SWFONTRENDER
Specifies the method used to render software fonts.
Used in: GOPTIONS statement
Default: device dependent
Restriction: not supported by Java or ActiveX
Syntax
SWFONTRENDER = POLYGON | SCANLINE
SWFONTRENDER = POLYGON
uses polygon rendering
SWFONTRENDER = SCANLINE
uses scanline rendering
Details
SWFONTRENDER determines the method used to render software text to a vector
graphics file. In some graphics formats, SCANLINE rendering may produce better
quality output when displayed to the screen, but the text may become unrecognizable if
the output is resized, or it may be distorted if the output is replayed on a device with a
354 SYMBOL Chapter 8
different resolution than the original device. If the software text is rendered as a
POLYGON, resizing the graph will not distort the text.
SYMBOL
Specifies whether to use the device’s hardware symbol-drawing capability.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
Restriction: not supported by Java or ActiveX
See also: SYMBOLS
Syntax
GOPTIONS: SYMBOL | NOSYMBOL
GDEVICE: SYMBOL=Y | N
SYMBOL
SYMBOL=Y
causes SAS/GRAPH to use the built-in symbol-drawing capability of the device, if
available. A blank Symbol field in the Parameters window is the same as
SYMBOL=Y.
Hardware drawing is faster, but not all devices have the capability. SAS/GRAPH
does not try to use the capability if your device does not support it.
NOSYMBOL
SYMBOL=N
causes SAS/GRAPH to draw the symbols using software fonts.
SYMBOLS
Specifies which symbols can be generated by hardware.
Used in: GDEVICE procedure; GDEVICE Parameters window
Default: device dependent
See also: “SYMBOL Statement” on page 183
Syntax
SYMBOLS=’hardware-symbols-hex-string’X
Graphics Options and Device Parameters Dictionary TARGETDEVICE 355
hardware-symbols-hex-string
is a hexadecimal string that is 16 characters long and must be completely filled. This
table shows which bit position (left-to-right) within the hexadecimal string controls
each hardware symbol.
For example, if you want the driver to do only the PLUS and X symbols in
hardware, the first and second bits of the first byte of the hexadecimal string should
be turned on, which would correspond to a value of ’C000000000000000’X (’C0’X is
equivalent to ’1 1 0 0 0 0 0 0’ in binary).
Details
These are not the only symbols that can be generated for graphics output but are the
symbols that can be drawn by the hardware. SAS/GRAPH can draw other symbols.
Note: Not all devices are capable of drawing every symbol. If a particular hardware
symbol is not available or not to be used (as indicated by the value of SYMBOLS), the
symbol is generated by the software. If the value of the SYMBOL device parameter in
the device entry is N or the NOSYMBOL graphics option is used, the value of
SYMBOLS is ignored. 4
TARGETDEVICE
Displays the output as it would appear on a different device. Also, specifies the device driver for
the PRINT command.
356 TRAILER Chapter 8
Alias: TARGET
Used in: GOPTIONS statement
Restriction: not supported by Java or ActiveX
Syntax
TARGETDEVICE=target-device-entry
target-device-entry
specifies the name of a device entry in a catalog.
Details
Use TARGETDEVICE= to specify a device driver when you want to:
3 preview graphics output on your monitor as it would appear on a different output
device. For details, see “Previewing Output” on page 52.
3 print output from the Graph window or the Graphics Editor window with the
PRINT command. For details, see “Printing Graphics Output” on page 51.
3 specify a device driver for graphics output created by the ODS HTML statement.
TRAILER
Specifies the command that creates TRAILER records for the Metagraphics driver.
Used in: GDEVICE procedure; GDEVICE Metagraphics window
Restriction: Used only with user-supplied Metagraphics drivers
See also: TRAILERFILE
Syntax
TRAILER=’command’
command
specifies a command that runs a user-written program that creates the TRAILER
file. Command is a string up to 40 characters long.
Details
For information about Metagraphics drivers, contact Technical Support.
TRAILERFILE
Specifies the fileref of the file from which the Metagraphics driver reads TRAILER records.
Used in: GDEVICE procedure GDEVICE Metagraphics window
Graphics Options and Device Parameters Dictionary TRANTAB 357
Syntax
TRAILERFILE=fileref
fileref
specifies a valid SAS fileref up to eight characters long. Fileref must have been
previously assigned with a FILENAME statement or a host command before running
the Metagraphics driver. See “FILENAME Statement” on page 28 for additional
information on the FILENAME statement.
Details
For information about Metagraphics drivers, contact Technical Support.
TRANSPARENCY
Specifies whether the background of the image should appear to be transparent when the image is
displayed in the browser.
Used in: GOPTIONS statement
Default: NOTRANSPARENCY
Restriction: GIF series of drivers only
Syntax
TRANSPARENCY | NOTRANSPARENCY
Featured in: “Example 8. Creating a Simple Web Page with the ODS HTML
Statement” on page 245
Details
When the image is displayed and TRANSPARENCY is in effect, the browser’s
background color replaces the driver’s background color, causing the image to appear
transparent.
TRANTAB
Selects a translate table for your system that performs ASCII-to-EBCDIC translation.
358 TYPE Chapter 8
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Host File Options
window
Default: host dependent
Restriction: not supported by Java or ActiveX
Syntax
TRANTAB=table | user-defined-table
table
specifies a translate table stored as a SAS/GRAPH catalog entry. Table can be one of
the following:
SASGTAB0 (default translate table for your operating environment)
GTABVTAM
GTABTCAM
user-defined-table
specifies the name of a user-created translate table.
Details
TRANTAB is set by the SAS Installation Representative and is needed when an
EBCDIC host sends data to an ASCII graphics device. See the SAS/GRAPH installation
instructions for details. You can also create your own translate table using the
TRANTAB procedure. For a description of the TRANTAB Procedure, see Base SAS
Procedures Guide.
TYPE
Specifies the type of output device to which graphics commands are sent.
Used in: GDEVICE procedure; GDEVICE Detail window
Default: device dependent
Syntax
TYPE=CAMERA | CRT | EXPORT | PLOTTER | PRINTER
CAMERA
specifies a film-recording device.
CRT
specifies a monitor or terminal.
EXPORT
identifies the list in which the device appears under SAS/ASSIST software. This is
used for drivers that produce output to be exported to other software applications,
such as CGM or HPGL.
Graphics Options and Device Parameters Dictionary USERINPUT 359
PLOTTER
specifies a pen plotter.
PRINTER
specifies a printer
Details
You should not modify this value for Institute-supplied device drivers.
UCC
Sets the user-defined control characters for the device.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Parameters window
Restriction: device dependent; not supported by Java or ActiveX
Syntax
UCC=’control-characters-hex-string’X
control-characters-hex-string
is a hexadecimal string that can be up 32 bytes (64 characters) long. You only need
to specify up to the last non-zero byte; the remaining bytes will be set to zero.
Details
Not all devices support this feature, and the meaning of each byte of the string varies
from device to device.
UCC values for specific devices are listed in the SAS Help facility for SAS/GRAPH.
Typically the UCC byte position is indicated by a bracketed value. For example, UCC[2]
refers to the second byte of the string. Refer to the Help for the UCC device parameter
for details.
USERINPUT
Determines whether user input is enabled for the device.
Used in: GOPTIONS statement
Default: NOUSERINPUT
Restrictions: GIFANIM driver only; not supported by all browsers
Syntax
USERINPUT | NOUSERINPUT
360 VORIGIN Chapter 8
USERINPUT
enables user input
NOUSERINPUT
disables user input
Details
When user input is enabled, processing of the animation is suspended until a carriage
return, mouse click, or some other application-dependent event occurs. The user input
feature works with the delay time setting so that processing continues when user input
occurs or the delay time has elapsed, whichever comes first.
VORIGIN
Sets the vertical offset from the lower-left corner of the display area to the lower-left corner of the
graph.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: not supported by Java or ActiveX
See also: HORIGIN
Syntax
VORIGIN=vertical-offset <IN | CM | PT>
Details
The display area is defined by the XMAX and YMAX device parameters. By default, the
origin of the graphics output area is the lower-left corner of the display area; the
graphics output is offset from the lower-left corner of the display area by the values of
HORIGIN and VORIGIN. VORIGIN + VSIZE cannot exceed YMAX. See “About the
Graphics Output Area” on page 34 for details.
VPOS
Sets the number of rows in the graphics output area.
Graphics Options and Device Parameters Dictionary VSIZE 361
Syntax
VPOS=rows
rows
specifies the number of rows in the graphics output area, which is equivalent to the
number of hardware characters that can be displayed vertically. Specifying VPOS=0
causes the device driver to use the default hardware character cell height for the
device.
Details
The VPOS= graphics option overrides the values of the LROWS or PROWS device
parameters and temporarily sets the number of columns in the graphics output area.
VPOS= does not affect the height of the graphics output area but merely divides it into
rows. Therefore, you can use VPOS= to control cell height.
The values specified in the HPOS= and VPOS= graphics options determine the size
of a character cell for the graphics output area and consequently the size of many
graphics elements, such as hardware text. The larger the size of the HPOS= and
VPOS= values, the smaller the size of each character cell.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
VSIZE
Sets the vertical size of the graphics output area.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: partially supported by Java or ActiveX
See also: HSIZE, YMAX
Syntax
VSIZE=vertical-size <IN | CM | PT>
V6COMP
Allows programs that are run in the current version of SAS to run with selected Version 6 defaults.
Used in: GOPTIONS statement
Default: NOV6COMP
Restriction: partially supported by Java or ActiveX
Syntax
V6COMP | NOV6COMP
V6COMP
causes SAS/GRAPH programs to use these Version 6 behaviors:
3 By default, patterns are hatched patterns, not solid, and the default outline
color matches the pattern color.
3 By default, the GCHART and GPLOT procedures do not draw a frame around
the axis area.
NOV6COMP
causes SAS/GRAPH programs to use all the features of the current SAS version.
Details
V6COMP performs the necessary conversions so that, for selected defaults, you get the
same results in the current SAS version that you did in Version 6.
Note: V6COMP does not convert Version 6 catalogs to catalogs with the current SAS
catalog format. 4
XMAX
Specifies the width of the addressable graphics display area; affects the horizontal resolution of
the device and the horizontal dimension of the graphics output area.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Restriction: Ignored by default display drivers, universal printing drivers, Java, and
ActiveX
See also: HSIZE, PAPERSIZE, XPIXELS
Graphics Options and Device Parameters Dictionary XMAX 363
Syntax
XMAX=width < IN | CM | PT>
width
is a positive number that may be followed by a unit specification, either IN for inches
(default), or CM for centimeters, or PT for points. If you do not specify XMAX, a
default width is searched for in this order:
1 the width specification on an OPTIONS PAPERSIZE setting
2 XMAX in the device entry catalog.
If XMAX=0, default behavior is used. If both XMAX and PAPERSIZE have been
specified on GOPTIONS, the last request is used.
Details
Like the XPIXELS device parameter, XMAX controls the width of the display area, but
the width is in inches, centimeters, or points rather than pixels. Typically, you might
use XMAX to change the width of the display area for a hardcopy device.
SAS/GRAPH uses the value of XMAX in calculating the horizontal resolution of the
device:
x-resolution = XPIXELS / XMAX
However, changing XMAX does not necessarily change the resolution:
3 If you use the GOPTIONS statement to change only the value of XMAX= and do
not change XPIXELS=, SAS/GRAPH retains the default resolution of the device
and recalculates XPIXELS, temporarily changing the width.
3 If you specify values for both XMAX= and XPIXELS=, SAS/GRAPH recalculates
the resolution of the device using both of the specified values. The new resolution
may or may not be different. For example, both of these pairs of values produce
the same resolution, 300dpi:
XPIXELS=1500 and XMAX=5
XPIXELS=1800 and XMAX=6
XMAX also affects the value of HSIZE, which controls the horizontal dimension of
the graphics output area.
3 If you change the value of XMAX and do not change HSIZE=, SAS/GRAPH
calculates a new value for HSIZE=, using this formula:
HSIZE = XMAX − margins
Note: The margins quantity, here, is not a device parameter. It represents the
value of the left margin plus the right margin. The left margin is the value of
HORIGIN. The right margin is whatever is left over when you subtract HSIZE
and HORIGIN from XMAX. The value of margins is always based on the original
XMAX and HSIZE values that are stored in the device entry. 4
3 If you specify values for both XMAX= and HSIZE=, SAS/GRAPH uses the specified
values plus the value of device parameter HORIGIN. Anything left over is added
to the right margin. For example, if XMAX=6IN and HSIZE=4IN and
HORIGIN=.5IN, the right margin will be 1.5in. If HSIZE= is larger than XMAX=,
HSIZE= is ignored.
364 XPIXELS Chapter 8
To permanently change the value of the XMAX device parameter in the device entry,
use the GDEVICE procedure. This can change the resolution.
To temporarily change the size of the display and the resolution of the device for the
current graph or for the duration of your SAS session, use XMAX= and XPIXELS= in
the GOPTIONS statement.
To reset the value of XMAX to the default, specify XMAX=0. To return to the default
resolution for the device, specify both XMAX=0 and XPIXELS=0.
See “Procedure Output and the Graphics Output Area” on page 34 for more
information.
XPIXELS
Specifies the width of the addressable display area in pixels and in conjunction with XMAX
determines the horizontal resolution for the device.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: XMAX
Restriction: Ignored by default display drivers and universal printing drivers; partially
supported by Java or ActiveX
Syntax
XPIXELS=width-in-pixels
width-in-pixels
is a positive integer up to eight digits long (0...99999999).
Details
Like the XMAX device parameter, XPIXELS controls the width of the display area, but
the width is in pixels rather than inches, centimeters, or points. Typically, you might
use XPIXELS to change the width of the display area for an image format device.
Note: This option overrides the OutputWidth style attribute in the graph styles. For
more information on graph styles, refer to the TEMPLATE procedure documentation in
SAS Output Delivery System: User’s Guide. 4
The value of XPIXELS is used in calculating the resolution of the device:
x-resolution = XPIXELS / XMAX
However, changing XPIXELS does not necessarily change the device resolution:
3 If you use the GOPTIONS statement to change only the value of XPIXELS= and
do not change XMAX=, SAS/GRAPH retains the default resolution of the device
and recalculates XMAX, temporarily changing the width of the display. If HSIZE=
is also not specified, SAS/GRAPH uses the new XMAX value to calculate a new
HSIZE value, using this formula:
HSIZE = XMAX − margins
Graphics Options and Device Parameters Dictionary YMAX 365
Note: Margins are not device parameters, but represent the value of HORIGIN
(the left margin) plus the right margin. The right margin is whatever is left over
when you subtract HSIZE and HORIGIN from XMAX. The values of margins is
always based on the original XMAX and HSIZE values that are stored in the
device entry. 4
If HSIZE= is specified and its value is larger than XMAX, HSIZE= is ignored.
3 If you use the GDEVICE procedure to permanently change the value of the
XPIXELS device parameter in the device entry, SAS/GRAPH automatically
recalculates the resolution of the device is using the value of XMAX device
parameter.
3 If you change the values of both XMAX= and XPIXELS=, SAS/GRAPH recalculates
the resolution of the device using both of the specified values.
Note: When SAS/GRAPH recalculates the resolution, the resolution does not
necessarily change. For example, both of these pairs of values produce the same
resolution, 300dpi:
XPIXELS=1500 and XMAX=5
XPIXELS=1800 and XMAX=6
4
To reset the value of XPIXELS to the default, specify XPIXELS=0. To return to the
default resolution for the device, specify both XPIXELS=0 and XMAX=0.
YMAX
Specifies the height of the addressable graphics display area; affects the vertical resolution of the
device and the vertical dimension of the graphics output area.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
ignored by default display drivers and universal printing drivers; not
Restriction:
supported by Java or ActiveX
See also: PAPERSIZE, VSIZE, YPIXELS
Syntax
YMAX=height <IN | CM | PT>
height
is a positive number that may be followed by a unit specification, either IN for inches
(default), or CM for centimeters, or PT for points. If you do not specify YMAX, a
default height is searched for in this order:
1 the height specification on an OPTIONS PAPERSIZE setting
2 YMAX in the device entry catalog.
If YMAX=0, default behavior is used. If both YMAX and PAPERSIZE have been
specified on GOPTIONS, the last request is used.
366 YPIXELS Chapter 8
Details
See “XMAX” on page 362.
YPIXELS
Specifies the height of the addressable display area in pixels and in conjunction with YMAX
determines the horizontal resolution for the device.
Used in: GOPTIONS statement; GDEVICE procedure; GDEVICE Detail window
Default: device dependent
See also: YMAX
ignored by default display drivers and universal printing drivers; partially
Restriction:
supported by Java or ActiveX
Syntax
YPIXELS=height-in-pixels
height-in-pixels
is a positive integer up to eight digits long (0...99999999).
Details
See “XPIXELS” on page 364.
Note: This option overrides the OutputHeight style attribute in the graph styles.
For more information on graph styles, refer to the TEMPLATE procedure
documentation in SAS Output Delivery System: User’s Guide. 4
367
2
P A R T
Chapter 12. . . . . . . . .Attributes and Parameters for Java and ActiveX 421
Chapter 17. . . . . . . . .Generating Web Output with the Annotate Facility 499
Chapter 21. . . . . . . . .Macro Arguments for the DS2CONST, DS2TREE, DS2CSF, and
META2HTM Macros 535
CHAPTER
9
Introducing SAS/GRAPH Output
for the Web
deliver it to your audience. The primary purpose of these topics is to help you
determine which device driver or macro you need to use.
3 “Types of Web Presentations Available” on page 370 describes each type of web
presentation, their features, and which device driver or macro you need to use to
create that type of presentation.
3 “Selecting a Type of Web Presentation” on page 378 guides you through the
process of determining which device driver or macro to use. If the type of
presentation you need to generate can be generated with multiple device drivers,
then additional factors determine which driver to use.
3 “Generating Web Presentations” on page 382 summarizes the methods by which
each type of web presentation is created.
The ActiveX control can be viewed only in the Windows operating environment with
Microsoft’s Internet Explorer on a PC with the ActiveX control installed.
The ActiveX control displays output from the G3D, GAREABAR, GBARLINE,
GCHART, GCONTOUR, GPLOT, GMAP, and GRADAR procedures.
To create a graph to be displayed by ActiveX, specify DEVICE=ACTIVEX on your
GOPTIONS statement. See “Using ODS with a SAS/GRAPH Procedure” on page 382
and Chapter 10, “Creating Interactive Output for ActiveX,” on page 387 for more
information.
Treeview Applet
This applet displays a treeview diagram, which shows the parent-child relationships
in a tree structure. In a treeview diagram, each child node has exactly one parent, and
each parent node has zero or more children. In other words, the relationships in a
treeview diagram are one-to-many. A treeview diagram is ideal for displaying such data
as organizational charts or the hierarchical relationships of the pages of a Web site.
Introducing SAS/GRAPH Output for the Web Presentations That Use Java Applets 373
By default, the Treeview applet zooms in on the portion of the tree that is in the
center of the display, as if you were looking through a fish-eye lens. Nodes in the center
of the display are spread apart and shown with more detail, including node labels.
Nodes near the periphery of the display are compressed and shown with less detail.
Initially, the Treeview applet places the root node in the center of the display. You can
click and drag the diagram to change the portion of the diagram that is in the center of
the display.
The Treeview applet supports a pop-up menu that enables you to search for nodes,
select or hide subtrees, and so on. You can add hotspots that link to Web pages when
the user clicks on a node.
For example, Display 9.3 on page 373 shows a treeview diagram (with the pop-up
menu opened) displaying the structure of an XML Document Type Definition.
To generate a treeview diagram, use the DS2TREE macro. For more information, see
Chapter 18, “Creating Interactive Treeview Diagrams,” on page 503.
Constellation Applet
The Constellation applet displays a general node-link diagram. Each node can be
linked to one or more other nodes. Unlike the Treeview applet, the Constellation applet
does not require a hierarchical relationship between the nodes. (Although it can be
used to display hierarchical relationships, the Constellation applet does not
automatically place the root node at the center of the display.)
The Constellation applet supports node and link properties, which determine the
color and size of the nodes and the color and thickness of the link joining the nodes.
These properties indicate the relative strength of the relationship between the nodes.
Like the Treeview applet, by default, the Constellation applet zooms in on the portion
of the diagram that is in the center of the display, as if you were looking through a
374 Presentations That Use Java Applets Chapter 9
fish-eye lens. Nodes in the center of the display are spread apart and shown with more
detail, including node labels. Nodes near the periphery of the display are compressed
and shown with less detail. You can click and drag the diagram to change the portion of
the diagram that is in the center of the display.
The Constellation applet has a pop-up menu that supports several functions such as
highlighting specific links and searching for specific nodes. You can add hotspots that
link to Web pages when the user clicks on a node.
Display 9.4 on page 374 shows a constellation diagram (with the Mouse Help menu
displayed).
To generate the Constellation applet, use the DS2CONST macro. For more
information, see Chapter 19, “Creating Interactive Constellation Diagrams,” on page
513.
Rangeview Applet
The Rangeview applet displays critical success factor diagrams. Critical success
factor diagrams display the value of a variable in a SAS data set in relation to a range
of values. You can generate the Rangeview applet with the DS2CSF macro. Display 9.5
on page 375 shows two forms of output from the macro—one an analog dial and the
other a digital display.
Introducing SAS/GRAPH Output for the Web Presentations That Use Java Applets 375
The DS2CSF macro generates an HTML file that invokes the Rangeview applet, and
passes to the applet the information to be displayed on the dial.
For more information, see Chapter 20, “Creating Critical Success Factor Diagrams,”
on page 527.
Metaview Applet
The Metaview applet displays the output of SAS/GRAPH procedures and enables
interactive features that are not available with static images such as GIFs or JPEGs. It
enables zooming and scrolling and supports pop-up menus with customized
user-selectable links. When you generate a graph with the Metaview applet, you can
specify background colors and text fonts, and enable drill-down links to HTML files,
metagraphics files, and sets of metacodes.
Display 9.6 on page 376 shows the slider control on the bottom-left that the
Metaview applet provides to enable a user to select which diagram to display.
376 Presentations that Use Static Images Chapter 9
The Metaview applet displays output from the G3D, GANNO, GBARLINE, GCHART,
GCONTOUR, GPLOT, GMAP, GPRINT, GRADAR, GREPLAY, and GSLIDE procedures.
To create a graph to be displayed by the Metaview applet, specify DEVICE=JAVAMETA
on your GOPTIONS statement.
For additional information, see Chapter 15, “Generating Interactive Metagraphics
Output,” on page 469.
ACTXIMG Presentations
You can use ODS and the ACTXIMG device driver to create a presentation that uses
a PNG file that is identical in appearance to the image produced with the ACTIVEX
device driver.
A presentation generated with the ACTXIMG driver supports data tips and
drill-down links for GCHART, GBARLINE, and GPLOT (except for high-low plots)
output. You can also use ODS styles with the ACTXIMG driver.
To render your output (create the PNG file), the ActiveX control must be installed on
the PC where your SAS session is running. Because of this requirement, ACTXIMG
presentations can be generated only on PCs. When you specify the ACTXIMG device
driver, the output is rendered when your web presentation is generated, and the user
does not need to have the ActiveX control installed to view it.
Note: The ACTXIMG device cannot be used with the ODS PDF, PCL, PS, or
PRINTER destinations on 64-bit machines. SAS uses the JAVAIMG device instead. 4
You can use ODS and the ACTXIMG device driver to generate presentations with the
same procedures that are supported by the ACTIVEX driver: G3D, GAREABAR,
GBARLINE, GCHART, GCONTOUR, GPLOT, GMAP, and GRADAR.
JAVAIMG Presentations
You can use ODS and the JAVAIMG device driver to create a presentation that uses
a PNG file that is identical in appearance to the image produced with the JAVA device
driver. You can use ODS styles to change the appearance of presentations generated
with the JAVAIMG device driver.
Note: The Contour applet does not support ODS styles. 4
The appropriate Java applet (Graph, Map, or Contour applet) is required to render
your output (create the PNG file). The appropriate Java applet must be installed on the
machine where your SAS session is running. When you specify the JAVAIMG device
driver, the output is rendered when your web presentation is generated, and the user
does not need to have any Java applet files installed to view it.
You can use ODS and the JAVAIMG device driver to generate presentations with the
same procedures that are supported by the JAVA driver: G3D, GCHART, GCONTOUR,
GPLOT, and GMAP.
To create a web presentation that uses an image identical to the server image,
specify DEVICE=GIF, JPEG, or PNG in your GOPTIONS statement.
Note: To generate a web presentation using the ACTXIMG device driver, the
ActiveX control must be installed on the PC on which your SAS session is running. 4
For example, if you need a radar chart, you can use the ACTXIMG, ACTIVEX, or
JAVAMETA driver (as well as other drivers). Which device driver you choose depends
on what additional features (such as interactive capabilities) you need and on how you
plan to deliver your web presentation.
If you need to graph hierarchical relationships, consider using the DS2TREE macro
to generate a treeview diagram. If you need to show relationships that are not
hierarchical or if you need to show the relative affinity of the relationships, then
consider using the DS2CONST macro to generate a constellation diagram. If you need a
critical success factor diagram, then you will need to use the DS2CSF macro.
The following table shows which features are supported for each device driver or
macro.
Table 9.2 What features are supported for each type of presentation?
ACTXIMG ODS styles, pop-up data tips and drill-down links (for
selected output), static graphics with no interactivity
JAVAIMG ODS styles, static graphics with no interactivity
GIF, JPEG, PNG Pop-up data tips, drill-down links, static graphics with
no interactivity
GIFANIM Slide show of static images with no interactivity
Data tips and drill-down links for ACTXIMG are supported for output from
GCHART, GPLOT (except for high-low plots), GBARLINE, and GRADAR.
The pop-up menus available with the JAVA and ACTIVEX device drivers typically
enable your audience to change many aspects of the graph such as changing chart
types, subsetting data, changing the variable used as the response variable, turning
data tips on or off, or changing the colors used the graph. Static graphs do not offer any
of these interactive features. Web presentations that use the JAVAMETA driver may
enable a zoom control, and page selection and slide show controls for presentations that
include multiple images.
Select the System Requirements link for the appropriate operating system environment
and search for the section on viewing HTML pages created for Java and ActiveX.
It is recommended that graphs be displayed on a device that has at least 16-bit color
(that is, more than 8-bit, 256 colors).
Depending on how the presentation is generated, there may be additional
requirements. The following table shows, for each type of Web presentation, what is
required on a viewer’s machine besides a supported browser.
Introducing SAS/GRAPH Output for the Web Recommendations 381
Table 9.3 What does your audience need to view the presentation besides the
browser?
JAVAIMG None
ACTIVEX The presentation must be viewed on a Windows system
with the SAS ActiveX control installed locally.
DS2TREE, DS2CONST, DS2CSF The Java applet files must be installed locally or on a
server accessible by the client machine, and Java 1.4
plug-in must be installed on each client machine. On
Windows systems, the user is prompted to install the
plug-in if it is not already installed. On other systems,
the plug-in can be installed from the Sun Microsystems
site (http://www.sun.com) or from one of the SAS Third
Party Software Components CDs.
Presentations generated with the ACTIVEX driver can be viewed only on Windows
PCs, and the ActiveX control must be installed locally on each PC.
Presentations generated with the JAVAMETA driver can be viewed in any supported
browser and offer limited interactivity, but do not require that a Java plug-in be
installed.
Recommendations
If you will be delivering your presentation on Windows only, you want to use ODS
styles, and you want your audience to be able to interact with the graph, then you can
use the ACTIVEX device driver. If you will be delivering your presentation to other
operating environments, but you still want to use ODS styles and extensive interactive
features, then you can use the JAVA device driver. However, the ACTIVEX and JAVA
device drivers require that your audience install the ActiveX control and Java plug-in,
respectively.
If you want the look of the ACTIVEX or JAVA driver, but do not need the interactive
capability or do not want to require that your audience install the ActiveX control or
the Java plug-in, then use the ACTXIMG or JAVAIMG device drivers.
382 Generating Web Presentations Chapter 9
If you need data tips, drill-down capability, limited interactivity such as zoom, and
want your graphs to look like the GRSEG produced by the server, but you do not want
to require that your audience install the Java plug-in or the ActiveX control, then you
can use the JAVAMETA device driver.
If you need only data tips and drill-down capability and prefer that your graphs look
like the GRSEG produced by the server (see “Resolving Differences Between Client and
Server Graphs” on page 584), then you can use the GIF, JPEG, or PNG device driver.
specify a body file. For device drivers that generate image output files, use the
PATH= option to ensure that all output files are stored in the same location.
4 Run a graphics procedure. Be sure to include RUN and QUIT statements.
5 Close the HTML destination.
6 Open the LISTING destination if needed.
Figure 9.2 on page 383 shows the basic structure of a SAS program for generating
Web output with ODS and a SAS/GRAPH procedure.
DATA mydata;
DATA step
;
When you use ODS, you can use ODS styles to control the appearance of a Web
presentation created from SAS procedures with the following device drivers: ACTIVEX,
JAVA, ACTXIMG, and JAVAIMG. For more information on ODS styles, see “Using ODS
Styles” on page 488.
3 Call the META2HTM macro with the appropriate options to capture the
metagraphics information.
4 Run a graphics procedure.
5 Call the META2HTM macro with the appropriate options to finish capturing the
metagraphics information.
Figure 9.3 on page 384 shows the structure of a simple program that generate a
Javameta applet to display the output of the GCHART procedure.
DATA mydata;
DATA step
;
%META2HTM (capture=off,
META2HTM off htmlref=_webout,
openmode=append);
Introducing SAS/GRAPH Output for the Web Changing the Location of Online Help for Java and ActiveX 385
The META2HTM macro directs the procedure to create its output as metacodes, and
generates an HTML page that invokes the Metaview Applet to display the metacodes.
For more information, see “Using the META2HTM Macro” on page 471.
CHAPTER
10
Creating Interactive Output for
ActiveX
Overview 387
When to Use the ACTIVEX Device Driver 388
Installing the ActiveX Control 389
Manually Installing the ActiveX Control 389
Configuring Your Program to Prompt Users to Install the ActiveX Control 389
Prompting for Installation of the ActiveX Control 390
Uninstalling the ActiveX Control 390
Generating Output for ActiveX 391
About Languages and Special Fonts in ActiveX 392
Configuring Drill-Down Links with ACTIVEX 392
ActiveX Examples 393
Embedding ActiveX Graphs in Word Files 393
Generating an Interactive Contour Plot in ActiveX 394
Creating Graphs Interactively 395
Creating Graphs 395
Inserting the ActiveX Control into Microsoft Word Documents 395
Overview
In the Windows operating environment, in the Internet Explorer Web browser, the
SAS/GRAPH Control for ActiveX provides a high degree of graphical interactivity.
Interactive features include the ability to change graph types (a two-dimensional bar
chart can be changed to a three-dimensional bar chart, for example), display data
values at the point of the cursor, rotate and zoom, reassign variable roles, and modify
axes, legends, colors, and text fonts.
If your Web audience has SAS installed locally, the control runs automatically when
the HTML output file is displayed on a Web browser that uses ActiveX device drivers.
Members of your Web audience that do not have the SAS system installed locally, and
who have not already installed the ActiveX Control, can be prompted to install the
control at display time, as described in “Installing the ActiveX Control” on page 389.
You can enhance your ActiveX presentations by
3 adding drill-down links (see “Configuring Drill-Down Links with ACTIVEX” on
page 392)
3 specifying graph styles in ODS (see “Using ODS Styles” on page 488)
3 configuring interactive features (see “Specifying Parameters and Attributes for
Java and ActiveX” on page 421)
3 enhancing HTML output“Overview of ODS Enhancements for Web Output” on
page 487.
388 When to Use the ACTIVEX Device Driver Chapter 10
In addition to HTML output, you can use the ActiveX Control to display interactive
graphs in Microsoft Word, in Object Linked Embedded (OLE) documents, and in
applications written in Visual Basic, C++, and JavaScript.
The following table lists the procedures and statements whose output can be
displayed in the SAS/GRAPH Control for ActiveX.
Table 10.1 Procedures and Statements that Generate Output for the ActiveX
Control
Procedure Statements
GCHART HBAR, HBAR3D, VBAR, VBAR3D, PIE, PIE3D,
DONUT
GPLOT PLOT, BUBBLE, BUBBLE2, PLOT2
GCONTOUR PLOT
GRADAR CHART
Note: The ActiveX Control does not enable 8-bit grayscale images. Be sure to
specify 24-bit images for backgrounds and chart elements. 4
Note: Note that using PROC GMAP to generate a highly detailed map might create
a large HTML output file, which might cause problems on certain Web browsers. If this
is the case, you can use PROC GREDUCE to remove some of the complexity and
produce a more usable map. 4
Note that you can generate output for the ActiveX Control even if you are not
working in the Windows operating environment. For example, you can generate HTML
output for ActiveX in the Unix operating environment, even though you cannot run
Internet Explorer in that environment. Moving the output file into Windows will
display the output as if it was generated in that operating environment.
When you use the ACTIVEX device driver with an ODS statement that does not
enable interactive output, the output is automatically changed to the PNG image that
is generated with the ACTXIMG device driver. For example, the ODS PDF statement
generates output for the Adobe Acrobat Reader in Portable Document Format (PDF).
This format does not enable embedded ActiveX applications. Specifying the ACTIVEX
device driver with the ODS PDF statement generates a PDF output file that contains a
static image in PNG format.
The ACTXIMG device driver can produce an image map in the HTML to enable data
tips and drill-down functionality from the image.
beginning of the installation process. Also note that the installation program will not
run if the control has already been installed.
To be able to access the installation program, Web users must be able to access its
storage location. You might need to copy the program to another location to ensure
availability.
If you are using ODS to generate your HTML output file, then you can reference the
installation program when you open the HTML output file. For example:
ods html body="myGraph.html"
codebase="http://www.ourco.com/sasweb/graph/sasgraph.exe#version=9,1,0,304";
If the program is not stored on a Web ActiveX device driver, then you can use a file
specification as the value of the CODEBASE attribute. For example:
ods html body="myGraph.html"
(codebase="/grsrc/sasgraph.exe#version=9,1,0,304");
If the installation program is stored on a Web ActiveX device driver, use an HTTP
reference:
CODEBASE="http://www.ourco.com/sasweb/graph/sasgraph.exe#version=9,1,0,304"
Now displaying the HTML file gives users who need it the option of installing the
control in the default location on their local computers.
Note that if you want to install the control in a non-default location, you need to
install the control manually, as described in “Manually Installing the ActiveX Control”
on page 389.
2 Select
Add/Remove Programs
3 Select
Table 10.1 on page 388 lists the SAS/GRAPH procedures that generate output for
ActiveX.
Follow these steps to generate a default Web presentation that runs the SAS/GRAPH
Control for ActiveX.
1 Close the ODS listing destination to conserve resources:
ods listing close;
3 Specify the ACTIVEX device driver and set other graphics options:
goptions reset=all
device=activex
border;
For information on graph styles, see “Using ODS Styles” on page 488.
4 Specify a data set and run a procedure or procedures that are used by the
ACTIVEX device driver (see Table 10.1 on page 388):
proc gchart data=sashelp.class;
vbar height / group=age;
run;
quit;
5 Close the HTML output file and reopen the ODS listing destination:
ods html close;
ods listing;
The preceding program structure assumes that your Web audience has installed the
ActiveX Control in advance. For information on prompting new users to start the
installation process, see “Configuring Your Program to Prompt Users to Install the
392 About Languages and Special Fonts in ActiveX Chapter 10
Procedure Statements
GCHART HBAR, HBAR3D, VBAR, VBAR3D, PIE, PIE3D,
DONUT
ActiveX Examples
goptions device=activex
xpixels=500 ypixels=350
border cback=white
gunit=pct htext=3;
data atoll;
input vdist hdist depth;
datalines;
10 0.25 2.77
20 0.25 2.77
30 0.25 2.77
40 0.25 2.77
50 0.25 2.77
60 0.25 2.77
70 0.25 2.77
80 0.25 2.77
90 0.25 2.77
100 0.25 2.77
/* for the full data set, see GWBAXCON */
62 133.75 5.00
64 135 5.00
64 136.25 5.00
60 138.75 5.08
62 138.75 5.08
;
run;
legend1 frame
label=(position=top j=c ’Depth (in meters)’)
shape=line(7);
Creating Graphs
Follow these steps to create graphs interactively.
1 In Microsoft Word or Excel, position your cursor where you want your graph, then
select
Insert Object
2 Select SAS/GRAPH V9 in the Object window. The control for this functionality is
inserted into your Word document. Although you see a graph, the control does not
yet contain any real data.
3 You can add data to the control in any of the following ways.
3 Drag a SAS, Excel, or Access data file from Windows Explorer and drop it
into the control.
3 Open a data file by selecting Data Options from the pop-up menu for the
control. In the Data Options window, select Open Data and use the Open
window to navigate to your data.
3 Create new data by selecting Data Options from the pop-up menu for the
control. Select Open Data in the Data Options window. The control contains
default data that enables it to display a graph. To change one of the default
variable names, select the column title and enter a new name. To change one
of the default variable values, select the cell and enter a new value.
4 Change the orientation of the bar by selecting
Chart Type Horizontal Bar
CHAPTER
11
Creating Interactive Output for
Java
Overview 397
When to Use the JAVA Device Driver 398
Generating Output for Java 398
About Languages and Special Fonts in Java 400
Configuring Drill-Down Links for Java and ActiveX 400
Setting the Drill-Down Mode 401
Configuring the Local Drill-Down Mode 401
Understanding Default Behavior in Local Mode 402
Customizing Drill-Down Levels 405
Configuring the Script Drill-Down Mode 407
Working with the Array of Arguments 408
Generating a JavaScript 409
Configuring the URL Drill-Down Mode 409
Configuring the HTML Drill-Down Mode 410
Variables as Substitution Strings 410
Drill-Down Tags as Substitution Strings 411
Understanding Variable Roles 411
Using Drill-Down Tags 412
Configuring the Drill-down Response 413
Removing Blank Spaces from Data Values 414
Disabling the Drill-Down Functionality 414
Examples of Interactive Java Output 415
Local Drill-Down Mode 415
Script Drill-Down Mode 416
URL Drill-Down Mode 417
HTML Drill-Down Mode 419
Overview
The JAVA device driver generates interactive presentations that run in the Graph,
Map, and Contour applets. These applets enable users to interact with the output of
the GCHART, GPLOT, G3D, GMAP, and GCONTOUR procedures.
The Java applets enable the Web user to display data values, to change the type of
the graph, to pan, rotate, and zoom, and to change colors, fonts, axes, legends, and
variable roles.
You can enhance Java graphs by setting applet parameters and specifying Output
Delivery System (ODS) options. Applet parameters let you configure drill-down and
override default values in the user interface. Information on parameters is provided in
Chapter 12, “Attributes and Parameters for Java and ActiveX,” on page 421.
398 When to Use the JAVA Device Driver Chapter 11
You can use ODS to enhance the appearance of Java charts using graph styles, as
described in “Using ODS Styles” on page 488. You can also use ODS to generate other
HTML enhancements, as described in “Overview of ODS Enhancements for Web
Output” on page 487.
To generate a Web presentation that runs the Graph, Map, or Contour applet, you
generally specify the JAVA device driver in a GOPTIONS statement, open an output file
in ODS, specify an ODS style to set the appearance of the output, generate one or more
graphs, and close the HTML output file, as described in “Generating Output for Java”
on page 398.
You can generate the same graphs as static pictures using DEVICE=JAVAIMG. This
does not require that the Web user install the applets or JRE. For details, see
“ACTXIMG and JAVAIMG Device Drivers” on page 440.
3 Open an output file by specifying an ODS statement and a fully qualified path.
Use the STYLE= option to specify an ODS style (see “Using ODS Styles” on page
488). Use the PARAMETERS= option to configure the applet (see “Specifying
Parameters and Attributes for Java and ActiveX” on page 421). Use other ODS
options to enhance the HTML (see “Overview of ODS Enhancements for Web
Output” on page 487).
ods html
file="/dept/web-server1/sales/q393/eastregion.html"
style=gears
parameters=("tips"="none")
headtext="Georgia Peaches, Inc."
nogtitle;
Creating Interactive Output for Java Generating Output for Java 399
To run an applet, your audience must be able access the appropriate Java
archive files. Two archives are referenced by default: one is the Java plug-in from
Sun Microsystems, and the other is the SAS Java archive.
In the ODS output file, the location of the Java plug-in from Sun Microsystems
is specified in the CODEBASE attribute of the OBJECT tag. If you need to change
this default value, then use the ATTRIBUTES= option of the ODS statement, as
described in “Specifying Parameters and Attributes for Java and ActiveX” on page
421. On Windows systems, the user is prompted to install the plug-in if it is not
already installed. On other systems, the plug-in can be installed from the Sun
Microsystems site (http://www.sun.com) or from one of the SAS Third Party
Software Components CDs.
The location of the SAS Java archive is specified in the CODEBASE parameter
in the body of the APPLET tag. The default CODEBASE is specified by the
APPLETLOC= system option. If the default value of this system option specifies a
widely-accessible URL, then you need not change this value. If you need to specify
a different location, then you can change the value of the system option. Another
alternative is to override the APPLETLOC= system option by specifying a value
for the ODS statement option CODEBASE=, as described in “Specifying
Parameters and Attributes for Java and ActiveX” on page 421.
Note: When specifying a location for the SAS Java archive, you can use an
HTTP address, or you can use a UNC path, such as //sasjava, with forward slashes
instead of backward slashes. 4
4 Provide data using a LIBNAME statement or a DATA step.
data regsales;
length Region State $ 8;
format Sales dollar8.;
input Region State Sales;
datalines;
West CA 13636
West OR 18988
West WA 14523
Central IL 18038
Central IN 13611
Central OH 11084
Central MI 19660
South FL 14541
South GA 19022
;
The procedure does not require any additional statements to generate output that
runs in an applet.
6 Close the HTML output file and reopen the ODS listing destination.
Running your program starts the applet and displays the initial graph.
400 About Languages and Special Fonts in Java Chapter 11
If the browser display differs from what you would see in SAS without ODS, then
ensure that your SAS/GRAPH procedure is fully enabled in the applet. Refer to
Appendix 1, “Summary of ActiveX and Java Support,” on page 1507 for details.
Note: Using PROC GMAP to generate a highly detailed map might create a large
HTML output file, which might cause problems on certain browsers. If this is the case,
you can run PROC GREDUCE to remove some of the complexity and produce a more
usable map. 4
For further information on troubleshooting Web output, see “Troubleshooting Web
Output” on page 579.
URL mode
displays URLs that are provided by link variables. The link variables are
identified to the graphics procedure with the HTML= option. The drill-down
functionality of the URL mode is similar to the drill-down functionality that is
provided by the GIF, JPEG, and PNG device drivers, with the addition of the
improved rendering and the availability of graph styles in ODS. See “Configuring
the URL Drill-Down Mode” on page 409.
HTML mode
generates drill-down URLs based on a substitution pattern that you specify in
your SAS/GRAPH program. The Graph Applet, Map Applet, or the ActiveX
Control completes the URL by inserting the specified data from the graph element
that was selected in the drill-down action. See “Configuring the HTML Drill-Down
Mode” on page 410.
Any mode (Graph applet and ActiveX control)
attempts to implement each of the four drill-down modes in succession until a
valid Web destination is found. The order of the attempts is Local (Graph applet
only), Script, URL, and HTML.
The Graph applet has selectable drill-down modes. You can select these modes from the
applet menu.
Note: If the HTML= option is specified in the procedure that generates the initial
graph, then the URL drill-down mode is automatically set. 4
The drill-down modes are specified as applet parameters, in the PARAMETERS=
option of an ODS statement. Definitions of applet parameters are provided in
“Parameter Reference for Java and ActiveX” on page 424.
In a Web browser, selecting a bar in the graph causes the Graph applet to generate a
new three-dimensional vertical bar chart. By default, the Graph applet retains the type
and style of the initial graph in all the drill-down graphs in that presentation. In this
example, all of the drill-down graphs will be three-dimensional vertical bar charts using
the ODS graph style GEARS.
Selecting the bar on the far left in the initial graph generates the first-level graph
shown in Display 11.2 on page 404.
404 Configuring the Local Drill-Down Mode Chapter 11
The first-level drill-down graph retains the dependent variable SALES. The subset of
data that the Graph Applet uses to generate the drill-down graph is defined by the
drill-down action. The bar on the far left of the initial graph depicts part of the east
region, so the drill-down graph shows east region sales only.
To differentiate the east region data, the Graph Applet makes the variable YEAR the
independent variable. In the initial graph, the YEAR variable was a subgroup variable.
In the drill-down graph, the variable STATE is now the sole subgroup variable.
Subsetting repeats if you click on an element in the first-level drill-down graph. For
example, selecting the bar on the far left (labeled 1998) displays the following
second-level drill-down graph.
Creating Interactive Output for Java Configuring the Local Drill-Down Mode 405
The second-level drill-down graph shows 1998 sales figures for the east region states
MA and NC. The dependent axis is unchanged and the STATE variable becomes the
sole variable that is represented on the independent axis.
The second-level drill-down graph is the last that can be generated out of this data
set, because no other variables can appear as independent variables.
The preceding example shows how the Graph applet generates drill-down graphs in
the default configuration of the Local drill-down mode. The Graph applet retains the
dependent variable and subsets the data based on the drill-down selection. At each
level of drill-down, the applet promotes a new variable into the independent role. This
succession can recur until the data cannot be subset any further. The succession uses all
independent variables first, followed by all group and subgroup variables. Variables that
are assigned to multiple roles are used in the order in which they appear in the data set.
Now that you see how the Graph applet generates Local-mode drill-win graphs by
default, you can move on to configuring the drill-down graphs on your own, as described
in “Customizing Drill-Down Levels” on page 405.
To see the SAS/GRAPH code that was used to generate this example, see “Local
Drill-Down Mode” on page 415. You can use that example to experiment with different
drill-down configurations.
ODS HTML
PARAMETERS=("DDLEVELn"="string");
n
represents the number of the drill-down level that is being configured.
406 Configuring the Local Drill-Down Mode Chapter 11
string
specifies the graph type, the variable roles in the new graph, the color of the
elements in the new graph, and the variable that is to be subset to create the
elements in the new graph.
The syntax of the string argument is as follows:
{CHART} {chart_type} {tag_1} {variable_1...} {...tag_n} {variable_n} | {subset_tag_1...}
<{...subset_tag_n}>
{CHART} {chart_type}
identifies the type or style of the graph. This tag is case-sensitive: it must always
be specified in uppercase. The values of the tag (chart types) are not
case-sensitive. To use the same chart type as the preceding drill-down level, do not
specify the CHART tag. Available chart types are as follows:
HBAR
generates a two-dimensional horizontal bar chart.
HBAR3D
generates a three-dimensional horizontal bar chart.
VBAR
generates a two-dimensional vertical bar chart.
VBAR3D
generates a three-dimensional vertical bar chart.
PIE
generates a two-dimensional pie chart.
PIE3D
generates a three-dimensional pie chart.
SCATTER
generates a scatter plot that is similar in appearance to Figure 46.13 on page
1319.
LINE
generates a line or needle plot that is similar in appearance to Figure 7.17 on
page 192.
BOX
generates a box plot that is similar in appearance to Figure 7.15 on page 188.
HILO
generates a high-low plot that is similar in appearance to Figure 7.16 on page
190.
{tag_1} {variable_1...} {...tag_n} {variable_n}
associates drill-down tags with data set variables, to specify roles for variables in
the new graph, and to optionally determine the color of the elements in the new
graph. For definitions of the drill-down tags, see “Using Drill-Down Tags” on page
412.
{subset_tag_1...} <{...subset_tag_n}>
specifies one or more variable roles from the original graph whose values will be
used to subset the data in the preceding graph. For example, if you specify
G_GROUPV, then the data that will be used to draw the new graph will consist
only of data that is associated with the group variable in the preceding graph. For
example, if the group variable in the preceding graph was REGION, and if the
value of that variable in the selected graph element was East, then the drill-down
Creating Interactive Output for Java Configuring the Script Drill-Down Mode 407
graph would be drawn only with the observations where the REGION variable had
the value of East.
At least one of the following tags must be specified as the subset variable:
G_INDEPV, G_GROUPV, G_SUBGRV, or G_DEPTHV. For definitions of these
tags, see “Using Drill-Down Tags” on page 412.
Specifying multiple subset variables means that two or more values must match
the value in the selected graph element for that observation to be used in the new
graph. For example, assume that you specify {G_INDEPV}{G_SUBGRV} as the
subset variables, and that the selected graph element has an independent variable
of YEAR and a subgroup variable of STATE. Also assume that the values for these
variables in the selected graph element were 2000 and NC. The observations that
would be used in the drill-down graph would include those with YEAR=2000 and
STATE=NC.
The following example shows how the DDLEVENn parameter can be used to specify
the default behavior for the first drill-down level.
ods html file=odsout
parameters=("drilldownmode"="local"
"ddlevel1"="{chart}{vbar3d}
{g_dep}{sales}
{g_indep}{year} |
{g_indepv}" );
As the example shows, the value of the DDLEVELn parameter is divided into two
halves, which are separated by a vertical bar character. The drill-down graph is
configured in the syntax that appears before the vertical bar character ( | ). After the
vertical bar, drill-down tags specify how the data from the previous level of drill-down is
to be subset for use in the current drill-down graph.
In the preceding example, the first drill-down level (DDLEVEL1) is configured as a
three-dimensional vertical bar chart. The dependent variable is SALES and the
independent variable is YEAR. The G_INDEPV tag specifies that the data is to be
subset based on the independent variable in the previous graph that was selected by
the Web user. In our example, the independent variable in the initial graph is
REGION. If the Web user selects a graph element that describes the WEST region, then
the data will be subset such that the drill-down graph will contain only those
observations for which the value of the REGION variable is WEST.
If you do not specify a role for a variable, then that variable does not appear in the
drill-down graph. If you do not specify variables for the G_DEP and G_INDEP tags,
then the Graph Applet uses the independent and dependent variables of the graph in
the preceding drill-down level.
You can explicitly remove a variable role (such as group or subgroup) from the
drill-down graph by specifying a $ character as the drill-down value, as in
{G_GROUP} {$}
Web users can make this change in the Graph Applet menus by selecting the None
option from the list of variables that can be applied to a given variable role. Note that
you cannot assign a $ to the G_INDEP and G_DEP variables, because they must
always be present in the drill-down graph.
JavaScript callback method in response to drill-down actions. You use PUT statements
to write the callback method into the HTML output file. Some experience with
JavaScript is therefore required.
The syntax used to implement the Script drill-down mode is specified in the ODS
statement as follows:
ODS HTML
PARAMETERS=("DRILLDOWNMODE"="SCRIPT" "DRILLFUNC"="method");
The applet parameter DRILLDOWNMODE (see “Setting the Drill-Down Mode” on page
401) establishes the Script drill-down mode. The DRILLFUNC parameter specifies the
name of the JavaScript callback method that will be executed in response to drill-down
actions.
In response to a drill-down action, the applet or control generates an array of
arguments that is to be passed into the callback method. The array contains all of the
data that is associated with the selected graph element. The callback method can make
use of any of the data in the array as it generates its output. As the callback method
terminates, it may return an object. The applet or control ignores this object.
To invoke the callback method, the applet or control issues
netscape.javascript.JSObject.call(), in the following form:
PUBLIC OBJECT CALL(STRING method-name, OBJECT argument-array-name[])
The method-name argument is the name of the callback method that you define in
JavaScript in your program. The applet or control supplies the argument-array-name.
The filename is a concatenation of the formatted values of the independent, group, and
subgroup variables in the graph at the preceding drill-down level.
Note: The file name and file type are provided as a convenience. If you use this file
name and file type, then it is up to you to create the actual file and to provide its
content. 4
The remaining elements in the array consist of drill-down tags, and the data that is
associated with those tags in the graph element that was selected in the drill-down
action. Each variable is represented by triplet pairs of arguments in the array, in the
following sequence:
tag variable_name
tagV variable_value
tagV,F formatted_value
Creating Interactive Output for Java Configuring the URL Drill-Down Mode 409
Thus, each data value in the selected graph element is represented by six arguments in
the array.
For example, assume that the graph shown in Display 11.1 on page 403 is configured
for Script drill-down mode. Selecting the east region sales figures for the state of North
Carolina generates the following array:
[appletName East1998NC.html
G_DEP Sales G_DEPV 10000 G_DEPV,F $10,000
G_INDEP Region G_INDEPV East G_INDEPV,F East
G_GROUP Year G_GROUPV 1998 G_GROUPV,F 1998
G_SUBGR State G_SUBGRV NC G_SUBGRV,F NC]
The output filename is East1998NC.html. The remaining triplet pairs would capture
the roles and values of the variables that make up the selected graph element. Note
that all variable names are case-sensitive as they appear in the array. For example, the
value Region is capitalized. This would be the case only if the variable name was
defined as Region in the DATA step.
Generating a JavaScript
To implement Script drill-down mode, you use PUT statements in a DATA step to
write a JavaScript callback method into the HTML output file. To see an example that
shows you how to use PUT statements to generate JavaScript, see “Script Drill-Down
Mode” on page 416.
For information on writing JavaScript, refer to the many JavaScript tutorials that
are available on the Internet.
3 Open an HTML output file in ODS and specify URL drill-down mode.
Note that you need not specify the applet parameter DRILLDOWN=URL. This
drill-down mode is invoked by default when you specify the statement option
HTML= (as shown in step 5).
4 Specify drill-down URLs by adding a link variable to your data set. See “Adding
Links with the HTML= and HTML_LEGEND= Options” on page 574.
5 Specify a SAS/GRAPH procedure to generate the graph. Specify the statement
option HTML= to identify the link variable. Note that you cannot use the
HTML_LEGEND= option for this purpose with these device drivers.
410 Configuring the HTML Drill-Down Mode Chapter 11
6 Close the HTML output file and reopen the ODS listing destination.
To see an example program that implements the URL drill-down mode, see “URL
Drill-Down Mode” on page 417.
In the preceding example, the value of the data set variable STATENAME completes
the drill-down URL.
When ODS is configured as shown above, the applet or control dynamically generates
URLs in response to drill-down actions. The applet or control replaces the substitution
strings with data values from the graph element that was selected in the drill-down
action. The URL-with-substitution-strings can include multiple substitution strings.
Substitution strings can include combinations of variable names, variable roles or
labels, and drill-down tags. For details, see “Variables as Substitution Strings” on page
410 and “Drill-Down Tags as Substitution Strings” on page 411. All substitution strings
are enclosed in brackets ( { and } ) and begin with an ampersand character (&).
{&variable_name}
Because JavaScript is case-sensitive, the name of the variable must be specified exactly
as it is specified in the data set.
An example of a variable name substitution string might look like this:
http://ourweb.com/uspop/{&statename}/poptable.htm
The substitution string above could be used in a Web presentation that begins with a
map of the United States. In response to a drill-down action in HTML mode, the value
of the STATENAME variable for the selected state would be substituted into the URL.
The resulting URL would point to a Web page that contains a table of population
information for the selected state.
Now assume that a Web user selects an element in the graph. If the independent
variable for that graph was the variable REGION, and if the value of the REGION
variable in the selected graph element was East, then the applet would display the
following URL:
http://ourweb.com/regstaff/East/stafflist.htm
The URL that results from this specification points to an HTML file in the same
directory as the top-level HTML file. The name of the file consists of a concatenation of
formatted values for the first independent, group, and subgroup variables that are
defined in the data set.
To see an example program that uses the HTML drill-down mode, see “HTML
Drill-Down Mode” on page 419.
Table 11.1 Drill-Down Tags Used by the Graph Applet, Map Applet, and ActiveX
Control
G_COLOR Use new colors for the Name of the new color Scatter plots
graph elements variable
G_DEPTH Use a new depth Name of the new Vertical bar charts
variable depth variable and scatter plots
When you specify a variable name after a tag, that name must be specified exactly the
way it appears in the data set, because variable names are case-sensitive in JavaScript.
To find out how a variable was defined in the data set, use the CONTENTS procedure.
You can explicitly remove a tag by specifying a $ for its value, which is the same as
setting it to None using the menu of the applet or control. This removes from the graph
the data and axis label that would otherwise be included in the graph. Note that you
cannot set the values of the G_INDEP and G_DEP tags to None because they are
always represented in the graph.
For Script drill-down mode only, you can specify that data values are to be formatted
or not formatted. By default, the values of the variables are not formatted. If the
characters ,f are appended to the end of the tag, then those values will be presented in
formatted form. For example, the following tag specifies that the values of the
independent variable cost are to appear in formatted form:
{g_inep,f}{cost}
The format is applied using the FORMAT statement in the DATA step or graphics
procedure that generated the data for the graph. Formatted values are specified in the
statement that generated the original graph. For example, assume that the
DOLLAR5.2 format was specified for the cost variable. If the value of the cost
variable is 10, its unformatted value would be 10, and its formatted value would be
$10.00. Formatted values are used for axis labels, legends, and data tips that are
displayed when the mouse is positioned over a graph element.
You may also append ,n to tags that reference variables whose values are URLs.
Normally, the substitution string is URL-encoded for browsers that do not support
embedded white space in URL strings. Use ,n to prevent this encoding. Note that using
,n is not the same as using the applet parameter PATTERNSTRIP, which removes
blank spaces from data values before those values are applied to substitution strings.
No intervening white space should be added between the primary tag and the
appended ,f or ,n characters.
ODS HTML
PARAMETERS=("DRILLTARGET"=
"_BLANK" | "_SELF" | "_PARENT" | "_TOP" | any_named_target)
414 Removing Blank Spaces from Data Values Chapter 11
_BLANK
displays the drill-down graph in a newly opened, unnamed browser window.
_SELF
displays the drill-down graph in the same frame or window as the initial graph.
This is the default behavior in most browsers.
_PARENT
displays the drill-down graph in the parent frame in a frameset. If no frames are
defined, this value is the same as _SELF.
_TOP
displays the drill-down graph in the full browser window, thereby replacing any
frames that were defined in that window.
any_named_target
displays the drill-down graph in the appropriately named frame or browser
window.
Note: If a Netscape browser is configured to launch with a blank page (using
_BLANK) in a new browser window, that page will not receive the access authorizations
that existed in the previous window. If the Netscape setting is changed to launch
Netscape with the "Last page visited," then the page does receive the access
authorizations. 4
data sales;
length Region $ 4 State $ 2;
format Sales dollar8.;
input Region State Sales Year Qtr;
datalines;
West CA 13636 1999 1
West OR 18988 1999 1
West CA 14523 1999 2
West OR 18988 1999 2
East MA 18038 1999 1
East NC 13611 1999 1
East MA 11084 1999 2
East NC 19660 1999 2
West CA 12536 1998 1
West OR 17888 1998 1
West CA 15623 1998 2
West OR 17963 1998 2
East NC 17638 1998 1
East MA 12811 1998 1
East NC 12184 1998 2
East MA 12760 1998 2 ;
rpt=’href="south.html"’;
else if Region=’West’ then
rpt=’href="west.html"’;
datalines;
West CA 13636
West OR 18988
West WA 14523
Central IL 18038
Central IN 13611
Central OH 11084
Central MI 19660
South FL 14541
South GA 19022
;
/* Open the HTML output file and specify the URL drill-down mode. */
ods html body=sales
path=urldrill
style=money
parameters=("drilldown"="url";
quit;
run;
data work.mydata;
length statename $1020;
set work.mydata;
title1
"Click on a state to go to that state’s home page";
/* Close the HTML output file and open the listing destination. */
ods html close;
ods listing;
421
CHAPTER
12
Attributes and Parameters for
Java and ActiveX
In the HTML output file, the WIDTH attribute appears inside the beginning OBJECT
tag:
<OBJECT height=480 width=720>
/* parameters and graph info here */
</OBJECT>
Valid attribute names are those that are enabled for the OBJECT tag in HTML.
Valid attributes must also be specified as required by Java or ActiveX device drivers
that run in the operating environment.
All of the name/value pairs that are specified in the ODS statement option
PARAMETERS= appear in the body of the OBJECT tag. For example, the
BACKIMAGE parameter provides a path to an image that the applet or control displays
behind the graphical output in the browser window.
Valid parameter values for the ActiveX control, Graph applet, Map applet, and
Contour applet are defined in “Parameter Reference for Java and ActiveX” on page 424.
Parameters for other applets, such as Metaview, are provided in the sections that apply
to those applets, as in “Metaview Applet Parameters” on page 475.
Note: The ActiveX control must be installed locally on each PC where the web
presentation will be viewed. 4
If you use the DS2GRAF macro to generate output containing an ActiveX control,
then specify the location and version of the .exe file with the CODEBASE= macro
argument. Use the %STR function to enclose the argument value. For example:
%ds2graf(codebase=%str(http://web_server_name/sasweb/graph/sasgraph.
exe#version=9,1,0,304),htmlfile=your_path_and_filename.htm
...
The ARCHIVE= option specifies the file name of the .jar file. You do not need to
specify the ARCHIVE= option on the ODS statement unless you have renamed the
.jar files.
For applets generated with macros, specify the CODEBASE= argument for the
macro. For example:
%ds2const(codebase=http://your_path_to_archive,
htmlfile=your_path_and_filename.htm
...
);
For the DS2GRAF, DS2CSF, and META2HTM macros, you must also specify the
ARCHIVE= macro argument. For example:
%meta2htm(htmlfref=_webout,openmode=replace,
codebase=http://web_server_name/sasweb/graph
archive=metafile.zip);
For the DS2TREE and DS2CONST macros, you do not need to specify the
ARCHIVE= argument unless you have renamed the .jar files.
by e-mail or copied to Web servers without the control or the applets installed, then you
should use a full URL to point to the applet .jar files at a known location.
On Windows systems, the user is prompted to install the plug-in if it is not already
installed. On other systems, the plug-in can be installed from the Sun Microsystems site
(http://www.sun.com) or from one of the SAS Third Party Software Components CDs.
DRILLDOWNFUNCTION on page ♦ ♦ ♦
428
Parameter Reference for Java and ActiveX 425
GRADIENTBACKGROUND on page ♦ ♦ ♦ ♦
431
LEGENDWIDTHPERCENT on page ♦
432
426 Parameter Reference for Java and ActiveX Chapter 12
MINLEGENDFONTSIZE on page ♦
433
MISSINGCOLOR on page 434 ♦
Parameter Definitions
AMBIENT=light-level
specifies the intensity of non-directional ambient light in relation to direct light.
Valid values range from 0.0 to 1.0. The default value is 0.4. The sum of direct
light (see the DIRECT parameter) and ambient light can never exceed 1.0. Direct
light is given priority. If you specify a sum of these two values that is greater than
one, the ambient value will be reduced so that the sum of the two values equals
one. This parameter is valid in the ActiveX control and for the Contour applet.
BACKCOLOR=color
specifies the background color of the applet. The default value is the default
window color of the operating system. This parameter is valid only in the Contour
applet.
BACKDROPCOLOR=color
specifies the color of all walls in the applet, including the floor. The default value
is white. This parameter is valid only in the Contour applet.
BACKIMAGE=image-URL
specifies the URL of the image that is applied to the background of the applet
image area. By default, no image is used and the background is drawn in a single
solid color. The way that the image will be applied to the background is specified
with the DRAWIMAGE parameter. For the ActiveX control, the background image
must be in GIF, JPEG, or BMP format. For the Graph, Map, or Contour applet,
the URL must be absolute and not relative.
CLIPTIPS=TRUE | FALSE
indicates whether data tips should be clipped. The default value of TRUE does not
display data tips when the cursor is outside of the plot area. A value of FALSE
displays data tips when the cursor is outside of the plot area. The data tips
window hugs the boundary and displays the value of the element that is closest to
the cursor along that edge of the plot. This parameter is valid only in the Contour
applet.
COLORNAMELIST=string
specifies which of two named color lists has priority when searching for named
colors. The default is to search the list of HTML 3.2 colors first, followed by the
SAS name list. Specifying SAS as the string reverses this priority, giving SAS
names higher priority. This parameter is valid only in the Contour applet.
COLORNAMES=name1=value1,name2=value2, ... nameN=valueN
specifies the color names and associated 6-digit hexadecimal RGB values that will
be displayed in the Standard Colors list box in the Color Edit dialog box. In the
parameter value, no white space is allowed. The color name can be any valid
string, and is displayed as specified in the list box. This parameter is valid in the
Graph, Map, and Contour applets.
428 Parameter Definitions Chapter 12
COLORSCHEME=scheme-name
specifies the name of the color scheme that is applied to the graph. By default, no
color scheme is applied to the graph. This parameter is valid in the ActiveX
control and the Graph applet.
DDLEVELnconfiguration-string
configures the drill-down graph that is generated at the drill-down level that is
specified by the letter n. The drill-down graph is configured using drill-down tags
such as G_INDEPV. For details, see “Using Drill-Down Tags” on page 412. This
parameter is valid in the ActiveX control and in the Graph and Map applets.
DIRECT=light-level
specifies the intensity of direct light (from a light source) in relation to the
ambient (non-directional) light. Valid values range from 0.0 to 1.0. The default
value is 0.6. The sum of direct light and ambient light (see the AMBIENT
parameter) cannot exceed 1.0. Direct light is given priority. If you specify a sum of
these two values that is greater than one, the level of ambient light will be
reduced so that the sum of the two values equals one. This parameter is valid in
the ActiveX control and the Contour applet.
DRAWIMAGE=background-image-application
specifies how the image specified in the BACKIMAGE parameter is applied to the
background of the applet window. This parameter is valid for the Graph, Map, and
Contour applets. Here are the valid values:
CENTER
centers a single instance of the image in the background, without resizing the
image.
POSITION
places a single instance of the image at the location supplied by the
IMAGEPOSX and IMAGEPOSY parameters, without resizing. If these
parameters are not specified, then the image is positioned at the top left
corner of the applet window.
SCALE
fills the entire background of the applet window with a single instance of the
specified image, which is resized as necessary.
TILE
fills the entire background of the applet window using multiple instances of
the specified image, without resizing that image. The images are arranged in
rows and columns.
DRAWMISSING=TRUE | FALSE
specifies whether missing values should be drawn. By default, missing values are
not drawn. Missing values are drawn only when this parameter is set to TRUE
and the Styles menu option is set to Block, Smooth, or Surface. This parameter is
valid only in the Contour applet.
DRAWSIDES=TRUE | FALSE
specifies that sides should be drawn when the value of the STACKED parameter is
TRUE and when the Styles menu option is set to Surface, Areas, or
LinesAndAreas. The default value is FALSE. To override this parameter, you can
specify an ODS style definition. This parameter is valid in the Contour applet.
DRILLDOWNFUNCTION=function-name
DRILLFUNC=function-name
specifies the name of the JavaScript function that is called in Script drill-down
mode. This parameter is valid in the ActiveX control and in the Graph and Map
applets.
Parameter Definitions 429
NMISS
stores the number of missing values found.
RANGE
stores the range of values found. The range is computed as the maximum
value minus the minimum value.
SUM
stores the sum of all values found.
FILLPOLYGONEDGES=ALWAYS | NEVER | OS/2
specifies whether to adjust rendering to fix a temporary vendor rendering defect. If
you use Netscape on OS/2, then polygon edges do not always fill in correctly. If the
value of this parameter equals the os.name Java system property, then the
Contour applet sets the default value of this parameter to OS/2, which lets
drawPolygon correctly fill in (render) the polygon edges, yet this extra drawing
effort slows performance. If you set this parameter to the value of the parameter
of the name of the operating system returned in os.name, then the adjusted
rendering is performed when the applet runs on that operating system because the
applet notifies the Java console. When you set the value to ALWAYS, the adjusted
rendering is always performed, regardless of the operating system on which the
applet is running. Similarly, if you set the value to NEVER, the adjusted
rendering is never performed on any operating system. This parameter is valid
only in the Contour applet.
FREQNAME=variable-name
specifies a name for a new variable that contains the frequency count when a
frequency chart is produced. By default, the name assigned to this variable is
“Frequency”. This parameter may be overidden if you specify an ODS style
definition. This parameter is valid in the Graph applet.
G_COLOR=variable-name
specifies a new color variable for the current drill-down level. This parameter is
valid in the ActiveX control and in the Graph and Map applets.
G_COLORV=variable-name
specifies that the current color variable is the same variable that was used to
configure the previous drill-down level. This parameter is valid in the ActiveX
control and in the Graph and Map applets.
G_DEP=variable-name
specifies a new dependent variable for the current drill-down level. This
parameter is valid in the ActiveX control and in the Graph and Map applets.
G_DEPV=variable-name
specifies that the drill-down graph at the specified drill-down level is to use the
same dependent variable that was used in the previous drill-down level. This
parameter is valid in the ActiveX control and in the Graph and Map applets.
G_DEPTH=variable-name
specifies a new depth variable for the current drill-down level. Drill-down graphs
that use this variable can be vertical bar charts or scatter plots. This parameter is
valid in the ActiveX control and in the Graph and Map applets.
G_DEPTHV=variable-name
specifies that the depth variable for the current drill-down level is the same depth
variable that was used in the previous drill-down level. Drill-down graphs that
use this variable can be vertical bar charts or scatter plots. This parameter is
valid in the ActiveX control and in the Graph and Map applets.
Parameter Definitions 431
G_GROUP=variable-name
specifies a new group variable for the current drill-down level. Drill-down graphs
that use this variable can be bar charts. This parameter is valid in the ActiveX
control and in the Graph and Map applets.
G_GROUPV=variable-name
specifies that this group variable should be the same group variable that was used
at the previous drill-down level. Drill-down graphs that use this variable can be
bar charts. This parameter is valid in the ActiveX control and in the Graph and
Map applets.
G_LABEL=variable-name
specifies a new label variable for the current drill-down level. Drill-down graphs
that use this variable can be maps. This parameter is valid in the ActiveX control
and in the Graph and Map applets.
G_LABELV=variable-name
specifies that this label variable should be the same label variable that was used
at the previous drill-down level. Drill-down graphs that use this variable can be
maps. This parameter is valid in the ActiveX control and in the Graph and Map
applets.
G_INDEP=variable-name
specifies a new independent variable for the current drill-down level. Drill-down
graphs that use this variable can be charts and maps. This parameter is valid in
the ActiveX control and in the Graph and Map applets.
G_INDEPV=variable-name
specifies that an independent variable at the current drill-down level is the same
variable that was used at the previous drill-down level. Drill-down graphs that
use this variable can be charts and maps. This parameter is valid in the ActiveX
control and in the Graph and Map applets.
G_SUBGR=variable-name
specifies a new subgroup variable for the current drill-down level. Drill-down
graphs that use this variable can be bar charts and scatter plots. This parameter
is valid in the ActiveX control and in the Graph and Map applets.
G_SUBGRV=variable-name
specifies that a subgroup variable at this drill-down level is the same subgroup
variable that was used at the previous drill-down level. Drill-down graphs that
use this variable can be bar charts and scatter plots. This parameter is valid in
the ActiveX control and in the Graph and Map applets.
GRADIENTBACKGROUND=TRUE | FALSE | VERTICAL | HORIZONTAL
specifies that the background of the window is or is not using a color gradient. To
override this parameter, you can specify an ODS style definition. This parameter
is valid in the ActiveX control and in the Graph, Map, and Contour applets. TRUE
and FALSE are valid only for the Graph and Map applets. VERTICAL and
HORIZONTAL specify the orientation of the color gradient and are only valid for
the Contour applet. This parameter is ignored in the Contour applet if you specify
the BACKIMAGE parameter. Use GRADIENTSTARTCOLOR and
GRADIENTENDCOLOR to define the colors used to draw the background.
GRADIENTENDCOLOR=color
GRADIENTSTARTCOLOR=color
specify the start color and the end color when two colors are blended in a gradient
across a wall, background, or graph element. The color can be an HTML 3.2 color
name or a 6-digit hexadecimal RGB value. This parameter may be overidden if
432 Parameter Definitions Chapter 12
you specify an ODS style definition. This parameter is valid in the ActiveX control
and in the Graph, Map, and Contour applets.
HELPLOCATION=URL
specifies a non-default location for application-specific help that replaces the
default help. The default help location is the SAS Web site. This parameter is
valid in the ActiveX control and in the Graph, Map, and Contour applets.
HONORASPECT=TRUE | FALSE
specifies whether the aspect of the data being displayed is or is not honored. The
default value FALSE scales the shortest axis (x or y). This parameter is valid in
the Contour applet. Note that certain annotations, such as pies, may display
differently in the applet than in SAS when the value is FALSE.
IMAGEPOSX=horizontal-pixels
IMAGEPOSY=vertical-pixels
specify the location of the upper-left corner of the background image that is named
in the BACKIMAGE parameter. These parameters are ignored unless the value of
the DRAWIMAGE parameter is POSITION. Positive pixel values are measured
from the top-left corner of the applet window. Negative pixel values are measured
from the bottom-right corner of the applet window. These parameters are valid in
the ActiveX control and in the Graph, Map, and Contour applets.
LEGENDFIT=TRUE | FALSE
specifies the default size of the font to be used in the legend. Only positive values
are valid. This parameter is valid only in the Contour applet.
LEGENDFONT=font
specifies which font to use in the legend. Except for the case, the font name must
match the name of a Java font available in the browser. This parameter is valid
only in the Contour applet.
LEGENDFONTSIZE=font-size
specifies whether the legend should fit within the height of the contour plot area.
By default the legend occupies as much of the applet height as is feasible. If
TRUE, the height of the legend is restricted to the height of the contour plot
within the legend. When you set this parameter, any value specified for
LEGENDHEIGHTPERCENT is ignored. This parameter is valid only in the
Contour applet.
LEGENDHEIGHTPERCENT=percentage
restricts the height of the legend to a specified percentage of the height of the
Contour applet. A vertical margin is always maintained. Valid values are greater
than 0 and less than 100 percent, with the default value being 20. This parameter
is valid only in the Contour applet.
LEGENDPERCENT=percentage
specifies how much of the Contour applet space (width) to use as the legend area.
Valid values are 0 to 80 percent. The default value is 20. This parameter is valid
only in the Contour applet.
LEGENDWIDTHPERCENT=percentage
restricts the width of the legend to a specified percentage of the width of the
Contour applet. A horizontal margin is always maintained. Valid values are
greater than 0 and up to 80 percent, which the default value being 20. This
parameter is valid only in the Contour applet.
LEVELOFDETAIL=TRUE | FALSE
specifies whether the level-of-detail processing should be used when drawing plots.
The default value is TRUE, which allows level-of-detail processing. See also the
LODCOUNT parameter. This parameter is valid only in the Contour applet.
Parameter Definitions 433
MISSINGCOLOR=color
specifies an HTML 3.2 color name or 6-digit hexadecimal RGB value that is to be
used to draw missing values. The default color is black. This parameter is valid in
the Contour applet.
NAME=applet-name
specifies the name for this instance of the applet. Use this parameter only if you
have more than one instance of the APPLET tag in your HTML file, and if you
have included your own scripts or DHTML that communicates with or acts on a
particular instance of the applet. This parameter may be overidden if you specify
an ODS style definition. This parameter is valid in the Graph, Map, and Contour
applets.
NAVIGATERENDERMODE=NONE | POINT | SOLID | WIREFRAME
specifies how to render the graph during pan, rotate, and zoom. The default value
is WIREFRAME. This parameter is valid when the RENDERQUALITY parameter
is set to CUSTOM. This parameter may be overidden if you specify an ODS style
definition. This parameter is valid in the Contour applet.
NOJSOOBJECT
specifies that no JavaScript callback options can be created or used within the
applet. This parameter may be overidden if you specify an ODS style definition.
This parameter is valid in the Graph applet.
OUTLINECOLOR=color
specifies the HTML 3.2 color name or 6-digit hexadecimal RGB value for the
outlines of graph elements. This parameter is valid in the ActiveX control and in
the Graph and Contour applets.
OUTLINES=TRUE | FALSE
specifies whether outlines should be drawn for the current contour style. Outlines
are drawn when this parameter is TRUE and the Styles menu option is set to
Area, Block, or Surface. This parameter is valid only in the Contour applet.
OVERFLOWCOLOR=color
specifies an HTML 3.2 color name or a 6-digit hexadecimal RGB color for colors
that are assigned to data values that exceed the maximum range of colors that
have been defined in the color palette. The default value is CYAN. This parameter
is valid in the ActiveX control and in the Contour applet.
PATTERNSTRIP=TRUE | FALSE
removes preceding and trailing white space from drill-down substitution patterns
before the substituted text is added into a dynamically generated drill-down URL.
The default value is FALSE. This parameter is valid in the ActiveX control and in
the Graph and Map applets.
PROJECTION=ORTHOGRAPHIC | PERSPECTIVE
specifies the type of projection that is used to draw contours. The default value is
ORTHOGRAPHIC. This parameter is valid in the Contour applet.
PROJECTIONRATIO=plot-size-ratio
specifies the ratio of the plot area (applet size minus legend reserve) to the longest
dimension of the plot. For example, specifying a value of 2.0 means that the area
that contains the contour plot is twice the size of the longest plot dimension. This
guarantees that the plot will be surrounded by a space that measures half the
length of the longest projection (not including axes). The default value is 1.5.
Values must be greater than or equal to 1.0. This parameter is valid in the
Contour applet.
Parameter Definitions 435
RENDERMODE=string
specifies how to render the contours when you are not navigating (panning,
rotating, or zooming) the Contour applet. This parameter is valid only in the
Contour applet. In some cases, changing the representation can provide additional
information about the image, such as more clearly displaying cell boundaries.
Here are the valid values for the polygon representations that determine how the
Contour applet image can be drawn:
POINT
draws polygons using only single-pixel points at the polygon vertices.
SOLID
draws filled polygons. This is the default value and the normal
representation.
WIREFRAME
draws polygons using only lines to represent their edges.
RENDEROPTIMIZE=ALWAYS| NAVIGATION | NEVER | ONNAVIGATION
sets the default for rendering optimization for the Contour applet. This parameter
is valid only in the Contour applet. To correctly render images, the applet must
first sort the polygons that comprise the image. Some polygons require additional
sorting steps to ensure that they are correctly drawn. In many cases, these
additional steps are unnecessary because they only slow applet performance and
do not add to image quality. This parameter lets you specify if and when the
applet should attempt to optimize or reduce the number of sorting operations to be
performed. The RENDEROPTIMIZE parameter is ignored unless you set the
RENDERQUALITY parameter to CUSTOM. The default value depends on the
value of the RENDERQUALITY parameter.
When the RENDERQUALITY parameter is set to BESTQUALITY, the default
value for the RENDEROPTIMIZE parameter is NEVER.
When the RENDERQUALITY parameter is set to FASTERNAVIGATION, the
default value for the RENDEROPTIMIZE parameter is ONNAVIGATION.
When the RENDERQUALITY parameter is set to BESTPERFORMANCE, the
default value for the RENDEROPTIMIZE parameter is ALWAYS.
RENDERQUALITY=value
specifies how two available rendering algorithms, one slower and one faster, are
applied to the graph. This parameter may be overidden if you specify an ODS
style definition. This parameter is valid for the Map and Contour applets. Here
are the valid values:
BESTPERFORMANCE | PERFORMANCE
always uses the faster, less complex rendering algorithm.
BESTQUALITY | QUALITY
always uses the slower, more complex rendering algorithm.
FASTERNAVIGATION | NAVIGATION
uses the faster, less complex rendering algorithm during pan, rotate, and
zoom, and uses the more complex algorithm otherwise. This is the default
value.
CUSTOM (Contour applet only)
lets the user select individual elements that control speed and quality
directly, rather than as a group when rendering an image.
SHOWBACKDROP=TRUE | FALSE
specifies whether all walls (including the floor) should be displayed. This
parameter overrides any ODS settings and is valid only in the Contour applet.
436 Parameter Definitions Chapter 12
SHOWLEGEND=TRUE | FALSE
specifies whether the legend should be displayed. This parameter overrides any
ODS settings and is valid only in the Contour applet.
SIMPLEDEPTHSORT=TRUE | FALSE
the default value TRUE indicates that the simpler polygon sorting algorithm is
used when rendering the plot. This parameter is valid in the Contour applet.
SIMPLETHRESHOLD=number-of-elements | NEVER
specifies an integer for the threshold that is used to determine if the graph should
be rendered using simple geometry. For bar charts, simple geometry means that
graphical elements are represented as lines. For plots, simple geometry means
that graphical elements are represented as plus signs (+).
If the graph contains a number of elements that is greater than the
SIMPLETHRESHOLD value, simple geometry is used and the Shape menu is
made unavailable. The default value is 500. You can also specify the value
NEVER, in which case simple geometry is never used and the Shape menu is
always available.
Note that if you select and display a subset of the graph, and if the number of
elements in the resulting graph drops below the value of the
SIMPLETHRESHOLD parameter, regular markers are drawn and the Shape
menu is made available.
This parameter is valid in the Graph applet.
STACKED=TRUE | FALSE
specifies whether the contours should displayed in stacked form, where height is
added to the contour plot based on the contour level. This parameter takes effect
only when the Style menu option is set to Areas or LinesAndAreas. The default
value of this parameter is FALSE. See also the DRAWSIDES parameter. This
parameter is valid in the Contour applet.
STACKPERCENT=height-percentage
specifies the maximum stacking height as a percentage of the longest axis. The
default value is 30. This parameter is valid in the Contour applet.
SURFACESIDECOLOR=color
specifies the color of the sides of a contour plot when that plot uses multiple colors.
The value of the parameter is ignored when drawing a surface plot in a single
color. The default color is the color of the minimum data value. The value must be
an HTML 3.2 color name or a 6-digit hexadecimal RGB value. This parameter is
valid in the Contour applet.
TIPBACKCOLOR=color
specifies an HTML 3.2 color name or a 6-digit hexadecimal RGB value for the
background of the data tips. The default value is YELLOW. This parameter is
valid in the Contour applet.
TIPBORDERCOLOR=color
specifies an HTML 3.2 color name or a 6-digit hexadecimal RGB value for the
border of the data tips. The default value is BLACK. This parameter is valid in
the Contour applet.
Parameter Definitions 437
VIEWPOINT=2D| SE | SOUTHEAST
defines the initial viewpoint for the Contour applet. The value SE or SOUTHEAST
set the initial viewpoint to Southeast, a three-dimensional viewpoint. The value
2D sets the value to be two-dimensional. The default value is 2D for PROC
GCONTOUR output and SOUTHEAST for PROC G3D. Setting this parameter
unlocks the 2D view (see VIEW2D). This parameter is valid only in the Contour
applet.
439
CHAPTER
13
Generating Static Graphics
For samples, see “Sample Programs for Static Images” on page 447.
ACTXIMG and JAVAIMG Device Drivers Compared to GIF, JPEG, and PNG
Device Drivers
not be identical in appearance to the image in the GRSEG catalog, but can be enhanced
with ODS stylesheet properties.
When you specify DEVICE=ACTXIMG, you can add links to the output of any
SAS/GRAPH procedure that supports the HTML= or HTML_LEGEND= option. For
further details, see “Links in GIF, JPEG, and PNG Files” on page 571 . You can also
provide pop-up data tips to display when the cursor is over an image created with the
ACTXIMG device driver (see “Data Tips in ACTXIMG and JAVAIMG Images” on page
568). When you specify DEVICE=JAVAIMG, SAS does not create an image map for
hotspot links.
The following images shows the same bar chart created with the GIF device driver.
You can generate this image by specifying GOPTIONS DEVICE=GIF. The graphs
generated by specifying DEVICE=JPEG or DEVICE=PNG are very similar to this and
differ mostly in the physical file size.
ACTXIMG device driver, see “Using ODS with the ACTXIMG Device Driver” on page
447.
Note that using PROC GMAP to generate a highly detailed map might create a large
HTML output file, which might cause problems on certain browsers. Running PROC
GREDUCE may help to remove some of the complexity and produce a more usable map.
Note: The ACTXIMG device cannot be used with the ODS PDF, PCL, PS, or
PRINTER destinations on 64-bit machines. SAS uses the JAVAIMG device instead. 4
Note: When SAS is installed on a server, the ACTXIMG and JAVAIMG drivers are
limited by the display capabilities of the server on which they run—for example, the
number of colors that the server is capable of. Consequently, the PNG output might not
look as good as what you get from the client-side drivers (JAVA and ACTIVEX). Thus, it
is better to use JAVA/ACTIVEX if the server’s display settings are less than optimal. 4
Developing Web Presentations with the GIF, JPEG, and PNG Device
Drivers
You can use the GIF, JPEG, and PNG drivers with ODS to generate an HTML file to
display multiple images. For details, see “Generating an HTML Output File with ODS
and the GIF, PNG, or JPEG Device Driver” on page 445. For information on using these
drivers without ODS, see “Generating One or More GIF, JPEG, PNG Output Files
Without ODS” on page 444.
444 When to Use the GIF, JPEG, and PNG Device Drivers Chapter 13
Enhancements that are available to GIF, PNG, and JPEG Web presentations include
formatting of the HTML output file using ODS, as described in “Overview of ODS
Enhancements for Web Output” on page 487, and adding drill-down or pop-up data-tip
functionality. Drill-down functionality can be enabled in two ways. The elements of the
graph can be hotspots, or the elements of an Annotate data set can be hotspots. For
details, see “Generating Drill-Down Web Presentations with the GIF, JPEG, or PNG
Device Driver” on page 447.
Generating One or More GIF, JPEG, PNG Output Files Without ODS
To generate just one GIF, JPEG, or PNG image file, specify a fileref, filename, and
storage location in a FILENAME statement, as follows:
filename fileref "your_path/your_file.image_extension";
To generate multiple images in a single program, specify a fileref for the path only, as
follows:
filename fileref "your_path";
The value of the GSFNAME= option is the name of your previously defined fileref,
whether that fileref references a filename or a directory.
Generating Static Graphics Naming Conventions Used for Image Output Files 445
When you have specified a storage location and your DEVICE= and GSFNAME=
graphics options, then you can run the procedure that generates the graph. The output
will be stored in the specified format in the specified output location.
Generating an HTML Output File with ODS and the GIF, PNG, or JPEG
Device Driver
Follow these steps to generate a complete Web presentation that consists of an
HTML output file and one or more images:
1 To conserve resources, close the ODS listing destination (the Output window,
which is open by default). Then reset graphics options as follows:
ods listing close;
goptions reset=all;
Specifying URL=NONE tells ODS to reference the image file simply by name
without prefixing the full path (assuming that the image file is in the same
directory as the HTML file).
Note: With the GIF, JPEG, or PNG device driver, footnotes and titles are
stored in the image file by default. To move footnotes and titles out of the image
file and into the HTML file, specify the ODS HTML options NOGTITLE or
NOGFOOTNOTE or both. 4
4 Specify your device driver:
goptions device=gif;
5 Run procedures to generate graphs. Each procedure ends with a RUN statement.
6 Close the HTML output file and reopen the ODS listing destination:
entry, then SAS/GRAPH names the GIF image file MYGRAPH.GIF. If you do not use
the NAME= option, then SAS/GRAPH names the entry with the first eight characters of
the procedure name (for example, GCHART), in which case SAS/GRAPH names the
GIF file GCHART.GIF. For more information on catalog entry names, see “Names and
Descriptions of Catalog Entries” on page 55.
By default, SAS/GRAPH does not replace existing GRSEG entries when a procedure
creates a new entry of the same name. Rather, it increments the duplicate name to
make it unique. For example, if you use a procedure’s NAME= option to name an entry
MYGRAPH and an entry named MYGRAPH already exists in the output catalog,
SAS/GRAPH names the new entry MYGRAPH1, and then names the GIF file
MYGRAPH1.GIF. Catalog entry names are limited to eight characters, so if the
duplicate name has eight characters, SAS/GRAPH replaces the final character with the
added number.
To replace an existing catalog entry, your program can first use the GREPLAY
procedure to delete the existing catalog or catalog entries (although doing so is not
required). For example, assume that the output catalog is the default, WORK.GSEG,
and assume that you use BY-group processing on the GCHART procedure to run a
program that generates three catalog entries that are named GCHART, GCHART1, and
GCHART2 by default. To run the same program again in the same session, and to
ensure that the catalog entries receive the same names, you can first run the following
GREPLAY procedure to delete the three existing catalog entries, otherwise the new
entries will be named gchart3, gchart4, and gchart5:
proc greplay igout=work.gseg nofs;
delete gchart gchart1 gchart2;
run; quit;
3 Initialize one or two link variables and add values to those variables. The link
variables provide the drill-down URLs that will appear in the image map of the
HTML output file, as described in “GIF Output with Hotspot Links” on page 452.
4 Generate an HTML output file using ODS.
ods html file="mygif1.htm"
gpath="C:\mypath\web"
5 Generate the graph as an image output file. In the statement that generates the
graph (such as VBAR3D), assign the name of a link variable as the values of the
HTML= option or the HTML_LEGEND= option or both. (See “Links in GIF, JPEG,
and PNG Files” on page 571.)
6 If necesary, create the HTML pages to be linked to.
7 Close the HTML output file and open the ODS listing destination.
ods html close;
ods listing;
Run the program and display the HTML output file in the SAS Results window or in
a Web browser. Selecting an element in the graph points the Web browser to the
associated drill-down URL.
four separate PNG files, only the first of which is shown here. A user would have to
scroll down the page in the browser to see all the PNG images displayed.
The following is the complete SAS code to generate PNG files from a SAS/GRAPH
procedure using GOPTIONS DEVICE=ACTXIMG. You should notice the following:
3 PROC GREPLAY is used to delete any old GRSEGs that were created. This is not
necessary, but otherwise SAS creates new GRSEGs each time the procedure is run
rather than replacing the old, and from them creates new PNG files, incrementing
the suffix number for each new PNG file.
3 The FILE= option of the ODS HTML statement specifies the path and filename of
the HTML file to be created. If you want to run this example, then change the
value of the option to the location where you want to store the file.
Note: You can specify the complete path and filename with the FILE= option (or
the BODY= option, which is the same), or you can specify the path separately
using the PATH= option, and just the filename with the FILE= or BODY= option.
See the section “ODS HTML Statement” in the SAS Output Delivery System:
User’s Guide.
3 The GPATH= option of the ODS HTML statement specifies the directory where the
PNG files are to be created. If you want to run this example, then change the
value of the option to the location where you want to store the file.
3 Specifying that GOPTIONS DEVICE=ACTXIMG causes the GCHART procedure
to produce PNG output.
data prdsummary;
input Year Quarter Country $ Product $ Actual dollar10.2;
label Actual=’Actual Sales’;
Generating Static Graphics Using ODS with the ACTXIMG Device Driver 449
The following is the complete SAS code to generate GIF files from a SAS/GRAPH
procedure. You should notice the following:
3 PROC GREPLAY is used to delete the GRSEGs that are already created. This is
not necessary, but otherwise SAS creates new GRSEGs each time the procedure is
run, rather than overwriting the old, and from the new GRSEGs creates new GIF
files, incrementing the suffix number for each new GIF.
3 The FILE= option of the ODS HTML statement specifies the path and filename of
the HTML file to be created. If you want to run this example, then change the
value to the directory where you want to store the HTML file.
Note: You can specify the complete path and filename with FILE= (or BODY=,
which is a synonym), or you can specify the path separately using PATH=, and just
the filename with FILE= (or BODY=) See the SAS Output Delivery System: User’s
Guide for information on the ODS HTML statement.
3 The GPATH= option of the ODS HTML statement specifies the directory where the
GIF files are to be created. If you want to run this example, then change the value
of the option to the location where you want to store the file.
3 The statement GOPTIONS DEVICE=GIF causes the GCHART procedure to
produce GIF output.
data prdsummary;
input Year Quarter Country $ Product $ Actual dollar10.2;
label Actual = ’Actual Sales’;
format Actual dollar11.;
datalines;
1993 1 CANADA BED $4,337.00
1993 1 CANADA CHAIR $5,115.00
1993 1 CANADA DESK $6,644.00
452 GIF Output with Hotspot Links Chapter 13
Here is the example code, which is available in the SAS Sample Library under the
name GWBDRILL:
htitle=6 htext=3
device=gif;
datalines;
West CA 13636
West OR 18988
West WA 14523
Central IL 18038
Central IN 13611
Central OH 11084
Central MI 19660
South FL 14541
South GA 19022
;
/* Remove the comments below to open the HTML destination for ODS output. */
/* Specify the filename in BODY= and the output path in PATH=. */
CHAPTER
14
Generating Web Animation with
GIFANIM
In the preceding example, OUT is the fileref of the GIF output file.
After the animation is complete, issue a GOPTIONS RESET=ALL statement to
prepare for succeeding SAS jobs.
Sample Programs: GIFANIM 459
3 “Sample Animated GIF, with HTML from PUT Statements” on page 460
3 “Generating an Animated Web Presentation with the GIFANIM Device Driver” on
page 463
SAS Code
The following is the complete SAS code to generate the animated GIF and an HTML
file that references it. You should notice the following:
3 The GSFNAME= option of the GOPTIONS statement specifies the name of the
GIF to be created. In this example, the value of GSFNAME is specified in an
associated FILENAME statement. If you want to run this example, then change
the value of the FILENAME statement to something that makes sense for you.
3 The following statement
goptions gsfmode=append;
Sample Animated GIF, with HTML from PUT Statements 461
is included before the second invocation of PROC GCHART so that the output is
appended to the same GIF file.
3 A FILE statement specifies the complete path and file name of the HTML file to be
created by the PUT statements. If you want to run this example, then change the
value to something that makes sense for you
data prdsummary;
input Year Quarter Country $ Product $ Actual dollar10.2;
label Actual = ’Actual Sales’;
format Actual dollar11.;
datalines;
1993 1 CANADA BED $4,337.00
1993 1 CANADA CHAIR $5,115.00
1993 1 CANADA DESK $6,644.00
1993 1 GERMANY BED $5,026.00
1993 1 GERMANY CHAIR $6,276.00
1993 1 GERMANY DESK $4,330.00
1993 2 CANADA BED $2,437.00
1993 2 CANADA CHAIR $3,115.00
1993 2 CANADA DESK $5,654.00
1993 2 GERMANY BED $3,026.00
1993 2 GERMANY CHAIR $2,276.00
1993 2 GERMANY DESK $3,320.00
1993 3 CANADA BED $6,337.00
1993 3 CANADA CHAIR $7,145.00
1993 3 CANADA DESK $7,614.00
1993 3 GERMANY BED $5,026.00
1993 3 GERMANY CHAIR $3,276.00
1993 3 GERMANY DESK $6,340.00
1993 4 CANADA BED $9,337.00
1993 4 CANADA CHAIR $2,115.00
1993 4 CANADA DESK $3,646.00
1993 4 GERMANY BED $6,026.00
1993 4 GERMANY CHAIR $7,276.00
1993 4 GERMANY DESK $8,350.00
1994 1 CANADA BED $3,327.00
1994 1 CANADA CHAIR $5,345.00
1994 1 CANADA DESK $7,624.00
1994 1 GERMANY BED $4,026.00
1994 1 GERMANY CHAIR $3,276.00
1994 1 GERMANY DESK $3,340.00
1994 2 CANADA BED $5,356.00
1994 2 CANADA CHAIR $3,115.00
1994 2 CANADA DESK $7,623.00
1994 2 GERMANY BED $8,026.00
1994 2 GERMANY CHAIR $5,276.00
1994 2 GERMANY DESK $7,321.00
1994 3 CANADA BED $4,321.00
1994 3 CANADA CHAIR $3,115.00
1994 3 CANADA DESK $5,658.00
1994 3 GERMANY BED $6,026.00
1994 3 GERMANY CHAIR $5,276.00
1994 3 GERMANY DESK $6,398.00
462 Sample Animated GIF, with HTML from PUT Statements Chapter 14
put ’</BODY>’;
put ’</HTML>’;
run;
Generating an Animated Web Presentation with the GIFANIM Device Driver 463
HTML File
The following is the HTML file that is generated by the PUT statements. Of course,
instead of embedding PUT statements in a SAS program, you can hand-create your own
HTML file using whatever editor you prefer.
<HTML>
<HEAD>
<TITLE> GIFANIM </TITLE>
</HEAD>
<BODY>
<IMG src="gifanim.gif">
</BODY>
</HTML>
The GIFANIM device driver does not provide a pull-down menu or other interactive
controls, but it does provide a simple means of translating multiple SAS/GRAPH
images into a single automated loop. The resulting GIF output is easily displayed in
your own HTML files.
To change the amount of time that each image is displayed, you can change the value
of the DELAY= goption.
464 Generating an Animated Web Presentation with the GIFANIM Device Driver Chapter 14
The SAS code for this example is in the SAS Sample Library and is named
GWBANIMA.
/** Designate a GIF file for the GMAP output. **/
%let mapsrc=your_web_path/your_gif.gif;
goptions reset=all dev=gifanim gsfmode=replace
gsfname=animmap xpixels=792 ypixels=600
transparency iteration=0 delay=150
disposal=background ftext=’Swiss’
htext=1.5;
data _null_;
file htmlfile;
source=quote("&mapsrc");
put ’<HTML>’;
put ’<BODY>’;
put ’<BLOCKQUOTE>’;
put ’<img src=’ source
’ alt="NC Population Growth"’
’ width="792" height="600"></P>’;
put ’</BLOCKQUOTE>’;
put ’</BODY>’;
put ’</HTML>’;
data NCPop;
length Name $ 32;
input State County P1990 P1980 P1970 P1960
P1950 / P1940 P1930 P1920 P1910 P1900 /
AreaLand AreaWater / X Y / Name &;
SquareMiles = AreaLand * 0.000386102158496;
Pop1900 = P1900 / SquareMiles;
Pop1910 = P1910 / SquareMiles;
Pop1920 = P1920 / SquareMiles;
Pop1930 = P1930 / SquareMiles;
Pop1940 = P1940 / SquareMiles;
Pop1950 = P1950 / SquareMiles;
Generating an Animated Web Presentation with the GIFANIM Device Driver 465
data NCC;
set Maps.Counties;
where State = 37 and Density <= 3;
run;
466 Generating an Animated Web Presentation with the GIFANIM Device Driver Chapter 14
data _null_;
file ’temp.sas’;
r = 224; rinc = -r/100;
g = 176; ginc = -g/100;
b = 160; binc = -b/100;
do i = 1 to 99;
put ’pattern’ i ’ v=s c=cx’ r hex2. g hex2.
b hex2. ’;’;
r + rinc;
g + ginc;
b + binc;
end;
run;
%inc ’temp.sas’;
data a;
length color function style $ 8 text $ 20;
retain xsys ysys ’3’ when ’A’ style ’S’;
r = 224; rinc = -r/100;
g = 176; ginc = -g/100;
b = 160; binc = -b/100;
x = 25; xinc = 0.5;
do i = 1 to 99;
color = ’cx’ ||
put( r, hex2. ) ||
put( g, hex2. ) ||
put( b, hex2. );
function = ’MOVE’;
y = 5;
output;
function = ’BAR’;
x + xinc;
y = 10;
output;
r + rinc;
g + ginc;
b + binc;
end;
function = ’LABEL’;
Style = "’Swiss’";
Text = ’800 people/square mile’;
Position = ’6’;
Generating an Animated Web Presentation with the GIFANIM Device Driver 467
x + xinc;
y = 7.5;
output;
Text = ’1’;
Position = ’4’;
x = 24.5;
y = 7.5;
output;
run;
goption gsfmode=append;
goptions gepilog=’3B’x;
CHAPTER
15
Generating Interactive
Metagraphics Output
You can use a GOPTIONS statement with a device type of JAVAMETA to create
metacode output from one or more SAS/GRAPH procedures. At run time, HTML code
passes the metacodes as a parameter to the Metaview Java applet.
The Metaview applet runs with the Java Virtual Machine that is included with Web
browser. Unlike the other SAS/GRAPH applets (such as Graph, Constellation, and
470 Using ODS with JAVAMETA Chapter 15
Treeview applets) the Metaview applet does not require installation of a Java Plug-in
on the client machine.
Interactive features of the Metaview Applet include pan and zoom. Compared to
raster images (GIF, JPEG, PNG), the Metaview applet offers faster data tips and the
advantage of zooming that increases the graph’s resolution rather than degrading it.
You can add data tips, specify resource files for language translation, specify
background colors and text fonts, and drill down to HTML files, metagraphics files, and
sets of metacodes. You can also provide a list of selectable drill-down URLs in the
pop-up menu. For information on these enhancements, see “Enhancing Web
Presentations for the Metaview Applet” on page 474.
Two methods for generating Metaview applet presentations are
3 using ODS with JAVAMETA device driver
3 using the META2HTM macro.
To see examples of programs that generate a Web presentation for the Metaview
Applet, see “Sample Programs: Metaview Applet” on page 478.
2 Close the ODS listing destination (the Output and Graph windows) to conserve
resources.
ods listing close;
3 Open an HTML output file by using an ODS statement and specifying a filename.
If you need to specify a Java archive location other than the location that is
specified as the value of the APPLETLOC= system option, you can use the
CODEBASE= option.
ods html file="C:\metaVbar.htm"
codebase="http://ourweb/sasJava";
You can enhance your Web presentation by specifying other applet parameters, as
described in “Metaview Applet Parameters” on page 475.
4 Generate the metacodes and embed those metacodes in the body of the HTML
output file.
proc gchart data=sashelp.class;
vbar height / group=age;
run; quit;
Run the program to generate the HTML output file. The applet may run in the SAS
Results window, or you can display the HTML output file in a Web browser.
Generating Interactive Metagraphics Output Adding Run-Time Controls to a Presentation 471
Slide-show control
Zoom control
The following picture shows a graphic in which all three controls are present. You
can also use parameters to suppress the display of any of the controls.
472 Page-Selection Slider Control Chapter 15
%meta2htm(capture=on,
htmlfref=_webout,
openmode=replace,
/* Specify codebase if metafile.zip not in same directory */
/* as html file. */
codebase=http://web_server_name/sasweb/graph
archive=metafile.zip,
hspace=1,
vspace=2);
Generating Interactive Metagraphics Output Zoom Control 473
quit;
Slide-Show Control
Metacodes (that are passed with the METACODES parameter to the Metaview
applet) can contain multiple graphs when they are the output of a SAS/GRAPH
procedure containing a BY statement, or when they are the output (concatenated
together) of multiple SAS/GRAPH procedures. To suppress the slide-show control, do
one of the following:
ODS Specify SLIDECONTROLENABLED=FALSE in the ODS statement,
which should look like this:
ods html file="filename.htm"
parameters=("SLIDECONTROLENABLED=FALSE");
Zoom Control
Unless you choose to suppress it, the Metaview applet always displays a zoom control
which allows a user to zoom in on and out of the image. To suppress the zoom control,
do one of the following:
ODS Specify ZOOMCONTROLENABLED=FALSE in the ODS statement,
which should look like this:
474 Enhancing Web Presentations for the Metaview Applet Chapter 15
Follow these steps to manually translate the text in the Metaview Applet:
1 Specify the LOGRESOURCES parameter in your SAS job, generate the HTML,
and view it in a browser. (See “Metaview Applet Parameters” on page 475.) The
Metaview Applet will then write its tag/value pairs to the Java console.
2 Copy the tag/value pairs that you want to translate out of the Java console and
paste them into your resources file. Then translate those values to your language.
You do not need to translate all of the tag/value pairs. The defaults will be used
where translations are not provided.
3 Store your resources file in a location that can be accessed by your Web audience.
4 In the SAS program, remove the LOGRESOURCES parameter specification. Then
specify the RESOURCES parameter. The value of that parameter is the URL of
your resources file.
Note that you do not have to specify the RESOURCES parameter if you name
the resource file MVAResources.properties and store that file in the same location
as the HTML output file.
5 If your resources file requires a non-English text font, then specify that font as the
value of the parameter RESOURCESFONTNAME. To display this font, your Web
audience must have this font installed.
6 Run your program and test your Web output.
BACKGROUNDCOLOR=color
specifies the background for the applet as an RGB color in hexadecimal. White is
0xffffff. Red is 0xff0000. If not specified, the background color is 0xd3d3d3 (gray).
DATATIPHIGHLIGHTCOLOR=color
specifies a 6-digit hexadecimal RGB color that is displayed as the outline of the
graph element that is displaying its data tip information. The default color is red.
This parameter is valid only if the DATATIPSTYLE parameter is set to the value
HIGHLIGHT.
DATATIPSTYLE= HIGHLIGHT | STICK | STICK_FIXED
specifies the style of the data tip pop-up window. Values can be:
HIGHLIGHT
causes the data tip to appear above the segment with no connecting line. The
border of the graph element is highlighted.
STICK
connects the data tip pop-up window to the graph element with a line. The
pop-up window is positioned over the cursor. While the cursor remains in the
element, moving the cursor moves the pop-up window and the connecting line.
476 Metaview Applet Parameters Chapter 15
STICK_FIXED
connects a stationary data tip pop-up window to the graph element with a
line drawn into the middle of the graph element.
DEFAULTTARGET=target-name
specifies where the browser will display drill-down URLs by default. The value of
this parameter can be an HTML target such as _BLANK or the name of a window
or frame in the Web presentation. The default value is _BLANK, which displays
drill-down URLs in a new browser window. The value of the DEFAULTTARGET
parameter is superseded by the optional drill-down tag TARGET.
HELPLOCATION=URL
specifies a location for application-specific help that replaces the default help that
is provided for the Metaview Applet. The default help location is the SAS web site.
LOGRESOURCES=TRUE | FALSE
specifying a value of TRUE logs tag/value pairs in the key definition file. The
default value is FALSE. The tag value pairs are copied out of the key definition file
and modified to create a resource file. The resource file is identified with the
RESOURCES parameter, which enables the Metaview Applet text to be translated
to another language. See also the RESOURCESFONTNAME parameter.
METACODES=codes-or-file-specification
identifies a text file that contains metagraphics codes, or it provides inline
metagraphics codes. The file specification is an absolute or relative URL address.
METACODES1-METACODESn=codes-or-file-specification
identifies additional metacode specifications when you need to identify more than
one file or more than one set of inline metagraphics codes.
METACODESLABEL=menu-label
METACODES1LABEL-METACODESnLABEL=menu-label
names the text labels that are used to identify the graphs specified in the
METACODES and METACODESn parameters. If specified, there should be as
many METACODESLABEL parameters as there are METACODESn parameters.
Always specify METACODESLABEL parameters in sequential order
(METACODESLABEL, METACODES1LABEL, METACODES2LABEL, and so on).
The applet displays the labels in an embedded graph-selection control.
PAGECONTROLENABLED=TRUE | FALSE
enables or disables the display of a scroll control in the Metaview Applet. The
applet displays the control by default, when more than one graph is contained in
the metacodes set. Specify FALSE to disable the scroll control.
RESOURCES=text-URL
specifies the relative or absolute URL of an ASCII-formatted resources file. This
file enables the translation of the English text that is provided in the Metaview
Applet. The resource file is provided so that the Metaview Applet, which is Java
1.02 compliant, can provide translation capabilities that are similar to the
resource files that are enabled in Java 1.2. Note that you do not have to specify
the RESOURCES parameter if you provide a resource file with the name
MVAResources.properties in the same directory as the HTML output file. The
Metaview Applet looks for this file by default and uses it if it is found. Specifying
a value for the RESOURCES parameter overrides this default applet behavior.
For information on creating a resources file, see “Specifying Non-English Resource
Files and Fonts” on page 474. See also the parameters LOGRESOURCES and
RESOURCESFONTNAME.
Generating Interactive Metagraphics Output Specifying Applet Parameters Using the ODS PARAMETERS= Statement 477
RESOURCESFONTNAME=font-name
specifies the name of the font family that is used to display the resource values in
a user-defined resource file. This allows the Metaview Applet, which is Java 1.02
compliant, to emulate the language translation capabilities of Java 1.2. The applet
first tries to use the specified font-name, then it tries to use the SansSerif font,
then it tries to use the Serif font, then it uses the first font that is returned by the
Java.Awt.Toolkit. The first font that is found is the font that is used. See also the
parameters LOGRESOURCES and RESOURCES.
SLIDESHOWCONTROLENABLED=TRUE | FALSE
displays the embedded slide-show control when the current set of metagraphics
codes contains more than one graph. The default is TRUE. Displaying the
slide-show control allows you to start and stop a loop that displays each graph for
a specified amount of time. You can change the amount of time that each graph is
displayed. Specifying a value of FALSE prevents the display of the slide-show
control.
ZOOMCONTROLENABLED=TRUE | FALSE
displays the embedded zoom control under the graph. The default is TRUE.
Specifying a value of FALSE disables the display of the zoom control.
ZOOMCONTROLMIN=minimum-percentage
specifies a new lower limit for the zoom feature. The default value is 25 percent of
initial size. Valid values range from 1 to 99.
ZOOMCONTROLMAX=maximum-percentage
specifies a new upper limit for the zoom feature. The default value is 500 percent
of initial size. Valid values range from 100 to 25000.
separate invocations of the Metaview applet, only the first of which is shown here. A
user would have to scroll the page in the browser to see all four quarters displayed.
Notice the slider control at the bottom of the image. Because the image is displayed by
the Metaview, the run-time option is available to the user to control the magnification
of the chart.
SAS Code
The following is the complete SAS code to generate a Web presentation. You should
notice the following:
3 PROC GREPLAY is used to delete the GSEGS that are created. This is not
necessary, but otherwise SAS creates new GSEGS each time the procedure is run,
rather than overwriting the old ones.
3 The HTML file is created using ODS HTML.
3 The FILE= option of the ODS statement specifies the path and file name of the
HTML file to be created. If you run this example, then change the value of the
option to something that makes sense for you.
3 The statement GOPTIONS DEVICE=JAVAMETA causes PROC GCHART to
produce metacodes which are embedded in the HTML file produced by ODS and
passed to the Metaview applet as parameters.
data prdsummary;
input Year Quarter Country $8. Product $6. Actual dollar10.2;
label Actual = ’Actual Sales’;
format Actual dollar11.;
datalines;
1993 1 CANADA BED $4,337.00
1993 1 CANADA CHAIR $5,115.00
1993 1 CANADA DESK $6,644.00
1993 1 GERMANY BED $5,026.00
1993 1 GERMANY CHAIR $6,276.00
1993 1 GERMANY DESK $4,330.00
480 Metacode Output with HTML from ODS Chapter 15
SAS Code
The following is the complete SAS code to generate a web presentation. You should
notice the following:
3 The statement FILENAME _WEBOUT specifies the name of the HTML file to be
produced by the META2HTM macro. When GOPTIONS DEVICE=JAVAMETA, the
output of a SAS/GRAPH procedure is directed to the file specified by _WEBOUT.
Because the META2HTM macro produces an HTML file, the metacodes produced
by the SAS/GRAPH procedure are embedded in the HTML file. If you run this
sample, change the value of _WEBOUT to something that makes sense for you.
3 The META2HTM macro is invoked twice—once before the SAS/GRAPH procedure
in order to specify parameters for the procedure, and a second time after the
procedure to close the HTML file created.
data prdsummary;
input Year Quarter Country $8. Product $6. Actual dollar10.2;
label Actual = ’Actual Sales’;
format Actual dollar11.;
datalines;
1993 1 CANADA BED $4,337.00
1993 1 CANADA CHAIR $5,115.00
1993 1 CANADA DESK $6,644.00
1993 1 GERMANY BED $5,026.00
1993 1 GERMANY CHAIR $6,276.00
...more data lines...
1994 4 CANADA CHAIR $4,166.00
1994 4 CANADA DESK $7,662.00
1994 4 GERMANY BED $4,026.00
1994 4 GERMANY CHAIR $5,246.00
1994 4 GERMANY DESK $3,329.00
;
run;
%meta2htm(capture=on,
htmlfref=_webout,
openmode=replace,
/* Specify codebase if metafile.zip is not in same */
/* directory as the html file. */
codebase=http://web_server_name/sasweb/graph
archive=metafile.zip,
slidectl=n,
/* don’t advance pictures automatically like a slideshow */
hspace=1,
vspace=2);
%meta2htm(capture=off,
htmlfref=_webout,
openmode=append);
quit;
SAS Code
The following is the complete SAS code to generate a Web presentation. You should
notice the following:
3 The statement FILENAME _WEBOUT specifies the name of the metacode file to
be produced by PROC GCHART. When GOPTIONS DEVICE=JAVAMETA, the
output of a SAS/GRAPH procedure is directed to the file specified by _WEBOUT. If
you run this sample, change the value of _WEBOUT to something that makes
sense for you.
3 When the META2HTM macro is invoked prior to the second occurrence of PROC
GCHART, it is invoked with the parameter OPENMODE=APPEND, so that the
second invocation of the Metaview applet is included in the same HTML file as the
first one.
data prdsummary;
input Year Quarter Country $8. Product $6. Actual dollar10.2;
label Actual = ’Actual Sales’;
format Actual dollar11.;
datalines;
1993 1 CANADA BED $4,337.00
1993 1 CANADA CHAIR $5,115.00
1993 1 CANADA DESK $6,644.00
1993 1 GERMANY BED $5,026.00
1993 2 GERMANY BED $3,026.00
...more data lines...
1994 4 CANADA CHAIR $4,166.00
1994 4 CANADA DESK $7,662.00
1994 4 GERMANY BED $4,026.00
1994 4 GERMANY CHAIR $5,246.00
1994 4 GERMANY DESK $3,329.00
;
Generating Interactive Metagraphics Output Embedding Multiple Instances of the Metaview Applet 485
%meta2htm(capture=on,
htmlfref=_webout,
openmode=replace,
/* Specify codebase if metafile.zip is not in same directory as the */
/* html file. */
codebase=http://web_server_name/sasweb/graph
archive=metafile.zip,
pagepart=head,
slidectl=n,
/* don’t advance pictures automatically like a slideshow */
hspace=1,
vspace=2);
%meta2htm(capture=off,
htmlfref=_webout,
openmode=append,
pagepart=body);
%meta2htm(capture=on,
htmlfref=_webout,
archive=metafile.zip,
openmode=append,
slidectl=n,
/* don’t advance pictures automatically like a slideshow */
pagepart=body);
%meta2htm(capture=off,
486 Embedding Multiple Instances of the Metaview Applet Chapter 15
htmlfref=_webout,
openmode=append,
pagepart=foot);
quit;
487
CHAPTER
16
Managing Web Output with ODS
Note: ODS graph styles are available only with the Java and ActiveX devices and
are not supported by the Contour Applet. 4
Managing Web Output with ODS Managing ODS Destinations 489
To use a style, specify the STYLE= option in an ODS statement that generates
HTML output. To modify or create a new style, use the DEFINE STYLE statement in
the TEMPLATE procedure.
Predefined graph styles have been developed for particular industries, businesses, or
visual themes. Here are a few examples of style names:
Analysis
Astronomy
Banker
Blockprint
Curve
Education
Electronics
Money
Science
Statistical
Watercolor
To view the list of all styles available, run the following code:
proc template;
list styles;
run;
For more information on viewing the style definitions that are shipped with SAS
software, see SAS Output Delivery System: User’s Guide.
ODS styles act as a “graphical stylesheet” for standardization purposes. The visual
enhancements that you can make with styles allow you tailor the appearance of your
graphs to the needs of your presentation and your audience.
Note: Certain ODS styles map textures onto graph elements. For the Java devices,
these textures can be applied to 2D rectangles only. Therefore, styles with textures
cannot be applied to three-dimensional bar and pie charts in Java graphs. 4
For troubleshooting information on graph styles, see Table 23.1 on page 579.
If both the listing destination and the HTML destination are open when you use the
GIF device driver to generate graphics for the Web, the following output is generated:
The GIF driver creates a GIF file for each graph. The GIF driver creates a GIF file named
Each file’s name corresponds to the name of the sasgraph.gif and writes or appends to it
GRSEG entry for the same graph. (depending on the GSFMODE= setting) each
time it generates a graph.
All the HTML files specified on the ODS
statement are created. Only the GIF files that
are created in the HTML destination are
referenced in the HTML files.
Output in the Listing destination is superfluous for Web use for the following reasons:
3 The file sasgraph.gif is not referenced in an HTML file.
3 Previewing GRSEG entries in the GRAPH window is not a reliable way to
proofread the graphs for use with the Web because the GRAPH window and a Web
browser render graphs differently.
Note: For more information on ODS destinations, see SAS Output Delivery System:
User’s Guide. 4
To open a body file, use the ODS statement option BODY=. The following code
creates a body file named sales.html, which is created in the output location specified on
the FILENAME statement.
filename odsout ’path-to-Web-server’;
goptions device=gif;
ods html body=’sales.html’ path=odsout;
The body file remains open and all graphics and non-graphics output is written to it
until the HTML destination is closed or another body file is opened.
To direct output to multiple body files, use an ODS statement with the BODY=
option each time you want to close the current body file and open another:
filename odsout ’path-to-Web-server’;
goptions device=gif;
Using the PATH= option puts all output files in one location. Using PATH= and
GPATH= puts the image output files in a different location.
If you use BY-group processing on a graphics procedure, a separate graph is
generated for each value of the BY variable. In that case, all the graphs will be
referenced in the same body file, unless you use the ODS statement’s NEWFILE=
option. For example, you might use NEWFILE=OUTPUT:
/* use newfile= to open a new */
/* body file for each graph */
filename odsout ’path-to-Web-server’;
goptions device=gif;
ods html body=’sales.html’ path=odsout
newfile=output;
NEWFILE=OUTPUT opens a new body file for each new graph that is generated,
whether the graphs are generated with BY-group processing or by multiple procedure
runs. The new body files are named by appending consecutive numbers to the name
you specify in the BODY= option. In the example above, the initial body file is named
sales.html, and the additional body files that are created will be named sales1.html,
sales2.html, and so on.
To determine the appearance of output on the Web page, the body file uses table
definitions and style definitions. This document shows output with the default
definitions. Other definitions are available with the STYLE= option. You can also
create your own style definitions. For information on table definitions and style
definitions, see SAS Output Delivery System: User’s Guide.
If the title or footnote is being output through an ODS markup destination (such as
HTML) and the corresponding ODS option NOGTITLE or NOGFOOTNOTE is specified,
then the title or footnote is rendered in the body of the HTML file rather than in the
graphic itself. Specifying NOGTITLE or NOGFOOTNOTE results in increasing the
amount of space allowed for the procedure output area, which can result in increasing
the size of the graph. Space that would have been used for the title or footnote is
devoted instead to the graph. You might need to be aware of this possible difference if
you are using annotate or map coordinates.
3 FTEXT=
3 FTITLE=
3 HTEXT=
3 HTITLE=
For example, the following code generates two graphs. The title for the first graph uses
the text color and font as defined by the current style (ASTRONOMY). The title for the
second graph uses the font size and color specified by the HTITLE and CTEXT options.
ods html file="C:\Public\myout1.htm" style=astronomy;
goptions reset=all dev=activex htitle=8 ctext="black";
ods nousegopt;
title ’My title’;
footnote ’My footnote’;
proc gchart data=sashelp.class;
pie age / discrete legend;
run;
ods usegopt;
pie sex / legend;
run;
quit;
ods nousegopt;
ods html close;
While ODS USEGOPT is in effect, the settings for these graphics options will affect
all of the titles and footnotes rendered by ODS. To turn off the use of these graphics
option settings for nongraphic output, specify the ODS NOUSEGOPT statement.
The default setting is ODS NOUSEGOPT.
In this example, the GCHART procedure output is referenced in the body file, and
then the PRINT procedure output is written below it. The two outputs appear together
on the same Web page when file sales.html is viewed in a browser.
For a more complete example, see “Example 9. Combining Graphs and Reports in a
Web Page” on page 248.
To create a contents file, specify a name for the file in the ODS statement option
CONTENTS=.
The following code creates a contents file named salesCon.html, which is created in
the output location specified in the FILENAME statement.
filename odsout ’path-to-Web-server’;
goptions device=gif;
496 Linking to Output through a Table of Pages Chapter 16
The contents file remains open and links are written to it for all graphics and
non-graphics output that is generated by the SAS program until one of the following
occurs:
3 The HTML destination is closed.
3 Another contents file is opened.
To open a new contents file, specify another ODS statement and use CONTENTS=
option to specify the new filename.
For graphics procedures, use the ODS DESCRIPTION= option to specify the text to
be displayed for the links to that procedure’s output. If you don’t use the
DESCRIPTION= option, the procedure’s default description text is used.
To use the Table of Contents, view the contents file in the browser. When you select a
link from the Table of Contents, the browser goes to the target output referenced by
that link. To use the Table of Contents again, you must use the browser’s Back button
or some other mechanism to return to the contents page. If your browser supports
HTML frames, you can keep the Table of Contents visible and its links accessible at all
times by displaying the contents page in a frame (see “Using Frames to Display ODS
Output” on page 497).
To create a page file, specify a name for the file in the ODS statement option PAGE=.
The following code creates a page file named salePage.html, which is created in the
output location specified in the FILENAME statement.
filename odsout ’path-to-Web-server’;
goptions device=gif;
ods html body=’sales.html’ path=odsout
page=’salePage.html’;
The page file remains open and links are written to it for all graphics and
non-graphics output that is generated by the SAS program until one of the following
occurs:
3 The HTML destination is closed.
3 Another page file is opened.
To open a new page file, specify another ODS statement and use the PAGE= option to
specify the new file name.
To use the Table of Pages, view the page file in the browser. When you select a link
from the Table of Pages, the browser goes to the target output referenced by that link.
To use the Table of Pages again, you must use the browser’s Back button or some other
mechanism to return to the page file. If your browser supports HTML frames, you can
keep the Table of Pages visible and its links accessible at all times by displaying the
page file in a frame.
To create a frame file, specify a name for the file on the ODS statement op[tion
FRAME=. You must also use the options the CONTENTS= or PAGE= options, or both
to provide a table to display in the left frame.
The following code creates a frame file named saleFram.html, which is created in the
output location specified in the FILENAME statement.
filename odsout ’path-to-Web-server’;
goptions device=gif;
ods html body=’sales.html’ path=odsout
contents=’saleCon.html’
frame=’saleFram.html’;
To use the frame file, view the frame file in the browser. When you select a link from
the Table of Contents or Table of Pages, the content of the right frame changes to
display the output that is the target of the selected link, but the links from the contents
or pages remain accessible in the left frame.
499
CHAPTER
17
Generating Web Output with the
Annotate Facility
1 Plan your Web presentation so that you know how and where you want to apply
Annotate graphical elements with drill-down links. Also determine your drill-down
URLs.
2 Generate an Annotate data set. Elements that can be defined as drill-down hot
zones are generated by Annotate functions that use the HTML variable. To see
which functions use the HTML variable, refer to Figure 24.4 on page 593. To
generate the Annotate data set, see Chapter 24, “Using Annotate Data Sets,” on
page 587.
3 Specify the GIF, JPEG, or PNG device driver using the DEVICE= option in a
GOPTIONS statement.
4 Close the listing destination and open an HTML output file in ODS.
ods listing close;
ods html file="annodril.htm"
style=science;
Generating Web Output with the Annotate Facility Examples 501
5 Generate a GIF, JPEG, or PNG image and identify the Annotate data set. Use the
GANNO procedure or another SAS/GRAPH procedure that uses the ANNOTATE=
option.
6 Close the HTML output file.
7 Generate any additional HTML files or images as needed to provide files that are
named in drill-down URLs.
Examples
For an example of creating web output with the GANNO procedure, see Example 4
on page 719.
For examples of applying Annotate data sets to web output, see “Examples” on page
604.
502
503
CHAPTER
18
Creating Interactive Treeview
Diagrams
You can scroll across the diagram by selecting off-center nodes or by searching for
nodes. Positioning the cursor over a node can display optional data tips. If you then
right-click, you access a pop-up menu. The menu enables you to highlight or hide
subtrees or drill-down to an optional URL. The menu also enables you to select all
nodes, display all previously hidden nodes, reset the view, display applet help, and
search for nodes using various search parameters.
SAS/GRAPH programming for the Treeview applet differs from some of the other
applets in that it does not use ODS, a device driver specification, or a SAS/GRAPH
procedure. Instead, the DS2TREE macro references data sets to generate and configure
an HTML output file that runs the Treeview applet.
/* 1. Define the name and storage location of the HTML output file */
/* and the location of the jar files. */
%let htmlfile = your_path_and_filename.htm;
%let jarfiles = http://your_path_to_archive;
Display the resulting HTML file in a Web browser to run the Treeview applet and
display the node/link diagram.
The preceding example shows how the arguments of the DS2TREE macro identify a
data set and specify how the variables in that data set are to be interpreted to generate
the diagram. Appearance arguments define the size of the diagram and the color of the
text in the title and footnotes.
For information on generating more complex diagrams for the Treeview applet, see
“Enhancing Presentations for the Treeview Applet” on page 506.
For definitions of all DS2TREE macro arguments, see “DS2TREE Macro Arguments”
on page 507.
SAS Code
The following is the complete SAS code used to generate the Treeview diagram from
a SAS data set. Note the following:
3 The parameter HTMLFILE= specifies the complete path and name of the HTML
file to be created by the DS2TREE macro. If you want to run this sample, then
change the values of HTMLFILE and CODEBASE to the locations that you want
to use.
3 The parameter XMLTYPE=INLINE tells the DS2TREE macro that the XML it
generates from the SAS data set should be included inline in the HTML file.
3 The parameter CUTOFF=1 specifies that every node on the graph be labeled. Use
this parameter to suppress node labels for diagrams with numerous nodes.
data father_and_sons;
input id $8. name $15. father $8.;
cards;
aaron Aaron Parker
bob Bob Parker aaron
charlie Charlie Parker aaron
david David Parker aaron
edward Edward Parker david
Creating Interactive Treeview Diagrams Sample Treeview with XML Written to an External File 509
;
run;
SAS Code
The following is the complete SAS code to generate the Treeview diagram from a SAS
data set. Note the following:
3 The parameter HTMLFILE= specifies the complete path and name of the HTML
file to be created by the DS2TREE macro. If you want to run this sample, then
change the value of HTMLFILE to something that makes sense for you.
3 The parameter XMLTYPE=EXTERNAL tells the DS2TREE that the XML it
generates from the SAS data set should be written to an external file.
3 The parameter XMLFILE= specifies the path and file name of the XML file to be
created.
3 The parameter XMLURL= specifies how the XML file is to be addressed from
within the HTML file.
3 The parameter CUTOFF=1 specifies that every node on the graph be labeled. Use
this parameter with a value between 0 and 1 to suppress node labels for diagrams
with numerous nodes.
data father_and_sons;
input id $8. name $15. father $8.;
cards;
aaron Aaron Parker
bob Bob Parker aaron
charlie Charlie Parker aaron
david David Parker aaron
edward Edward Parker david
;
510 Treeview with Hotspots Chapter 18
run;
goptions reset=all;
/* make sure ods listing is open when running macro */
ods listing;
/* run the macro */
%ds2tree(ndata=father_and_sons, /* data set */
codebase=http://your_path_to_archive,
htmlfile=your_path_and_filename.htm,
xmltype=external,
makexml=y,
xmlurl=http://www.xtz.com/weboutput_treeview2_sample.xml,
xmlfile=u:/public/weboutput_treeview2_sample.xml,
nid=id, /* as the id, use this variable specified here */
cutoff=1, /* display the name on every node */
nparent=father,/* this identifies the parent of each node */
nlabel=name, /* display the value of this variable on each node */
height=400,
width=400,
tcolor=navy,
fcolor=black);
SAS Code
The following is the complete SAS code to generate the Treeview diagram from a SAS
data set. Note the following:
3 The parameter NURL= specifies that the URL to be opened when the
corresponding node is double-clicked.
3 The parameter DRILTARG=_TOP specifies that the HTML file is to be opened in
the same window as the Treeview diagram instead of in a new window, as is the
default.
data father_and_sons;
input id $8. name $15. father $8. url $30.;
cards;
aaron Aaron Parker http://www.xyz.com/index.html
bob Bob Parker aaron http://www.xyz.com/index.html
charlie Charlie Parker aaron http://www.xyz.com/index.html
david David Parker aaron http://www.xyz.com/index.html
edward Edward Parker david http://www.xyz.com/index.html
;
run;
/* make sure ods listing is open when running macro */
ods listing;
/* run the macro */
%ds2tree(ndata=father_and_sons, /* data set */
/* specify complete url if jar files are not in same directory as html file */
codebase=http://your_path_to_archive,
xmltype=inline,
Creating Interactive Treeview Diagrams Treeview with Hotspots 511
htmlfile=your_path_and_filename.htm,
nid=id, /* as the id, use the variable specified here */
cutoff=1, /* display the name on every node */
nparent=father,/* this identifies the parent of each node */
nlabel=name, /* display the value of this variable on each node */
height=400,
width=400,
tcolor=navy,
fcolor=black,
nurl=url,
driltarg=_top );
512
513
CHAPTER
19
Creating Interactive
Constellation Diagrams
Interactive features of the Constellation Applet include pop-up data tips for links and
nodes, subsetting of links via an embedded scroll bar, pan and zoom, fish-eye distortion
of a central image area, and several node and link selection modes. You can define
drill-down URLs for nodes, specify menu text for the drill-down action, insert a
background image, and specify a drill-down URL for the background image, among
other enhancements. You can also specify your own JavaScript methods to define
responses to drill-down actions.
The Constellation Applet, like the Treeview and Rangeview applets, differ from the
other applets in that the diagrams that they display are not generated by SAS/GRAPH
procedures. The DS2CONST macro generates and formats an HTML output file, and
specifies the appearance and behavior of the node/link diagram based on values in a
data set.
/* 4. Define a title */
title1 ’Grocery Affinity Diagram.’;
Note: You must change the CODEBASE= argument (using either http:// or a
directory path such as C:/) to specify the location of your sas.graph.constapp.jar file and
its associated jar files (sas.graph.nld.jar, sas.graph.j2d.jar). See the CODEBASE=
argument in “Arguments for the APPLET Tag” on page 536. 4
Display the resulting HTML file in a Web browser to run the applet and generate the
diagram.
Creating Interactive Constellation Diagrams Enhancing Presentations for the Constellation Applet 517
Arguments in the DS2CONST macro identify the name of the nodes and links data
sets. In the nodes data set, arguments identify a node ID variable and a node label
variable. Other arguments identify the links data set and the variables that define the
nodes at the start and end of each link line.
For information on more complex presentations for the Constellation Applet, see
“Enhancing Presentations for the Constellation Applet” on page 517.
Specify link weights and configure a scroll bar LVALUE, MINLNKWT, SCLNKWT
that controls the display of links based on
weight.
Specify text colors, fonts, styles, and sizes. NFNTNAME, NSFNTNAM, CTEXT, CATEXT
See “DS2TREE and DS2CONST Arguments for
Diagram Appearance” on page 545.
518 DS2CONST Macro Arguments Chapter 19
Specify colors for nodes and links. NCOLVAL, NCOLOR, CNODE, LCOLVAL,
LCOLOR, CLINK
Note that a number of enhancements apply only to associative data sets when you
specify the macro argument DATATYPE=ASSOC. The macro argument definitions
identify which features apply only to associative data.
The DS2CONST macro requires you to specify node and link data sets. As an
enhancement, you can define a node styles data set that contains style information only.
You can use the node styles data set to standardize the appearance of a series of
diagrams, among other uses.
Reference information on the arguments of the DS2CONST macro is provided in
“DS2CONST Macro Arguments” on page 518.
SAS Code
The following is the complete SAS code used to generate a Constellation diagram
from a SAS data set. Notice the following:
3 The parameter HTMLFILE= specifies the complete path and name of the HTML
file to be created by the DS2CONST macro. If you want to run this sample, then
change the value of HTMLFILE to the location where you want the HTML file
stored.
3 The parameter NSHAPE= specifies the variable in the SAS data set that encodes
the shape of each node.
3 The parameter NCOLOR= specifies the variable in the SAS data set that encodes
the color of each node.
relationships among variables. Variables in the SAS data set determine the size and
color of nodes, as well as the width and color of the lines between nodes. At the bottom
of the picture, notice the slider bar which allows a user to choose how many of the links
on the diagram are displayed. Move the slider to the left, and only the most important
links are displayed. Move the slider to the right, and all of the links are displayed.
SAS Code
The following is the complete SAS code to generate a Constellation diagram from a
SAS data set. Notice the following:
3 The parameter HTMLFILE= specifies the complete path and name of the HTML
file to be created by DS2CONST. If you want to run this sample, then change the
value of HTMLFILE to something that makes sense for you.
3 The parameter NVALUE= specifies the data set variable that is used to determine
the size and color of each node.
3 The parameter LVALUE= specifies the data set variable that is used to determine
the width and color of each line between nodes.
data nodedata;
length nodeID value 8 label $11 tip $25;
input nodeID value @11 label $char11. @25 tip $char25.;
cards;
0 6556 depression depression: #6556
1 6322 anxiety anxiety: #6322
2 5980 fatigue fatigue: #5980
3 5286 headache headache: #5286
4 4621 chest pain chest pain: #4621
6 3149 nausea nausea: #3149
;
run;
data linkdata;
522 Constellation Chart with XML Written to an External File Chapter 19
difference that the XML is written to an external file instead of being embedded in the
HTML file.
SAS Code
The following is the complete SAS code to generate the Constellation diagram from a
SAS data set. You can notice the following:
3 The parameter HTMLFILE= specifies the complete path and name of the HTML
file to be created by DS2CONST. If you want to run this sample, then change the
value of HTMLFILE to something that makes sense for you.
3 The parameter XMLTYPE=EXTERNAL tells the DS2CONST macro that the XML
that it generates from the SAS data set should be written to an external file.
3 The parameter XMLFILE= specifies the path and file name of the XML file to be
created.
3 The parameter XMLURL= specifies how the XML file is to be addressed from
within the HTML file.
data nodedata;
length nodeID value 8 label $11 tip $25;
input nodeID value @11 label $char11. @25 tip $char25.;
cards;
0 6556 depression depression: #6556
1 6322 anxiety anxiety: #6322
2 5980 fatigue fatigue: #5980
3 5286 headache headache: #5286
4 4621 chest pain chest pain: #4621
6 3149 nausea nausea: #3149
;
run;
data linkdata;
length from to linkvalue 8 tip $40;
input from to linkvalue @13 tip $char40.;
cards;
2 0 5978 #5978, Support:63.0790, Conf:99.9833
4 1 4621 #4621, Support:48.7602, Conf:100.0000
1 0 4307 #4307, Support:45.4469, Conf:68.1272
1 2 3964 #3964, Support:41.8276, Conf:62.7017
2 3 3010 #3010, Support:31.7611, Conf:50.3429
0 3 3009 #3009, Support:31.7506, Conf:47.5957
1 6 2772 #2772, Support:29.2498, Conf:43.8469
4 6 2609 #2609, Support:27.5298, Conf:56.4596
4 0 2606 #2606, Support:27.4982, Conf:56.3947
4 2 2263 #2263, Support:23.8789, Conf:48.9721
3 0 1980 #1980, Support:20.8927, Conf:40.6821
3 1 1701 #1701, Support:17.9487, Conf:34.9497
3 2 1701 #1701, Support:17.9487, Conf:34.9497
1 3 1593 #1593, Support:16.8091, Conf:25.1977
4 3 1152 #1152, Support:12.1557, Conf:24.9297
0 6 623 #623, Support:6.5738, Conf:9.8545
2 6 623 #623, Support:6.5738, Conf:10.4198
6 3 597 #597, Support:6.2995, Conf:20.0268
3 6 372 #372, Support:3.9253, Conf:7.6433
524 Constellation Chart with Hotspots Chapter 19
%ds2const(ndata=nodedata,
ldata=linkdata,
datatype=assoc,
minlnkwt=30,
height=450,
width=600,
codebase=http://your_path_to_archive,
htmlfile=your_path_and_filename.htm,
xmltype=external,
makexml=y,
xmlurl=http://www.xyz.com/Web_output/const_assoc_external.xml,
xmlfile=u://Web_output/const_assoc_external.xml,
colormap=y,
nid=nodeID,
nlabel=label,
nvalue=value,
fntsize=12,
ntip=tip,
lfrom=from,
lto=to,
lvalue=linkvalue,
ltip=tip,
linktype=arrow);
SAS Code
The following is the complete SAS code to generate the Constellation diagram from a
SAS data set. Notice the following:
3 The parameter NURL= specifies the variable in the SAS data set that contains the
URL to be linked to when a user double-clicks the node.
CHAPTER
20
Creating Critical Success Factor
Diagrams
The critical success factor diagram is fully configurable, based on either the classical
style (shown above) or a style that resembles a digital gauge, as shown in the following
figure.
528 When to Use the Rangeview Applet Chapter 20
Ranges of values, colors, text sizes, and text fonts are all specified in the
SAS/GRAPH program. You can also specify a drill-down URL that will be displayed in a
specified browser window when the Web user selects any part of the diagram.
Display the HTML output file in a Web browser to run the Rangeview Applet and
display a critical success factor diagram.
In the preceding example, the arguments of the DS2CSF macro specify the path to
the HTML output file and the Java archive of the Rangeview Applet. The VAR
argument identifies the variable in the data set that is to be illustrated in the diagram.
The value that is to be indicated as the critical success factor is the value for this
variable in the first observation in the data set. A digital-style diagram is specified by
the CSFTYP= argument.
For more information on usages of the Rangeview Applet, see “Enhancing
Presentations for the Rangeview Applet” on page 529.
For definitions of all of the arguments of the DS2CSF macro, see “DS2CSF Macro
Arguments” on page 530.
Table 20.1
Specify a color for the background, hub, and CBACK, CHUB, COUTLINE
outline.
Specify a drill-down URL and display target. DRILURL, DRILTARG
530 DS2CSF Macro Arguments Chapter 20
Set the indicator shape, height, width, and color. INDICTYP, HINDIC, WINDIC, CINDIC
SAS Code
The following is the complete SAS code to generate a web presentation. Note the
following:
3 The HTMLFILE= parameter specifies the name of the HTML file to be produced
by DS2CSF. If you want to run this sample, then change the value of HTMLFILE=
to something that makes sense for you.
3 The data set variable X specifies the value to be displayed on the CSF diagram. In
this case, the critical value equals 0.8.
3 The parameter
range=sashelp.javagrf.sample1.range
specifies a range entry that defines the range segments and their corresponding
color. In this case, the range entry defines three segments: 0–0.33, 0.33–0.66, and
0.66 to 1.
3 The data set variable X specifies the value to be displayed on the CSF diagram. In
this case, the critical value equals 0.8.
%ds2csf(data=test,
var=x,
htmlfile=your_path_and_filename.htm,
openmode=replace, pagepart=head,
center=y,
532 Adding a Link to a Critical Success Factor Diagram Chapter 20
%ds2csf(data=test,
var=x,
htmlfile=your_path_and_filename.htm,
openmode=append, pagepart=foot,
center=y,
archive=rvapplet.jar,
/* specify complete url if not in same directory as the html file */
archive=http://your_path_to_archive,
csftyp=digital, labelpos=Bottom_Center, cback=#e0e0e0,
bgtype=color, bg="#e0e0e0",
ttag=bold + italicized, tcolor="#002288", tsize=5,
tface="Arial, Helvetica",
range=sashelp.javagrf.sample1.range);
SAS Code
The SAS code creates a diagram and links to the specified URL when a user clicks
anywhere on the diagram. DRILURL= specifies the URL to link to, while
DRILTARG=_self specifies that the new Web page is to be displayed in the same
window as the diagram.
%ds2csf(data=test,
var=x,
htmlfile=your_path_and_filename.htm,
openmode=replace, pagepart=head,
center=y,
drilurl=http://www.xyz.com,
archive=rvapplet.jar,
/* specify complete url if not in same directory as the html file */
archive=http://your_path_to_archive,
csftyp=classic, septype=none, cback=#e0e0e0,
bgtype=color, bg="#e0e0e0",
ttag=bold + italicized, tcolor="#002288", tsize=5,
Creating Critical Success Factor Diagrams Adding a Link to a Critical Success Factor Diagram 533
tface="Arial, Helvetica",
range=sashelp.javagrf.sample1.range);
534
535
CHAPTER
Macro Arguments
Macro arguments specify the configuration of the HTML output file, the location of
the data that is used to generate the diagram, and the configuration of the applet’s
interactive features.
The macros use the following syntax:
%macroname(argument1=value1, argument2=value2, ...);
The macro arguments can be divided into arguments used by all macros, arguments
used by the DS2CSF macro, and arguments used by the META2HTM macro. The
following arguments apply to all macros:
3 “Arguments for the APPLET Tag” on page 536. The CODEBASE argument is
required.
3 “DS2TREE and DS2CONST Arguments for Data Definition” on page 537. For
DS2TREE the arguments NDATA and NID are required. For DS2CONST the
arguments NDATA, NID, LDATA, and LTO are required.
3 “Arguments for Generating HTML and XML Files” on page 544.
3 “DS2TREE and DS2CONST Arguments for Diagram Appearance” on page 545.
3 “Arguments for Page Formatting” on page 552.
3 “Arguments for Stylesheets” on page 554.
3 “Arguments for the SAS TITLE and FOOTNOTE Tags” on page 556.
3 “Arguments for Character Transcoding” on page 561.
The following arguments apply only to the DS2CSF macro:
536 Arguments for the APPLET Tag Chapter 21
AHUNITS=PIXELS | PERCENT
specifies the units of the HEIGHT= argument. The default value is PIXELS. See
also the AWUNITS= argument.
Used by: DS2TREE, DS2CONST
ALIGN=position
specifies the alignment of the applet window in the browser window or frame.
Values can be LEFT, RIGHT, TOP, BOTTOM, TEXTTOP, MIDDLE, ABSMIDDLE,
BASELINE, or ABSBOTTOM.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
ALT=text
specifies the text that will be displayed on mouseover by browsers that understand
the tag but cannot run Java applets. The default value is SAS Institute Inc.
applet_name.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
ARCHIVE=filename
specifies the name of the Java archive file(s). This argument is required for
DS2CSF and META2HTM.
Note: The path to the Java archive is specified in the CODEBASE argument. 4
The following table shows what archive files to use with each of the macros. For
DS2TREE and DS2CONST, you do not have to specify a value for ARCHIVE=
because the values shown are generated by default.
DS2TREE archive=%str(sas.graph.treeview.jar, sas.graph.nld.jar,
sas.graph.j2d.jar)
DS2CONST archive=%str(sas.graph.constapp.jar, sas.graph.nld.jar,
sas.graph.j2d.jar)
DS2CSF archive=rvapplet.jar
META2HTM archive=metafile.zip
Note: Before SAS 9.1, treeview.jar and constapp.jar also contained the classes
that are now included in the auxiliary JAR files (sas.graph.nld.jar and
sas.graph.j2d.jar). Although you can continue to use the older JAR files by
specifying ARCHIVE=treeview.jar or ARCHIVE=constapp.jar, future versions may
not support these older JAR files. 4
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Data Definition 537
The value of the APPLETLOC system option is not used as the default value. 4
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
HEIGHT=applet-height
specifies the height of the applet window. The unit of measure is pixels unless
changed by the AHUNITS= argument. The default value is 600 for all macros
except the DS2CSF macro. The default for the DS2CSF macro is 175.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
HSPACE=pixels
specifies the amount of horizontal space, in pixels, to the left and right of the
graph or diagram.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
NAME=applet-name
specifies the name for this instance of the applet. You need to use this argument
only if you have more than one instance of the APPLET tag in your HTML file,
and if you have included your own scripts or DHTML that communicates with or
acts on a particular instance of the applet.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
VSPACE=pixels
specifies the amount of vertical space, in pixels, to the top and bottom of the graph
or diagram.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
WIDTH=applet-width
specifies the width of the applet window. The unit of measure defaults to pixels
unless specified by the AWUNITS= argument. The default value is 800 for all
macros except the DS2CSF macro. The default for the DS2CSF macro is 225.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
NCOLOR=variable-name
specifies the variable in the nodes data set that determines the background color
of the nodes, using HTML 3.2 color names or 6-digit hexadecimal RGB values . If
the variable does not contain valid HTML color names, then you can use the
NCOLFMT=argument to convert those values to the HTML color names. See also
the NCOLVAL= and NVALUE=arguments.
Used by: DS2CONST, DS2TREE
NCOLVAL=variable-name
specifies the name of the variable in the nodes data set that determines the color
mapping for the nodes. This argument is valid only when the DATASET=
argument is set to ASSOC, and only when the value of the COLORMAP=
argument is Y. If this argument is not specified, then the node color is determined
by the LVALUE= argument.
Used by: DS2CONST
NDATA=SAS-data-set-name
specifies the SAS data set that contains the node data.
This argument is required.
Used by: DS2CONST, DS2TREE
NFNTNAME=node-font-variable-name
specifies the name of the variable that determines the text font for the node labels.
The variable value can be SERIF, SANSSERIF, DIALOG, DIALOGINPUT, or
MONOSPACED. The default node font is specified by the FNTNAME= argument
(see “DS2TREE and DS2CONST Arguments for Diagram Appearance” on page
545).
Used by: DS2CONST, DS2TREE
NFNTSIZE=variable-name
specifies the name of the variable in the nodes data set that determines the size of
the text font used for node labels. This font size is expressed in points. This
argument overrides the FNTSIZE= argument.
Used by: DS2CONST, DS2TREE
NFNTSTYL=node-font-style-variable-name
specifies the name of the variable that determines the font style for the node label.
The valid values that can be assigned to the variable are BOLD, ITALIC, and
PLAIN.
Used by: DS2CONST, DS2TREE
NID=variable-name
specifies the name of the variable in the nodes data set whose values are to
illustrated as the nodes in the diagram. The node ID variable type can be either
numeric or character. For the DS2CONST macro, the values of the NID variable
must be coordinated with the values of the LFROM and LTO variables.
This argument is required.
Used by: DS2CONST, DS2TREE
NLABEL=node-label-variable-name
specifies the name of the variable that represents the node labels. This variable
type can be either numeric or character.
Used by: DS2CONST, DS2TREE
542 DS2TREE and DS2CONST Arguments for Data Definition Chapter 21
NPARENT=node-parent-variable-name
specifies the name of the variable that represents the parent nodes. This variable
type can be either numeric or character.
Used by: DS2TREE
NPW=password
specifies the password that is needed for accessing a password-protected data set.
This argument is required if the data set has a READ or PW password. You do not
need to specify this argument if the data set has only WRITE or ALTER passwords.
Used by: DS2CONST, DS2TREE
NSCBACK=variable-name
specifies the name of the variable in the node styles data set that determines the
background color of the nodes. The variable values must be HTML 3.2 color
names. The default value is determined by the CNODE= argument (see
“DS2TREE and DS2CONST Arguments for Diagram Appearance” on page 545).
Used by: DS2CONST, DS2TREE
NSCTEXT=variable-name
specifies the name of the variable in the node styles data set that provides the
colors for the node label text. Valid variable values must be HTML 3.2 color
names. The default color is provided by the CATEXT= argument.
Used by: DS2CONST, DS2TREE
NSDATA=SAS-data-set-name
specifies the name of the node styles data set.
Used by: DS2CONST, DS2TREE
NSFNTNAM=variable-name
specifies the name of the variable in the node styles data set that determines the
text font that is to be used for node labels. Valid variable values can be SERIF,
SANSSERIF, DIALOG, DIALOGINPUT, or MONOSPACED. This argument
overrides the FNTNAME= argument.
Used by: DS2CONST, DS2TREE
NSFNTSIZ=variable-name
specifies the name of the variable in the node styles data set that determines the
size of the node label text, in points. This argument overrides the FNTSIZE=
argument.
Used by: DS2CONST, DS2TREE
NSFNTSTY=variable-name
specifies the name of the variable in the node styles data set that determines the
style of the node label text. Valid variable values can be BOLD, ITALIC, or the
default value, PLAIN. This argument overrides the FNTSTYL= argument.
Used by: DS2CONST, DS2TREE
NSHAPE=variable-name
specifies the name of the variable that determines the shape of the nodes. Valid
variable values can be CIRCLE, DIAMOND, NONE, SQUARE, or TRIANGLE. The
default value is SQUARE. This argument overrides the NODESHAPE= argument.
Used by: DS2CONST
NSID=variable-name
specifies the name of the variable in the node styles data set that represents the
nodes.
Used by: DS2CONST, DS2TREE
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Data Definition 543
NSIZE=variable-name
specifies the name of the variable that determines the size of the nodes. The
values of this variable can be real numbers. Node sizes are determined based on
the value of the LAYOUT= argument. When LAYOUT=USER, the values of the
NSIZE variable are interpreted as literal pixel measurements. When
LAYOUT=AUTO, the values of the NSIZE variable determine the size of the nodes
based on the relative size of individual values. The values of the NSIZE variable
can be scaled with the SCLNSIZE= argument (see “DS2TREE and DS2CONST
Arguments for Diagram Appearance” on page 545). This argument is valid only
when the value of the DATATYPE= argument is ASSOC.
Used by: DS2CONST
NSPW=password
specifies the password that is needed to access a password-protected node styles
data set. This argument is required if the data set has a READ or PW password.
You do not need to specify this argument if the data set has only WRITE or
ALTER passwords.
Used by: DS2CONST, DS2TREE
NSTYLE=variable-name
specifies the name of the variable that determines the style of the nodes. This
variable type can be either numeric or character, and the values must correspond
to the node identifiers specified in the NSID= argument.
Used by: DS2CONST, DS2TREE
NSWHERE=subset-expression
specifies a WHERE clause that subsets the node styles data set for display in the
diagram. If the expression contains any special characters (for example, % or &),
then include %NRBQUOTE in the expression to process those characters correctly.
The following example shows how to correctly specify INT%:
NSWHERE=%NRBQUOTE(value="Int%")
HTMLFILE=external-filename
specifies the name and storage location of the HTML output file. If the external
file does not exist, then it is created for you. Either this argument, or
HTMLFREF=, is required if you specify MAKEHTML=Y. Note: Do not use the
HTMLFILE= argument if you use the HTMLFREF= argument.
Used by: DS2TREE, DS2CONST, DS2CSF
HTMLFREF=fileref
specifies the SAS fileref that identifies the name and storage location of the HTML
output file. If the external file does not exist, then it is created for you. Either this
argument, or HTMLFILE=filename, is required if you specify MAKEHTML=Y.
Note: Do not use the HTMLFREF= argument if you use the HTMLFILE=
argument, and do not use a reserved name (see “Reserved Names” on page 566).
Used by: DS2TREE, DS2CONST, DS2CSF
MAKEHTML=Y | N
specifies whether or not an HTML file is to be generated. The default value is Y,
which generates the HTML output file. If you specify MAKEHTML=N and
MAKEXML=Y, then only an XML file is generated.
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Diagram Appearance 545
ACTION=text
specifies the default text that is displayed in a pop-up menu when the Web user
selects a node with the right mouse button. Selecting this menu option displays
the URL that is associated with that node in the NURL= argument. This
argument is overridden by the NACTION= argument (see “DS2TREE and
DS2CONST Arguments for Data Definition” on page 537). The ACTION=
argument is useful when you want to use a single menu text string for most of the
nodes in your diagram. The default menu option text is Open URL.
Used by: DS2CONST, DS2TREE
ANGLE=link-angle
works with the TREESPAN= argument to determine the direction of growth for
the diagram. The ANGLE= argument is valid only when you do not specify the
TREEDIR= argument. The TREESPAN= argument defines the angular width of
the tree (narrow or wide layout). The TREESPAN angle can be visualized as a V
shape, with the starting node positioned at the base of the V. The rest of the nodes
are laid out between the spreading arms of the V. The ANGLE= argument
specifies the angle of the V shape. By default, the value of the ANGLE= argument
is zero (0) and the V shape opens to the right, as if the letter V was rotated 90
degrees clockwise, to the three-o’clock position. Values of the ANGLE= argument
that are greater than zero rotate the V shape counterclockwise away from the
three-o’clock position. Valid values for the ANGLE= argument range from zero (0)
to 360 degrees.
Used by: DS2TREE
BORDER=Y | N
specifies whether or not a border is drawn around the background area. The
default value is N.
Used by: DS2CONST, DS2TREE
CATEXT=default-text-color
specifies a default color for the text in the diagram, using an HTML 3.2 color name
or a 6-digit hexadecimal RGB value. For DS2CONST, this argument is overridden
by the FNTNAME= argument (see below) and the NTEXTCOL argument (see
“DS2TREE and DS2CONST Arguments for Data Definition” on page 537).
Used by: DS2CONST, DS2TREE
CBACK=color
specifies a background color for the Treeview Applet. The value must be a valid
HTML 3.2 color name.
Used by: DS2TREE
CHANDLE=color
specifies the color of the Collapse/Expand handle on the nodes. The handle is
represented by a small plus sign (+) that is prefixed to the label of the node when
its subtree is collapsed. The value must be a valid HTML color name.
Used by: DS2TREE
CLINK=default-link-color
specifies a default color for the links in the diagram, using an HTML 3.2 color
name or a 6-digit RGB value. For DS2CONST, this argument is overridden by the
LCOLOR= and LCOLVAL= arguments (see “DS2TREE and DS2CONST
Arguments for Data Definition” on page 537).
Used by: DS2CONST, DS2TREE
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Diagram Appearance 547
CNODE=color
specifies the node background color. The value must be a valid HTML color name.
The value specified here can be overridden by specifying a value of TRUE for the
NCOLOR= argument.
Used by: DS2TREE
CNODE=default-node-color
specifies a default background color for the nodes, using an HTML 3.2 color name
or a 6-digit RGB value. This argument is overridden by the NCOLOR=,
NCOLVAL=, NVALUE=, or NSCBACK= arguments (see “DS2TREE and
DS2CONST Arguments for Data Definition” on page 537).
Used by: DS2CONST
COLORMAP=N | Y
when the value is N (default), specifies that the Constellation Applet is to use the
NCOLOR= and LCOLOR= arguments (see “DS2TREE and DS2CONST Arguments
for Data Definition” on page 537) to determine node and link colors rather than
using the color map.
Used by: DS2CONST
CSELECT=color
specifies a color for nodes that are selected by the mouse or as the result of a node
search. The value must be a valid HTML 3.2 color name.
Used by: DS2CONST, DS2TREE
CUTOFF=detail-percentage
specifies the percentage of the nodes that will be displayed with node labels. After
the percentage has been reached, nodes are drawn as rectangles. The size of those
rectangles decreases as the distance from the starting node increases. Valid values
range from 0.0 to 1.0 (The decimal value is mapped to a percentage from 0% to
100%). The default value is 1.0. See also the DEPTH argument.
Used by: DS2CONST, DS2TREE
DEPTH=max-path-length
specifies a whole number greater than zero that determines the maximum number
of links that are to be displayed in the node/link diagram. Paths whose lengths
exceed the limit are truncated. This argument affects only the initial display of
the diagram. Nodes that are initially hidden can become visible as a user selects
nodes and navigates around the diagram.
Note that this value is ignored if the value of the CUTOFF= argument is 1.0.
There is no default value for this argument.
Used by: DS2TREE
DRILTARG=target-window-or-frame
specifies the HTML target or the name of the browser window or frame where
drill-down URLs are displayed. The default behavior is to open a new browser
window and reuse it for subsequent drill-down requests. Specifically, the default
value is _BLANK, which is one of several reserved names for targets in HTML.
The value can also be the name of a window or frame in the Web presentation.
Used by: DS2CONST, DS2TREE
DUPCHECK=TRUE | FALSE
specifies whether or not the applet will check for duplicate node IDs. The default
value is FALSE. When set to TRUE, this argument will cause the applet to update
an ID if a duplicate ID is found, instead of creating a new node with the same ID.
This enables you to collect node information from different locations in the data set.
Used by: DS2TREE
548 DS2TREE and DS2CONST Arguments for Diagram Appearance Chapter 21
FACTOR=fish-eye-distortion-factor
specifies the distortion factor for the fish-eye lens. The distortion factor determines
the amount that the central region of the display is to be expanded (or zoomed).
The value specified must be greater than or equal to 1.0. The default value is 1.0,
which represents the lowest amount of distortion. This argument is valid only
when the value of the FISHEYE= argument is Y. The maximum effective value
(beyond which no further distortion is visible) is variable depending upon the
number of nodes in the diagram.
Used by: DS2CONST, DS2TREE
FISHEYE=Y | N
indicates whether or not the diagram is to be displayed with the fish-eye distortion,
which displays the central region of the diagram at a specified size and displays
the rest of the diagram as if it were mapped onto a ball, with the nodes and links
disappearing over a curved horizon. The Web user can move the diagram past the
central region by scrolling or searching for nodes. The amount of distortion used in
the fish-eye lens is determined by the FACTOR= argument. The default value is Y.
Used by: DS2CONST, DS2TREE
FNTNAME=default-node-label-font
specifies the default text font for node labels. Valid values can be SERIF,
SANSSERIF, DIALOG, DIALOGINPUT, or MONOSPACED. This argument is
overridden by the NFNTNAME or NSFNTNAM= arguments (see “DS2TREE and
DS2CONST Arguments for Data Definition” on page 537).
Used by: DS2CONST, DS2TREE
FNTSIZE=node-font-size
specifies the size of the node label text font, in points. This argument is overridden
by the NFNTSIZE= argument.
Used by: DS2CONST, DS2TREE
FNTSTYL=node-font-style
specifies the text font style for node labels. Valid values are BOLD, ITALIC, and
PLAIN. PLAIN is the default value. This argument is overridden by the
NFNTSTYL= argument.
Used by: DS2CONST, DS2TREE
IBACKLOC=image-URL
specifies a URL for the image that you want to use in the background of the
diagram. See also the IBACKPOS= argument.
Used by: DS2CONST, DS2TREE
IBACKPOS=CENTER | SCALE | TILE | POSITION
specifies how to display the background image in the IBACKLOC= argument.
Specify one of the following options:
CENTER
centers the image in the browser window without resizing the image.
SCALE
resizes the image to fit the browser window.
TILE
fills the browser window by replicating the image at its original size.
POSITION
positions the image without resizing at the values specified by the IBACKX=
and IBACKY= arguments.
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Diagram Appearance 549
the frames in the resource bundle, based on the length of the message strings in
each language.
Used by: DS2CONST, DS2TREE
SCLNKWT=Y | N
when the value is Y (default), specifies that the link weight values are to be scaled
into the range of 0–1, which corresponds to 0–100%. When SCLNKWT=Y, the
scroll bar in Constellation Applet displays a percentage of the range of the link
weights. When SCLNKWT=N, the link weights are not scaled and the scroll bar
reflects the actual link weight data values. These values are real numbers that are
specified in the LVALUE= argument (see “DS2TREE and DS2CONST Arguments
for Data Definition” on page 537). The SCLNKWT= argument is valid only when
the value of the DATATYPE= argument is ASSOC. Note that the range of link
weights (maximum minus minimum) must be greater than 2 when SCLNKWT=N.
Otherwise, the scroll bar will not correctly map the link weights.
Used by: DS2CONST
SCLWIDTH=Y | N
when the value is Y (default), indicates that the link width values are to be scaled
into the range of 0–1. Specifying N indicates that the link widths are already
scaled into that range. This argument is valid only when the value of the
DATATYPE= argument is ASSOC.
Used by: DS2CONST
SCNSIZE=Y | N
when the value is Y (default), indicates that the node size values are to be scaled
into the range of 0–1. Specifying N indicates that the node sizes are already scaled
into that range. This argument is valid only when the value of the
DATATYPE= argument is ASSOC. Node sizes are specified with the NSIZE=
argument (see “DS2TREE and DS2CONST Arguments for Data Definition” on
page 537).
Used by: DS2CONST
SELIFUNC=JavaScript-method-name
specifies the name of the JavaScript method that will be used by the
getSelectedNodesIds method. The getSelectedNodesIds method first collects all the
IDs for the selected nodes. Then, if a method is specified with the SELIFUNC=
argument, the getSelectedNodesIds method calls that method and passes to that
method all of the selected node IDs as arguments. If there is no method specified
with the SELIFUNC= argument, then the getSelectedNodesIds method
concatenates all of the IDs into a single string, separates the individual IDs with
the value that is specified by the NODESEP= argument, and returns the string.
The value for this argument is case-sensitive.
Used by: DS2CONST, DS2TREE
SELLFUNC=JavaScript-method-name
specifies the JavaScript method that will be used by the getSelectedNodesLabels
method. The getSelectedNodesLabels method first collects all the labels for the
selected nodes. Then, if a method is specified with the SELLFUNC= argument,
the getSelectedNodesLabels method calls that method and passes to that method
all of the selected node labels as arguments. If there is no method specified with
the SELLFUNC= argument, then the getSelectedNodesLabels method
concatenates all of the labels into a single string, separates the individual labels
with the value that is specified by the NODESEP= argument, and returns the
string. The value for this argument is case-sensitive.
Used by: DS2CONST, DS2TREE
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2TREE and DS2CONST Arguments for Diagram Appearance 551
SELUFUNC=JavaScript-method-name
specifies the JavaScript method that will be used by the getSelectedNodesURLs
method. The getSelectedNodesURLs method first collects all the URLs for the
selected nodes. Then, if a method is specified with the SELUFUNC= argument,
the getSelectedNodesURLs method calls that method and passes to that method
all of the selected node URLs as arguments. If there is no method specified with
the SELUFUNC= argument, then the getSelectedNodesURLs method
concatenates all of the URLs into a single string, separates the individual URLs
with the value specified by the NODESEP= argument, and returns the string. The
value for this argument is case-sensitive.
Used by: DS2CONST, DS2TREE
SHOWLINKS=Y | N
specifies whether initially to display all arc lines between nodes. Specifying N
suppresses all arc lines. The default value is Y.
Note: This argument affects only the initial display. A viewer can
subsequently control which arc lines are displayed by right-mouse clicking and
selecting a Show links option from the pop-up menu. 4
Used by: DS2CONST
SPREAD=angular-factor
specifies the angular spreading factor for the layout of the diagram. The value
specified must be greater than or equal to 1.0. The default value is 1.25.
Used by: DS2TREE
TIPS=Y | N
indicates whether or not pop-up data tips are displayed when the cursor is
positioned over nodes or links or both. The default value is Y.
Used by: DS2CONST, DS2TREE
TIPTYPE=TRACKING | STATIONARY
when the value is TRACKING (default), indicates that the pop-up data tips
windows are to move with the cursor while the cursor moves within the area of a
single node or link.
Used by: DS2CONST
TREEDIR=C | D | L | R | U
determines the growth direction of the node/link diagram using the following
values.
C | CIRCULAR
grows the tree in a circular pattern. This is the default value.
D | DOWN
grows the tree from top to bottom using center alignment.
L | LEFT
grows the tree from left to right and top to bottom.
R | RIGHT
grows the tree from right to left and top to bottom.
U | UP
grows the tree from the bottom up using center alignment.
If the value of the TREEDIR= argument is UP or DOWN, then the value of the
TREESPAN= argument is used to set the angular width of the diagram. The
starting node is aligned horizontally in the center of the applet. The diagram
552 Arguments for Page Formatting Chapter 21
grows out of the starting node based on the angular width specified in the
TREESPAN= argument. The wider the angle, the wider the layout of the diagram.
The TREEDIR= argument overrides the ANGLE= argument.
Used by: DS2TREE
TREESPAN=angular-diagram-width
specifies the angular width of the diagram in degrees. Valid values must be
greater than zero and less than 360. The default value is 60. For details, see the
TREEDIR= and ANGLE= arguments.
Used by: DS2TREE
ZOOM=starting-percentage
specifies the zoom value that is used for the initial display of the diagram. After
the initial display, the Web user can change the zoom percentage using the
slider-bar beneath the diagram on the Web page. Selecting the Refresh button on
the browser runs the applet and restores the initial zoom setting. The default
value is 100 percent. The initial diagram can be scaled up with a value greater
than 100 or scaled down with a value less than 100.
Used by: DS2CONST
BDCLASS=body-stylesheet-name
specifies the name of the stylesheet that is to be applied to the body of the HTML
output file.
Used by: DS2TREE, DS2CONST, DS2CSF.
BG=color-or-image
specifies the background color or image, based on the value of the BGTYPE=
argument. The color can be specified as an HTML 3.2 color name or as a 6-digit
hexadecimal RGB value. When BGTYPE=IMAGE, this argument specifies a
background image, using a path or a URL, relative or absolute.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
BGTYPE=NONE | COLOR | IMAGE
specifies the background type, using one of the following values:
NONE
causes the applet to display its default background color. This is the default
value.
COLOR
specifies that the value of the BG= argument must be an HTML 3.2 color
name or hexadecimal RGB value.
IMAGE
specifies that the value of the BG= argument must be the path or URL
pointing to an image file that will be displayed in the background of the
applet window.
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros Arguments for Page Formatting 553
To use a different DOCTYPE tag, specify the entire contents of the tag as the
value of the DOCTYPE= argument, including the angle brackets.
If you specify DOCTYPE="", then no DOCTYPE tag is generated in the HTML
output file.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
ENCODE=Y | N
when the value is Y (default), replaces the angle bracket characters (< and >) in
SAS TITLE and FOOTNOTE lines with the HTML character entities (> and
<) respectively. Specifying ENCODE=N causes the browser to interpret the
angle brackets as parts of HTML tags. For example, you would use ENCODE=N if
you wanted to use the following TITLE statement:
title ’<FONT COLOR="red">Out of Range Data</FONT>’;
BODY
writes only the metagraphics codes (for META2HTM) or XML tags (for
DS2CONST, DS2TREE, and DS2CSF) into the HTML output file. No head or
foot information is generated in the HTML output file.
FOOT
writes metagraphics codes or XML tags and the </BODY> and </HTML> tags
to conclude the HTML file.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
SASPOWER=logo-image-file
specifies the path or URL, relative or absolute, to the image file of the SAS
Powered logo. In the HTML file, the image appears at the bottom of the page.
Selecting the image displays the SAS home page. By default, the logo is omitted.
To obtain the logo image file, see http://www2.sas.com/dispatcher/index.html. See
also the SPCLASS= argument.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
SEPCLASS=page-separator-stylesheet
specifies the path or URL, relative or absolute, to the style sheet that is used for
the page separator. If the value of the SEPTYPE= argument is RULE, then the
value of the SEPCLASS= argument is used on the CLASS attribute of the HTML
tag <HR>. If the value of the SEPTYPE= argument is IMAGE, then the value of
SEPCLASS= argument is used on the CLASS attribute of the HTML tag <IMG>.
Used by: DS2TREE, DS2CONST, DS2CSF.
SEPLOC=separator-image
specifies the path or URL, relative or absolute, to the image that you want to use
as the separator between the graphs in your presentation. This argument is valid
only if the value of the SEPTYPE= argument is IMAGE.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
SEPTYPE= IMAGE | NONE | RULE
specifies the type of separator that is used between multiple applets in your
presentation. The valid values are defined as follows:
IMAGE
specifies separate graphs using the image specified in the SEPLOC=
argument.
NONE
specifies not to use a separator between applets.
RULE
inserts a line between applets. This is the default.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM.
SPCLASS=logo-stylesheet-name
specifies the name of the style sheet class that is to be used for the Powered by
SAS logo.
Used by: DS2TREE, DS2CONST, DS2CSF.
Style sheet arguments reference style information in one of two ways. Most of the
arguments specify parameters in the HTML LINK tag:
<LINK HREF="1qtr98.css" TYPE="text/css" REL="stylesheet">
Use these arguments when you do not want to enter your style information directly into
your HTML file when you create that file.
Other arguments embed the style information into the header of the HTML file. Use
these arguments when you want to collect style information from multiple style sheets.
The end result must create a complete STYLE tag in your HTML file.
You can combine LINK tag arguments with arguments that embed style information,
but you cannot use the same ordinal number in two arguments. For example, you can
specify the arguments SSHREF1= and SSFILE2=, but you cannot specify SSHREF1=
and SSFILE1=.
The following arguments link to two different style sheets and include text comments
for each stylesheet.
ssfile1=comments1.txt, /* embeds text */
sshref2=/style/style1.css, /* links to stylesheet */
sstype2=text/css, /* parameters for style sheets */
ssrel2=stylesheet,
ssfile3=comments2.txt, /* embeds text */
sshref4=/style/style2.css, /* link to stylesheets */
sstype4=text/css,
ssrel4=stylesheet,
SSFILE1–SSFILE5=file-specification
embeds in the HTML file the entire contents of the specified file.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSFREF1–SSFREF5=fileref
embeds in the HTML file the entire contents of the file that is referenced by the
SAS fileref.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSHREF1–SSHREF5=style-sheet-URL
specifies the URL of the stylesheet in the HREF= attribute of the LINK tag. If you
specify a relative URL, it must be relative to the location of the HTML output file.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSMEDIA1–5=media
specifies the media for which the style sheet was designed. The value is applied to
the MEDIA= attribute of the LINK tag. The default value is SCREEN. Examples
of other valid MEDIA values include BRAILLE for tactile feedback devices, and
HANDHELD for small-screen devices.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSREL1–5=relationship
specifies the REL= attribute of the LINK tag, which describes the relationship from
the linked file to the HTML file. The value of this tag is generally STYLESHEET.
The arguments SSREL1–5= can also be used with the arguments SSREV1–5 to
link HTML pages in a series. For example, the SSREL1= argument can specify
the next document in the series, and the SSREV2= argument can specify the
reverse relationship, which would be the previous document in the series. Both
arguments, SSRELn= and SSREVn=, can appear in the same LINK tag.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
556 Arguments for the SAS TITLE and FOOTNOTE Tags Chapter 21
SSREV1–5=relationship
specifies the REV= attribute of the LINK tag, which describes the relationship
from the HTML file to the linked file. See the SSREL1–5= argument for details.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSTITLE1–5=title-of-linked-page
specifies the TITLE= attribute of the LINK tag. The TITLE= attribute provides a
title for the referenced page. Use this argument when you are using the SSRELn=
and SSREVn= arguments to specify next and previous links in a series of Web
pages.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
SSTYPE1–5=stylesheet-type
specifies the TYPE= attribute of the LINK tag. For cascading style sheets, this
value usually is TEXT/CSS. For JavaScript style sheets, this value is generally
TEXT/JAVASCRIPT.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
For each possible value of the TTAG= and FTAG= arguments, the following
table shows the HTML tags that are generated by the macro for the SAS TITLE
and FOOTNOTE lines (the corresponding end tags are generated automatically):
TTAG or FTAG Value HTML Tag or Tags Enclosing the SAS TITLE or
SAS FOOTNOTE
NO FORMATTING (none)
STRONG <STRONG>
EMPHASIS <EM>
HEADER 1 <H1>
HEADER 2 <H2>
HEADER 3 <H3>
HEADER 4 <H4>
HEADER 5 <H5>
HEADER 6 <H6>
BOLD <B>
ITALICIZED TEXT <I>
TTAG or FTAG Value HTML Tag or Tags Enclosing the SAS TITLE or
SAS FOOTNOTE
PREFORMATTED + COMPUTER <PRE><CODE>
CODE
PREFORMATTED + KEYBOARD <PRE><KBD>
INPUT
TTAG or FTAG Value HTML Tag or Tags Enclosing the SAS TITLE or
SAS FOOTNOTE
BOLD + KEYBOARD INPUT <B><KBD>
TTAG or FTAG Value HTML Tag or Tags Enclosing the SAS TITLE or
SAS FOOTNOTE
ITALICIZED + CITATION + BIG <I><CITE><BIG>
TTAG or FTAG Value HTML Tag or Tags Enclosing the SAS TITLE or
SAS FOOTNOTE
ITALICIZED + LITERAL + SMALL <I><SAMP><SMALL>
CHARSET=char-set-name
specifies the character set name that will be written into the META tag of the
HTML output file. For information on available character set names, see
http://www.iana.org/assignments/character-sets.
Used by: DS2TREE, DS2CONST, DS2CSF, META2HTM
TRANLIST=transcoding-list-name
specifies the name and location of an existing transcoding list, either user-defined
or from SAS. The transcoding list name must be a four-level name, and the fourth
level must be SLIST, as in the following example:
TRANLIST=SASHELP.HTMLGEN.IDENTITY.SLIST
DATA=SAS-data-set-name
specifies the name of the data set that is to be used to generate the graph. The
default data set is the one that was most recently created.
Used by: DS2CSF
LABELS=Y | N
when the value is Y (default), indicates that the graph label and critical success
value are displayed beneath the gauge. Specifying LABELS=N suppresses the
display of the diagram label and critical success value.
Used by: DS2CSF
562 DS2CSF Arguments for Diagram Appearance Chapter 21
PW=password
specifies the password that is needed to access a password-protected data set. This
argument is required if the data set has a READ or PW password. It is not
required if the data set has a WRITE or ALTER password.
Used by: DS2CSF
VAR=variable-name
specifies the name of the variable in the SAS data set that is to be represented in
the graph. The indicated value is the value of this variable in the first observation
in the data set.
Used by: DS2CSF
CBACK=color
specifies a background color for the graph. The value must be a valid HTML 3.2
color name or a six-digit hexadecimal RGB value.
Used by: DS2CSF
CHUB=color
specifies a color for the half-circle area in the bottom middle of the classic diagram.
The value must be a valid HTML 3.2 color name or a six-digit hexadecimal RGB
value.
Used by: DS2CSF
CINDIC=color
specifies the color of the indicator in both the classic and the digital styles of the
diagram. The value must be a valid HTML 3.2 color name or a six-digit
hexadecimal RGB value.
Used by: DS2CSF
CLABTXT=color
specifies the color of the text label (and value, in the classic graph) that appear in
a bold text font. The value must be a valid HTML 3.2 color name or a six-digit
hexadecimal RGB value.
Used by: DS2CSF
CLABVAL=color
specifies the color of the data value labels that appear above the gauge. The value
must be a valid HTML 3.2 color name or a six-digit hexadecimal RGB value.
Used by: DS2CSF
COUTLINE=color
specifies the color of the outline that is drawn around the classic or digital gauge.
The value must be a valid HTML 3.2 color name or a six-digit hexadecimal RGB
value.
Used by: DS2CSF
CSFTYPE=CLASSIC | DIGITAL
when the value is CLASSIC (default), specifies that the graph is to be rendered as
an analog gauge with a needle that points to the critical success factor. Specifying
a value of DIGITAL displays a diagram that resembles a liquid-crystal display.
DS2CONST, DS2TREE, DS2CSF, and META2HTM Macros DS2CSF Arguments for Diagram Appearance 563
CVALUE=color
specifies the color of the critical success value. This value is shown in a bold text
font along with the text label value in the classic graph. In the digital graph, the
value appears in a digital font. The value must be a valid HTML 3.2 color name or
a six-digit hexadecimal RGB value.
Used by: DS2CSF
DEPTH=TWO_DIMENSION | TWO_AND_A_HALF_DIMENSION
when the value is TWO_AND_A_HALF_DIMENSION (default), specifies a
diagram that appears to have a degree of depth.
Used by: DS2CSF
DRILURL=URL
specifies the URL, relative or absolute, that is to be displayed when the user
selects any part of the diagram.
Used by: DS2CSF
DRILTARG=target-window-or-frame
specifies the HTML target or the name of the browser window or frame where
drill-down URLs are to be displayed. The default behavior is to open a new
browser window and reuse it for subsequent drill-down requests. Specifically, the
default value is _BLANK, which is one of several reserved names for targets in
HTML. The DRILTARG value can also be the name of a window or frame in the
Web presentation.
Used by: DS2CSF
HINDIC=indicator-height-percentage
specifies the height of the indicator for the classic diagram (see the CSFTYPE=
argument). Valid values must be greater than zero and less than 100.
Used by: DS2CSF
INDICTYP=indicator-shape
specifies the shape of the indicator for the classic diagram (see CSFTYPE). Valid
values can be ARROW, HARPOON, LINE, NEEDLE, or SPEAR.
Used by: DS2CSF
LABELPOS=text-label-location
specifies the location of the text label that identifies the critical success factor.
Valid values can be TOP_LEFT, TOP_CENTER, TOP_RIGHT, BOTTOM_LEFT,
BOTTOM_CENTER, or BOTTOM_RIGHT.
Used by: DS2CSF
RANGE=range-name
specifies the four-level name of the RANGE entry that defines range values and
colors. For example:
range=sashelp.javagrf.sample1.range
This opens a window that you use to define the range. Use the scrollbar on the
window to navigate between segments of the range.
Used by: DS2CSF
564 META2HTM Arguments for Saving the HTML File Chapter 21
VALUEPOS=CSF-value-location
specifies the location of the critical success value. Valid values can be TOP_LEFT,
TOP_CENTER, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, or
BOTTOM_RIGHT.
Used by: DS2CSF
WINDIC=indicator-width
specifies the width of the critical success indicator, in pixels. The default value is 8.
Used by: DS2CSF
RUNMODE=B | S
specifies whether you are running the macro in batch or server mode. Batch mode
(the default) means that you are submitting the META2HTM macro in the
Program Editor or you have included it in a SAS program. Server mode is used
with Dispatcher Applications in the SAS/INTRNET software. Specifying server
mode generates an HTTP header that is required by Application Dispatcher.
This argument is required.
Used by: META2HTM
CTIPHILT=hex-color
specifies a six-digit hexadecimal RGB value for the color of the graph element that
has been selected to display its pop-up data tips window. The default highlight
color is red. See also the TIPTYPE= argument.
Used by: META2HTM
PAGECTL=Y | N
when the value is N (default), prevents the display of the page-selection control.
For further information, see “Metaview Applet Parameters” on page 475.
Used by: META2HTM
SLIDECTL=Y | N
the default value of N prevents the display of the graph-selection control. For
further information, see “Metaview Applet Parameters” on page 475.
Used by: META2HTM
ZOOMCTL=Y | N
specifies whether or not the zoom control appears in the applet control area. By
default, the control is displayed.
Used by: META2HTM
Reserved Names
Do not use the following names as the value of a macro variable:
Libnames and Filerefs
HTML
CATENT
HTMSS
Global Macro Variables
_htmovp
_htmcap
_htmtitl
_htmwher
Data Sets or Views
WORK._BYGRP
Catalogs
WORK._HTMLG_
SASHELP.HTMLNLS
Catalog Entries
SASHELP.HTMLGEN.DSPROP.SLIST
SASHELP.HTMLGEN.IDENTITY.SLIST
SASHELP.HTMLGEN.OUTPROP.SLIST
SASHELP.HTMLGEN.TABPROP.SLIST
SASHELP.HTMLGEN.TAGS.SLIST
567
CHAPTER
22
Enhancing Web Output
TIPS=NONE parameter to suppress data tips. See “Parameter Reference for Java and
ActiveX” on page 424.
You can provide your own custom data tips to the output of any SAS/GRAPH
procedure that supports the HTML= option. (This feature is supported by the Map
applet but is not currently supported by the Graph applet.) For information on this
technique, see “Adding Data Tips with the HTML= Option” on page 570.
Note: When you provide data-tip text using HTML=‘ALT="variable_name"’ the Java
applets automatically suppress the display of the default data tips. The ActiveX
Control, however, adds your custom text to the default text. To suppress the default
text in ActiveX presentations, use the TipMode=HTML parameter in an ODS
statement. See “Parameter Reference for Java and ActiveX” on page 424 .
For example:
ODS HTML parameters=("TipMode"="HTML")
Use the TIPS, NTIP, and NTIPFMT parameters of DS2TREE (see “DS2TREE and
DS2CONST Arguments for Data Definition” on page 537) to control data tip text.
HTML=’ALT="variable_name"’
The following code fragment illustrates the basic technique of adding data tips with
the HTML= option.
/* initialize a data tip variable in the data set */
length rpt $40;
In this case, the HTML= option identifies the variable RPT as containing ALT= plus the
text of data tip to be displayed. The value of RPT, in turn, is set by an IF statement
according to the contents of a SAS data set. The maximum length for the value of the
variable is 1024 characters, including the characters "ALT=".
The following code uses a variable inside the HTML= variable to substitute the
appropriate text for a data tip. It also uses the concatentation operator || to
concatenate the string "region" to the name of the region, and the newline character
’0D’x to create a second output line.
/* initialize a data tip variable in the data set */
length rpt $40;
For more on the HTML option, see “Adding Links with the HTML= and
HTML_LEGEND= Options” on page 574.
In this example, the value of the data set variable STATENAME completes the
drill-down URL.
Note: The variable must be used in the chart. It is not sufficient that it simply
be in the data set. 4
Any mode (Graph applet and ActiveX control)
attempts to implement each of the four drill-down modes in succession until a
valid Web destination is found. The order of the attempts is Local (Graph applet
only), Script, URL, and HTML.
be linked to in the SAS data set from which the Treeview is generated. For example,
the following data set specifies a different URL for each observation:
data father_and_sons;
input id $8. name $15. father $8. url $30.;
cards;
aaron Aaron Parker http://www.yourdomain.com/aaronparker.html
bob Bob Parker aaron http://www.yourdomain.com/bobparker.html
charlie Charlie Parker aaron http://www.yourdomain.com/charlieparker.html
david David Parker aaron http://www.yourdomain.com/davidparker.html
edward Edward Parker david http://www.yourdomain.com/edwardparker.html
;
run;
A simple, but complete example is shown in “Treeview with Hotspots” on page 510.
are available to you. You can also make the entire image a hotspot by including the
<IMG> tag inside an <A HREF=> tag.
Be sure to define your link variable with a length that will be sufficient to contain your
URLs (plus the HREF= option). The maximum length is 1024 characters.
The values of the link variable use the following syntax:
‘HREF=URL< “anchor-name”>’
This syntax is used in the following example:
RPT=’href="reports.html#west"’;
The following table lists the valid values of the link variable:
Enhancing Web Output Adding Links with the HTML= and HTML_LEGEND= Options 575
The most obvious method of adding these variables to your data set is to manually
add them to the desired observations in your data set. This method is not practical or
feasible in many cases, in which case you can use IF/THEN statements or variable
substitution.
The following picture shows how link variables are assigned to a bar chart. The three
bars represent regional sales for a company’s central, southern, and western regions.
576 Adding Links with the HTML= and HTML_LEGEND= Options Chapter 22
Each bar in the chart needs to link to a different anchor tag in an HTML file named
reports.html. The anchor names in the linked file are “central,” “south,” and “west.” The
following DATA step uses an IF/THEN statement to assign values to the link variable.
The following table shows the values in the data set REGSALES.
Enhancing Web Output Adding Links with the HTML= and HTML_LEGEND= Options 577
To illustrate the use of variable substitution, assume that you are developing for the
Metaview applet a presentation that uses the HREF drill-down mode of linking. You
need to add an enhancement variable to each observation in the data set. The value of
that variable is a URL that has a common base and a filename that is derived from a
variable in the data set. The following example defines the base URL, defines an
enhancement variable, and uses variable substitution to assign values to the
enhancement variable.
%let htmlpath=http://webServer1/graph/javameta;
data yearsonly;
set prdsummary(where=(_type_ eq 2));
length htmlvar $200;
htmlvar=’href=’||quote("&htmlpath/y"||put(year,4.)||’.htm’);
run;
In the preceding example, the values of the enhancement variable HTMLVAR are
URLs. Each URL combines the base address in HTMLPATH with the value of the
YEAR variable and a filetype of HTM.
578
579
CHAPTER
23
Troubleshooting Web Output
Can’t access the HTML file. Incorrect URL. Check the URL in the browser.
Network access denied. Check operating environment
permissions for the HTML file.
Browser cannot run the applet For Java, ensure that the
or control. HTML file is correctly
referencing the Java plug-in
and SAS Java archive. See
“Specifying the Location of
Control and Applet Files
(CODEBASE= and ARCHIVE=
Options)” on page 422.
Browser displays popup Client RAM is insufficient for Generate a new graph using a
message rendering. smaller data set or a simpler
Error: Not enough graph. If using PROC GMAP,
virtual memory to produce consider using PROC
plot.
GREDUCE.
Graph is not rendering as A style attribute may not be Ensure that the attribute is
specified by the ODS graph enabled for your ODS enabled for your ODS
style. destination. destination. For example, the
URL attribute is not enabled
for the PS destination. Refer to
the table of style attributes for
the STYLE statement of the
TEMPLATE procedure in SAS
Output Delivery System: User’s
Guide.
In ActiveX, the user gets the 1 Virus-scanning software 1 Turn off any
message may be interfering with virus-scanning software
There is a pending reboot the installation of the before installing the
for this machine...
control. control.
2 Other instances of the 2 Be sure to close all
control might be running. instances of Internet
Explorer before installing
the control.
Text font is incorrect. Java font is defined differently. Change browser fonts or
change the SAS/GRAPH
program. See “Correcting Text
Fonts” on page 583.
In ActiveX, black-and-white ActiveX does not enable 8-bit Convert the image to 24-bit
image is not displayed grayscales images. monochrome.
Graph loses attributes after Some attribute loss is inherent Select the Refresh button in
graph type is changed in the in graph type changes. the Web browser to restore the
Web browser. original graph.
Changes made through the The graph discards subsetting Make any changes needed
Data Options dialog cause the information if you make through the Data Options
graph to revert to its original changes through the Data dialog before subsetting the
view. Options dialog. graph.
Colors wrong in Netscape. Netscape is running without Run Netscape with the install
its own color map. option. See “Resolving Colors
in Netscape” on page 583.
For presentations that run in the Constellation, Treeview, and Rangeview applets,
the macros DS2CONST, DS2TREE, and DS2CSF enable the ENCODE argument, which
you can use to automatically replace or not replace angle brackets (“<” and “>”) in
TITLE and FOOTNOTE statements.
Running the Netscape program with the INSTALL option generates a separate color
map for that browser.
3
P A R T
CHAPTER
24
Using Annotate Data Sets
Overview 587
Enhancing Existing Graphs 588
Creating Custom Graphs 588
Creating Annotate Graphics 589
About the Annotate Data Set 589
Structure of An Annotate Data Set 589
Annotate Variables 591
Annotate Functions 594
About Annotate Graphics 595
Graphics Elements 595
Coordinates 596
Coordinate Systems 596
Ranges for Cells 598
Internal Coordinates 598
Attribute Variables 599
Creating an Annotate Data Set 599
Using the DATA Step 600
Using Annotate Macros in the DATA Step 600
Effect of Missing Values 601
Producing Graphics Output from Annotate Data Sets 601
Including Annotate Graphics with Procedure Output 601
Producing Only Annotate Graphics Output 601
Using the Annotate Variables for Web Output 602
Annotate Processing Details 602
Order in Which Graphics Elements Are Drawn 602
Controlling the Processing with the WHEN Variable 602
Using BY-Group Processing with the Annotate Facility 603
Using the LIFO Stack 603
Debugging 604
Examples 604
Labeling Cities on a Map 604
Labeling Subgroups in a Vertical Bar Chart 607
Drawing a Circle of Stars 609
Overview
The Annotate facility enables you to generate a special data set of graphics
commands from which you can produce graphics output. This data set is referred to as
an Annotate data set. You can use it to generate custom graphics or to enhance graphics
588 Enhancing Existing Graphs Chapter 24
The program that creates this output is in “Labeling Cities on a Map” on page 604.
The program that creates this output is in “Drawing a Circle of Stars” on page 609.
point in the output, and draw a triangle. (The DATA step that creates TRIANGLE is
shown in “Using the DATA Step” on page 600.)
OBS FUNCTION X Y HSYS XSYS YSYS STYLE COLOR POSITION SIZE LINE TEXT
Note: A blank denotes a missing value for a character variable. A ’.’ denotes a
missing value for a numeric variable. 4
Each observation in this data set contains complete instructions for drawing a
graphic or moving to a position to draw a graphic. The value of the FUNCTION
variable determines what the observation does. Other variables control how the
function is performed. This list describes each observation in the TRIANGLE and the
task it performs:
1 Create a label. This instruction draws a green label at position 20,85 (in X,Y
coordinates). The value of the FUNCTION variable (LABEL) tells the program
what to do. The values of the coordinate variables X and Y combined with the
values of the coordinate system variables HSYS, XSYS, and YSYS tell where to do
it. The values of the attribute variables STYLE, COLOR, TEXT, POSITION, and
SIZE tell how to do it. These variables specify the font (SWISSB), the color and
text of the label, the position of the label in relation to X and Y (centered on the
point), and the size of the text.
2 Go to the starting point for the triangle. The value of the FUNCTION variable
(MOVE) tells the program to go to the point specified by X and Y. This is the only
instruction in the observation. Notice that the values of the variables specified for
the first observation persist but are not used because they have no effect on the
MOVE function.
3 Draw the first line of the triangle. The value of the FUNCTION variable (DRAW)
tells the program to draw a line from the current point (the one specified by
MOVE in the second observation to the new point specified by X and Y. The value
of the COLOR variable changes to red.
4 Draw the second line of the triangle.
5 Draw the third line of the triangle.
Figure 24.3 on page 591 shows the green title and the red triangle produced by the
TRIANGLE data set and displayed with the GANNOChapter 26, “The GANNO
Procedure,” on page 707 procedure. Notes on the figure in black contain the X and Y
coordinates of the graphics elements.
Using Annotate Data Sets Annotate Variables 591
Annotate Variables
Annotate variables have predefined names. In each observation, the Annotate facility
looks only for variables with those names. Other variables can be present, but they are
ignored. Conceptually, there are three types of variables:
an action tells what to do. The only action variable is FUNCTION, which
variable specifies what graphics element to draw (graphics primitive) or what
action to take (programming function).
positioning tell where to do it. The positioning variables specify the point at
variables which to draw the graphics element.
attribute tell how to do it. The attribute variables specify the characteristics
variables of the graphics element (for example, color, size, line style, text font).
There is also an HTML variable, which provides linking information when you want
to use the annotate data set to generate a drill-down graph that can be viewed in a Web
browser.
Table 24.1 on page 591 lists all Annotate variables, grouped by task, and briefly
describes each one. See “Annotate Variables” on page 642 for a complete description of
each variable.
Variable that defines an FUNCTION specifies a drawing or programming action; Table 24.2 on page
action 594 describes these actions.
Positioning variables that GROUP uses the value of the GCHART GROUP= option in place of X or Y
determine coordinate
values
Attribute variables ANGLE angle of text label or starting angle of a pie slice
See Figure 24.4 on page 593 for a table that shows you which Annotate functions are
used with which Annotate variables.
Using Annotate Data Sets Annotate Variables 593
Annotate Functions
The FUNCTION variable accepts a set of predefined values (functions) that perform
both graphics tasks and programming tasks.
The graphics functions draw the graphics elements that are illustrated in “Graphics
Elements” on page 595.
The programming functions control the internal coordinates, manipulate the LIFO
stack, and help you debug an Annotate data set. These programming functions are
discussed in “Internal Coordinates” on page 598, “Using the LIFO Stack” on page 603,
and “Debugging” on page 604.
Table 24.2 on page 594 summarizes the tasks that are performed by the Annotate
functions. See “Annotate Functions” on page 615 for a complete description of the
FUNCTION variable and its values.
Use this
Task Group If you want to... function...
Graphics tasks begin to draw a polygon (starting point) and, optionally, specify a fill color POLY
and pattern
put a frame around the area defined by XSYS and YSYS, optionally, fill FRAME
with a pattern
Programming insert a comment in the data set (no action); documentation aid COMMENT
tasks
get values for LAST and LSTT coordinates from LIFO stack POP
put current values of LAST and LSTT coordinates onto LIFO stack PUSH
Using Annotate Data Sets Graphics Elements 595
Use this
Task Group If you want to... function...
set pie radius and coordinates for center; does not draw a pie PIECNTR
See Figure 24.4 on page 593 for a table that shows you which Annotate functions
work with which Annotate variables.
Graphics Elements
In an Annotate data set, the FUNCTION variable determines the graphics element
that is drawn.
The particular graphics elements that you can draw are shown in Figure 24.5 on
page 595 along with the value of the FUNCTION variable or Annotate macro that
draws them.
You can control the position of graphics elements in the following ways:
3 explicitly, using coordinates that you supply.
3 dependently, based on the location of features in the SAS/GRAPH output. For
example, when you use the GCHART procedure, you can label the parts of a
596 Coordinates Chapter 24
subgrouped vertical bar chart by using the SUBGROUP variable in your Annotate
data set. The Annotate facility enables you to label subgroups without having to
specify the actual coordinates of the subgroup bar.
3 dependently, based on values that are supplied from other data sets. For example,
you can label the ending point of a plot line in the GPLOT procedure by extracting
the value of the last point in the sorted input data set.
Coordinates
Coordinates specify where to put graphics elements. These variables can contain
coordinate values:
3 X, Y, and sometimes Z are used for numeric coordinates.
3 XC and YC are used for character coordinates.
3 GROUP, MIDPOINT, and SUBGROUP can be used when you annotate output
from procedures such as GCHART. Use these variables to specify coordinates for
horizontal or vertical bar charts.
Coordinates are interpreted in terms of a coordinate system in order to identify a
precise location in the graphics output.
Coordinate Systems
A coordinate system determines how coordinates are interpreted. You specify a
coordinate system to use for each dimension, using the XSYS, YSYS, and ZSYS
variables (for X, Y, and Z, respectively). Use ZSYS to annotate graphics output only
from the G3D procedure.
You also specify a coordinate system for the SIZE variable using the HSYS variable.
HSYS takes the same kinds of values as XSYS, YSYS, and ZSYS. The SIZE variable
specifies the size of a graphics element, such as the width of lines (for example,
FRAME), the radius of pie slices (for example, PIE, PIECNTR, and PIEXY), or the
height of text (for example, LABEL and SYMBOL).
These are the important components of the Annotate coordinate systems:
3 Area: Each coordinate system refers to one of three drawing areas: data area,
procedure output area, and graphics output area. Coordinates are measured from
a different origin for each area; they also have different limits. Figure 24.6 on
page 597 shows the areas on the graphics output and the coordinate systems that
use them.
Using Annotate Data Sets Coordinate Systems 597
3 Units: The units for a coordinate system are based on one of the following:
3 data values (for data coordinate systems). The range of values depends on
the range of data expressed along the axes of the graph.
3 cells (for coordinate systems for the procedure output area or graphics output
area). The range of values depends on the type of area. See “Ranges for
Cells” on page 598.
3 percentages of the total area available, that is, percent of the data area, or
percent of the procedure output area, or percent of the graphics output area.
3 Placement: The placement of a coordinate can be absolute or relative. Absolute
coordinates name the exact location for a graphics element in the graphics output.
Relative coordinates name the location with respect to another graphics element in
the output.
Table 24.3 on page 597 describes the coordinate system values for the XSYS, YSYS,
ZSYS, and HSYS variables.
Table 24.3 Coordinate System Values for XSYS, YSYS, ZSYS, and HSYS Variables
Internal Coordinates
The Annotate facility maintains two pairs of internal coordinates that are stored in
internal variables:
3 coordinates of the last graphics element drawn or the coordinates from the last
move are stored in the variables XLAST and YLAST
3 coordinates of the last text drawn are stored in the variables XLSTT and YLSTT.
Many functions use these internal coordinates as a starting point, relying on the
coordinates that are specified with the function as an ending point. For example, in the
BAR function, the (XLAST, YLAST) coordinate pair is used for the lower left corner; the
position defined by the X and Y variables is used for the upper-right corner. (For
details, see “BAR Function” on page 615.) These internal variables can also provide
default coordinates if X, XC, Y, or YC contains a missing value.
The internal coordinates are automatically updated by some of the Annotate
functions. The text functions, LABEL and SYMBOL, update the (XLSTT,YLSTT)
variables. The BAR, DRAW, MOVE, PIE, and POINT functions update the
(XLAST,YLAST) variables.
Using Annotate Data Sets Creating an Annotate Data Set 599
You cannot explicitly assign a value to XLAST, YLAST, XLSTT, or YLSTT because
they are internal variables. For example, you cannot make this assignment:
xlast=50;
However, you can use several functions to directly manipulate the values of the
internal coordinates. The functions are shown in Figure 24.7 on page 599.
Attribute Variables
Attribute variables control the appearance of the graphics elements. Each function
uses only a subset of these variables. See Table 24.1 on page 591 for a list of attribute
variables.
What an attribute variable controls often depends on the graphics element to which
it applies. For example, the SIZE variable controls the width of a line when it is used
with FUNCTION=’DRAW’, but it controls the text height when it is used with
FUNCTION=’LABEL’.
For a complete description of the attribute variables and the aspect of the graphics
elements that they control, see “Annotate Variables” on page 642.
/* declare variables */
length function style color $ 8 text $ 25;
retain hsys xsys ysys ’3’;
Notice that a RETAIN statement sets the values of the HSYS, XSYS, and YSYS
variables. RETAIN statements are useful when you want to select the values for
variables that are required for many functions and the value is the same for all of them.
The SIZE, LINE, and COLOR variables are included with only the first DRAW
function. Using this method to create the data set, the values set in the first DRAW
function carry over to subsequent DRAW functions.
The PROC GANNO takes as input the annotate data set “triangle” created by the
previous DATA step and creates the output shown in Figure 24.3 on page 591.
3 The GSLIDE procedure can also produce graphics output consisting only of
Annotate graphics. In addition, you can enhance the graphics output with TITLE,
NOTE, and FOOTNOTE statements. See Chapter 44, “The GSLIDE Procedure,”
on page 1277 for details.
Figure 24.8 Using PUSH and POP to Store and Retrieve Coordinate Values
604 Debugging Chapter 24
Debugging
You can print your Annotate data set with the PRINT procedure. This is an easy way
to examine the Annotation that you have specified or to debug your program. For
example, a listing such as the one in Output 24.1 provides complete information about
the value that you specify for each variable in every observation.
For more complex problems, the DEBUG function enables you to display the values
of Annotate variables and internal coordinates before and after a function is submitted.
The values are written to the SAS log.
If there is an error in your Annotate data set, one or more diagnostic messages are
printed in the SAS log:
3 If an error is found in preprocessing, this message appears:
NOTE: ERROR DETECTED IN ANNOTATE= libref.dataset
20 TOTAL ERRORS
Examples
The following examples show how to annotate graphics that are created with SAS/
GRAPH procedures and how to build custom graphics:
3 “Labeling Cities on a Map” on page 604
3 “Labeling Subgroups in a Vertical Bar Chart” on page 607
3 “Drawing a Circle of Stars” on page 609
Other examples that use Annotate data sets are as follows:
3 Example 1 on page 710 (and others in that chapter
3 Chapter 44, “The GSLIDE Procedure,” on page 1277
3 “Drawing a Circle of Stars” on page 609
Annotate LABEL
SYMBOL
function:
Annotate HSYS
variables:
POSITION
Using Annotate Data Sets Labeling Cities on a Map 605
SIZE
TEXT
WHEN
X and Y
XSYS
YSYS
Sample library GANCITY
member:
This example labels a map of the continental United States with the location and
names of three cities. The GMAP procedure draws a map of the U.S. and an Annotate
data set adds the stars and labels.
The DATA step that creates the Annotate data set gets the x and y coordinates of the
cities to be labeled from the MAPS.USCITY data set. Because MAPS.USCITY stores
projected coordinates in the X and Y variables, the DATA step does not need to reassign
the variable values. Also because X and Y contain data values (the map data set
coordinates), the XSYS and YSYS variables specify coordinate system 2, absolute data
values. However, the HSYS variable that controls text height uses coordinate system 3,
percent of the graphics output area.
See Example 4 on page 1180 for an example of labeling a map using map coordinates
in units of latitude and longitude.
See Chapter 35, “The GMAP Procedure,” on page 995 for more information on using
map data sets
.
Note: If the libref MAPS is automatically assigned at your site to the SAS data
library containing the Institute-supplied map data sets, you can omit the LIBNAME
statement. 4
606 Labeling Cities on a Map Chapter 24
Assign the libref MAPS, if necessary, and set the graphics environment.
libname maps ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
Subset the U.S. map data set by omitting Alaska and Hawaii.
data lower48;
set maps.us;
if state ne stfips(’AK’);
if state ne stfips(’HI’);
run;
Create the Annotate data set, CITYSTAR. CITYSTAR contains the commands that draw a star and a label at
each of the three cities. Setting WHEN to A draws the annotation after the map.
data citystar;
length function style color $ 8 position $ 1
text $ 20;
Include the values of selected variables from MAPS.USCITY. X and Y contain projected coordinates; CITY
contains names; STATE contains FIPS codes. Because there are several Atlantas, a STATE value is necessary.
set maps.uscity(keep=x y city state);
or city=’Chicago’
or city=’Seattle’;
Create the observation that draws the star. The text string V is the character code for the
star figure in the MARKER font assigned by the STYLE variable.
function=’symbol’; style=’marker’; text=’V’; color=’red’; size=5;
output;
Create the observation that labels the city. TEXT is assigned the value of CITY. The font is
SWISSB. SIZE uses the units assigned by HSYS so text height is 5 percent of the height of the
graphics output area. POSITION 8 places the label directly below the city location.
function=’label’; style=’swissb’; text=city; color=’green’;
size=5; position=’8’; output;
run;
Define patterns for the map areas. MEMPTY colors only the state borders.
pattern value=mempty color=blue repeat=49;
Generate the map and assign the annotate data set to the CHORO statement.
proc gmap data=lower48 map=lower48;
id state;
choro state / annotate=citystar discrete nolegend;
run;
quit;
This example shows how to label subgroups in a vertical bar chart that is generated
by the GCHART procedure. Each bar represents total orders for a city and is
608 Labeling Subgroups in a Vertical Bar Chart Chapter 24
subgrouped by the type of order. The Annotate facility labels each subgroup with the
number of orders for that category. The coordinates that position the subgroup labels
are derived from the values of the GCHART procedure variables CITY (the chart (or
midpoint) variable) and TYPE (the subgroup variable). These variables are assigned to
the corresponding Annotate variable.
See Chapter 29, “The GCHART Procedure,” on page 773 for more information on
creating bar charts.
Create the Annotate data set, BARLABEL. The MIDPOINT variable uses the values of the
chart variable CITY to provide the X coordinate for the subgroup labels. The SUBGROUP
variable uses the values of the variable TYPE to provide the Y coordinate that vertically
positions the labels in the bar. Because no function is specified, the data set uses the default
function, LABEL. The POSITION value E places the labels just below the top of each subgroup
bar.
data barlabel;
length color style $ 8;
retain color ’white’ when ’a’ style ’swissb’
xsys ysys ’2’ position ’E’ size 4 hsys ’3’;
set sold;
midpoint=city;
subgroup=type;
text=left(put(units,5.));
run;
Define axis characteristics. AXIS1 suppresses the vertical axis. AXIS2 drops the midpoint
axis label.
axis1 label=none major=none minor=none style=0
value=none;
axis2 label=none;
Generate a vertical bar chart and assign the Annotate data set to the VBAR statement.
proc gchart data=sold;
vbar city / type=sum
sumvar=units
subgroup=type
width=17
raxis=axis1
maxis=axis2
annotate=barlabel;
run;
quit;
This example shows how to use an Annotate data set to draw a flag that is composed
of a rectangle and four stars. The stars are positioned by placing them on an imaginary
circle. The program uses the PIECNTR and PIEXY functions to find the points on the
circle and the CNTL2TXT programming function to transfer coordinate values. It also
processes Annotate assignment statements in a DO loop. The GANNO procedure
displays the Annotate graphics.
Create the Annotate data set, FLAG. XSYS, YSYS, and HSYS specify coordinate system 3,
absolute size of the graphics output area.
data flag;
length function style color $ 8 text $ 30;
retain xsys ysys hsys ’3’;
Draw a frame. The FRAME function uses the default color BLACK to draw a frame around
the graphics output area specified by the XSYS and YSYS variables.
function=’frame’; output;
Draw the footnote. The LABEL function draws the text specified in the TEXT variable. X and
Y explicitly position the footnote on the graphics output area.
function=’label’; x=92; y=5; text=’GANCIRCL’;
style=’swiss’; size=3; position=’5’; output;
Using Annotate Data Sets Drawing a Circle of Stars 611
Draw the title. The values of FUNCTION, POSITION, and COLOR remain the same because
no new values are assigned.
Draw the background. MOVE specifies the lower left corner of the rectangle that forms the
flag. BAR draws the rectangle using the values of X and Y for the upper right corner. The LINE
value of 3 fills the figure with the specified color.
Draw the circle of stars. The DO loop repeats the processing instructions defined by the
nested assignment statements, placing a star every 90 degrees around the circle. To increase the
number of stars, reduce the size of the angle between them and adjust the ending angle.
The PIECNTR function is set to the center of the rectangle. PIEXY calculates a point on the arc
based on the value of STAR_ANG and updates the internal coordinates XLAST and YLAST.
The programming function CNTL2TXT copies the values of XLAST and YLAST to the
text-handling coordinates XLSTT and YLSTT. Assigning missing values to X and Y forces the
SYMBOL function to use the values of XLSTT and YLSTT to position the star. The text string V
is the character code for the star figure in the MARKER font assigned by the STYLE variable.
function=’cntl2txt’; output;
function=’symbol’; style=’marker’; text=’V’;
angle=0; color=’white’; size=10; x=.; y=.;
output;
end;
run;
Use the GANNO procedure to process the Annotate data set and generate the
graphics output.
CHAPTER
25
Annotate Dictionary
conjunction with the Chapter 26, “The GANNO Procedure,” on page 707 or Chapter 44,
“The GSLIDE Procedure,” on page 1277 procedures, or you can apply an Annotate data
set to graphics that were generated with procedures such as Chapter 29, “The GCHART
Procedure,” on page 773, Chapter 30, “The GCONTOUR Procedure,” on page 885, and
Chapter 35, “The GMAP Procedure,” on page 995, among others.
In addition, SAS/GRAPH supports the following procedures on the client using Java
or ActiveX:GCHART, GCONTOUR, GMAP, GPLOT, GRADAR, and G3D.
In an Annotate data set, each observation represents a command to draw a graphics
element or perform an action. The observations use a set of predefined “Annotate
Variables” on page 642. “Annotate Functions” on page 615 determine what is to be done
with each observation. “Annotate Macros” on page 679 simplify the process of drawing
a graphics element. “Annotate Error Messages” on page 699 are sent to the SAS log.
For usage information and example programs , refer to “Using Annotate Macros” on
page 697 and Chapter 24, “Using Annotate Data Sets,” on page 587.
Annotate Functions
In an Annotate data set, the value of the FUNCTION variable specifies what action
the observation performs. Annotate functions act in conjunction with Annotate
variables that determine where and how to perform the action. Many of these variables
are function-dependent, that is, what they do depends on the function they are used
with. For example, with the LABEL function the STYLE variable specifies a font; with
the BAR function, STYLE specifies a pattern.
This section describes all of the values of the FUNCTION variable. For each function
it
3 describes the function’s action.
3 notes whether the function updates the internal coordinate variables XLAST,
YLAST and XLSTT, YLSTT.
3 describes how other Annotate variables behave with the function. For a complete
description of each variable, see “Annotate Variables” on page 642.
For a summary of drawing and programming tasks performed by the FUNCTION
variable, see Table 24.2 on page 594 .
The variables that are available for use with each function are listed in Figure 24.4
on page 593.
BAR Function
Draws a rectangle whose lower-left corner is defined by the internal variables (XLAST, YLAST) and
whose upper-right corner is defined by the specified X, Y variable pair. You can define the color of
the fill, the fill pattern, and the edge lines to be drawn.
Updates: XLAST, YLAST
Syntax
FUNCTION=’BAR’;
616 BAR Function Chapter 25
Associated Variables
COLOR=’color’
specifies the color of either the interior of the bar or the outline of the bar. Color
can be any SAS/GRAPH color name. The part of the bar affected depends on the
value of the STYLE variable. If STYLE specifies a pattern or fill, the COLOR
variable determines the color of the interior. If STYLE specifies an empty pattern,
the COLOR variable determines the color of the outline of the bar.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HTML=’link-string’
specifies the text that defines the link for drill-down.
LINE=0...3
specifies the direction in which to adjust the outline of the bar. Use LINE values 1
and 2 to offset a particular bar from an axis or adjoining area. The following figure
illustrates LINE values.
SIZE=thickness
specifies a line thickness for the rectangle
STYLE=’fill-pattern’
specifies the pattern that fills the bar. Fill-pattern can be the following bar and
block patterns:
SOLID a solid fill.
S
EMPTY an empty fill.
E
style<density> a shaded pattern:
style can be R | X | L
density can be 1...5
Annotate Dictionary CNTL2TXT Function 617
WHEN=’B’ | ’A’
specifies when to draw the bar in relation to other procedure output. See “WHEN
Variable” on page 666.
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
define the upper-right corner of a bar (rectangle) whose lower-left corner is
(XLAST,YLAST). Use the Z variable only when you are annotating output from the
G3D procedure. Figure 25.2 on page 617 illustrates the use of these coordinates.
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. The XC variable can be
used only with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for Y or YC variable. The YC variable can only be
used with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
Figure 25.2 on page 617 shows how the XLAST, YLAST, and X, Y variables define the
diagonal corners of the bar. With character data, the XC and YC variables are used in
place of the X and Y variables. The values of the XLAST and YLAST variables are
usually initialized with a MOVE function or another function that updates the XLAST
and YLAST pair. When the XC variable is used, set XSYS=’2’. When the YC variable is
used, set YSYS=’2’.
CNTL2TXT Function
Copies the values of the internal coordinates stored in the variable pairs (XLAST, YLAST) to
(XLSTT, YLSTT).
618 CNTL2TXT Function Chapter 25
Syntax
FUNCTION=’CNTL2TXT’;
Details
You can use CNTL2TXT to calculate the position of labels on a graph. For example, the
following DATA step uses CNTL2TXT to position a pie slice label in the center of the
arc and just beyond the arc itself, as shown in Figure 25.5 on page 619.
First, use the PIE function to draw the pie slice:
data pielabel;
retain xsys ysys ’3’;
length function style $ 8;
function=’pie’; size=20; x=30; y=30;
style=’empty’; rotate=45; output;
Then use the PIEXY function to calculate a point outside of the arc as shown in
Figure 25.3 on page 618.
/* find a point that is half of the arc (rotate*.5) */
/* and is 4 units beyond the radius (size=1.1) */
function=’piexy’; angle=rotate*.5; size=1.1; output;
At this point, the XLAST and YLAST variables contain the coordinates of the point
that is calculated by PIEXY. However, (XLAST, YLAST) cannot be used directly by text
functions. Use CNTL2TXT to copy the coordinates in (XLAST, YLAST) to the XLSTT
and YLSTT variables, which text functions can use. Figure 25.4 on page 618 shows the
results.
function=’cntl2txt’; output;
Now you can use the LABEL function to write the label as shown in Figure 25.5 on
page 619. Specify missing values for the X and Y variables to force LABEL to use the
XLSTT and YLSTT variables instead of the X and Y variables.
/* write the label ’Slice 1’ and position it to */
/* the right of the point stored in XLSTT and YLSTT */
function=’label’; text=’Slice 1’; angle=0; rotate=0;
position=’6’; style=’swissb’; size=4; x=.; y=.;
output;
run;
COMMENT Function
Inserts comments within the Annotate data set. The observations generated by the COMMENT
function are ignored when the data set is processed.
Syntax
FUNCTION=’COMMENT’;
Associated Variables
TEXT=’text-string’
specifies the comment to write to the data set.
620 DEBUG Function Chapter 25
DEBUG Function
Writes the values of internal coordinates and Annotate variables to the SAS log before and after
processing the next command (unless it is DEBUG) in the Annotate DATA step.
Syntax
FUNCTION=’DEBUG’;
DRAW Function
Draws a line in the graphics output from the (XLAST, YLAST) coordinates to the (X, Y) coordinates
specified in the function.
Updates: XLAST, YLAST
Syntax
FUNCTION=’DRAW’;
Associated Variables
COLOR=’color’
specifies the color of the line that is being drawn. Color can be any SAS/GRAPH
color name.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
LINE=1...46
specifies the line type of the line that is being drawn. See “Specifying Line Types”
on page 207 for an illustration of the line types.
SIZE=line-thickness
specifies the thickness of the line that is being drawn. The units depend on the
value of the HSYS variable. For example, if HSYS=’3’, the SIZE variable is in
units of percent of the graphics output area. If HSYS=’4’, the SIZE variable is in
units of cells of the graphics output area.
As the thickness of the line increases, it may be impossible to center around a
given coordinate. For example, if you specify a thickness of value 2 and HSYS=’4’,
Annotate Dictionary DRAW2TXT Function 621
the first line is drawn at the (X, Y) coordinates. The second is drawn slightly
above the first. The exact amount varies by device, but it is always one pixel in
width. A thickness of value 3 produces one line above, one line at, and one line
below the (X, Y) coordinate position. See Figure 25.6 on page 621 for examples of
line thicknesses.
Figure 25.6 Sample Line Thicknesses Used with the SIZE Variable
1 2 3
WHEN=’B’ | ’A’
specifies when to draw the line in relation to other procedure output. See “WHEN
Variable” on page 666.
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify the endpoint of a line drawn from (XLAST, YLAST) to (X,Y).
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. The XC variable can be
used only with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. The YC variable can be
used only with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable (PROC G3D only). See “ZSYS
Variable” on page 676 for an explanation of coordinate-system.
DRAW2TXT Function
Draws a line from (XLAST, YLAST) to (XLSTT, YLSTT) without updating any of those variables.
Syntax
FUNCTION=’DRAW2TXT’;
622 FRAME Function Chapter 25
Associated Variables
COLOR=’color’
specifies the line color. Color can be any SAS/GRAPH color name.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
LINE=1...46
specifies the line type of the line that is being drawn. See “Specifying Line Types”
on page 207 for an illustration of the line types.
SIZE=line-thickness
specifies the thickness of the line that is being drawn. See “DRAW Function” on
page 620 for details.
WHEN=’B’ | ’A’
specifies when to draw the line in relation to generation of the procedure output.
See “WHEN Variable” on page 666.
Details
DRAW2TXT is useful for underlining text.
DRAW2TXT does not update the (XLAST, YLAST) or (XLSTT, YLSTT) coordinates;
neither can it interrupt a POLYCONT sequence.
FRAME Function
Draws a border around the portion of the display area defined by the XSYS and YSYS variables.
Optionally specifies a background color for the framed area.
Syntax
FUNCTION=’FRAME’;
Note: The FRAME function is not supported for client-side annotate with Java. 4
Associated Variables
COLOR=’color’
specifies the frame color and, if the STYLE variable is specified, fills the interior of
the frame. Color can be any SAS/GRAPH color name.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
Note: The HSYS variable is not supported for client-side output with ActiveX. 4
HTML=’link-string’
specifies the text that defines the link for drill-down.
Annotate Dictionary FRAME Function 623
LINE=1...46
specifies the line type with which to draw the frame. See “Specifying Line Types”
on page 207for an illustration of the line types.
SIZE=line-thickness
specifies the thickness of the line with which to draw the frame. See “DRAW
Function” on page 620 for details.
Note: The SIZE variable is not supported for client-side output with ActiveX. 4
STYLE=’fill-pattern’
specifies the pattern that fills the area that is bounded by the frame. Fill-pattern
can be the following bar and block patterns:
SOLID a solid fill.
S
EMPTY an empty fill.
E
style<density> a shaded pattern:
style can be R | X | L
density can be 1...5
See also the discussion of fill patterns for bars and blocks in VALUE= on page
171.
WHEN=’B’ | ’A’
specifies when to draw the frame in relation to other procedure output. See
“WHEN Variable” on page 666
XSYS=’coordinate-system’
YSYS=’coordinate-system’
define the area to be enclosed by the frame. For example, if XSYS=’1’ and
YSYS=’1’, the frame encloses the axis area as shown in Figure 25.7 on page 623.
See “XSYS Variable” on page 670 and the YSYS variable on “YSYS Variable” on
page 674 for an explanation of coordinate-system.
frame when
XSYS = '1' and YSYS = '1'
graphics
output
area
624 FRAME Function Chapter 25
If XSYS=’3’ and YSYS=’3’, the frame encloses the entire graphics output area, as
shown in Figure 25.8 on page 624.
Y
graphics
output area
and frame
when XSYX = '3'
and YSYS = '3'
The values for XSYS and YSYS do not have to be the same. If XSYS=’3’ and YSYS=’5’,
the frame encloses the entire width of the graphics output area; however, vertically, the
frame only encloses the procedure output area as shown in Figure 25.9 on page 624.
graphics
TITLE 1 output
TITLE 2 area
frame when
XSYS = '3'
and YSYS = '5'
FOOTNOTE
See “XSYS Variable” on page 670 and “YSYS Variable” on page 674 for an
explanation of these variables and the areas that they affect.
Details
Use FRAME to simulate the CBACK= graphics option on devices (such as plotters) that
do not support that option. For devices that do support the CBACK= graphics option,
FRAME works in addition to that option. FRAME does not alter the (XLAST, YLAST)
coordinates. See “CBACK” on page 266 for more information on CBACK=.
Annotate Dictionary IMAGE Function 625
IMAGE Function
Displays an image in the graphics output from the current (X,Y) coordinates to the (X, Y)
coordinates that are associated with the IMGPATH variable.
Syntax
FUNCTION=’IMAGE’;
Associated Variables
HTML=’link-string’
specifies the text that defines the link for drill-down.
IMGPATH=fileref | ’external-file’
specifies the image file to be displayed in the graphics output. The syntax of
external file specifications varies across operating environments.
X=horizontal-coordinate;
specifies the horizontal coordinate that determines the size of the image displayed
in the graphics output.
Y=vertical-coordinate;
specifies the vertical coordinate that determines the size of the image displayed in
the graphics output.
Z=depth-coordinate;
specifies the depth coordinate for 3D output.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
The following example shows how the IMAGE function adds a single stretched instance
of an image to the graphics output, beginning at the current coordinates and ending at
the specified coordinates:
x=10; y=5; function=’move’ output;
x=35; y=15; imgpath=’/images/gifs/picture.gif’;
style=’fit’;
function=’image’; output;
626 LABEL Function Chapter 25
LABEL Function
Places text in the graphics output. Associated variables can control the color, size, font, base
angle, and rotation of the characters displayed.
Updates: XLSTT, YLSTT
Syntax
FUNCTION=’LABEL’;
Associated Variables
ANGLE=0...360
specifies the baseline angle of the character string with respect to the horizontal.
The pivot point is at (X, Y), and the rotation is in a counterclockwise direction.
CBORDER=’color’ | ’CTEXT’
draws a colored border around the text. Color can be any SAS/GRAPH color name.
CBOX=’color’ | ’CBACK
draws a solid, colored box behind the text. Color can be any SAS/GRAPH color
name.
COLOR=’color’
specifies the color of the text. Color can be any SAS/GRAPH color name.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
HTML=’link-string’
specifies the text that defines the link for drill-down.
POSITION=’text-position’ | ’0’
controls the text string placement and alignment. Text-position can be one of the
characters 1 through 9, A through F, <, +, or >. Invalid or missing values default
to POSITION=’5’. POSITION should always be a character variable of length 1.
For details, see “POSITION Variable” on page 656.
ROTATE=rotation-angle
specifies the rotation angle of each character in the string. It is equivalent to the
ROTATE= option in the FOOTNOTE, NOTE, and TITLE statements.
SIZE=height
specifies the height of the text string. The SIZE variable units are based on the
value of the HSYS variable.
Annotate Dictionary MOVE Function 627
MOVE Function
Moves the drawing pointer to a specific location without drawing a line.
Updates: XLAST, YLAST
Syntax
FUNCTION=’MOVE’;
Associated Variables
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
628 PIE Function Chapter 25
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
WHEN=’B’ | ’A’
specifies when to perform the move in relation to other procedure output. See also
“WHEN Variable” on page 666.
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify the coordinates to which the pen is to be moved. The Z variable can only be
used with the G3D procedure.
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. Use the XC variable only
with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. Use the YC variable only
with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
Use MOVE to prepare for a DRAW command, a BAR command, or programming
functions.
PIE Function
Draws pie slices in the graphics output.
Updates: XLAST, YLAST to coordinates for center of the slice.
Syntax
FUNCTION=’PIE’;
Associated Variables
ANGLE=starting-angle
specifies the starting angle of the slice arc. The default is 0.00 (horizontal) if the
ANGLE variable is not specified for the first slice. After the first slice, the default
is the ending angle of the slice arc just drawn if ANGLE=. (missing). Therefore,
you can specify consecutive pie slices more easily by omitting the start and end
calculations that are otherwise required. If you want the next slice to start at an
Annotate Dictionary PIE Function 629
angle that is different from the ending angle of the previous slice, you must specify
a value for the ANGLE variable.
COLOR=’color’
specifies the color of the pie slice, if a pattern is specified in the STYLE variable.
If you specify STYLE=’EMPTY’, the COLOR variable also specifies the outline
color of the pie slices. Color can be any SAS/GRAPH color name.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
HTML=’link-string’
specifies the text that defines the link for drill-down.
LINE=0...3
specifies which slice line (or lines) to draw. See Figure 25.10 on page 629 for line
values and their actions. LINE=0 draws only the outside of the arc and enables
you to draw a circle.
ROTATE=rotation-angle
specifies the angle of rotation or the delta angle of the slice arc. The default is 0.00.
For example, if you specify these statements, the slice arc that is drawn begins
at 90 degrees (vertical) and ends at 135 degrees (90+45):
function=’pie’; angle=90; rotate=45; output;
The ANGLE variable is internally updated to the end value, 135 degrees. The
value is modified only internally. If a second PIE is used and the ANGLE variable
contains a missing value, the start angle is assumed to be the previous end, or 135
degrees. The arc continues from that point.
If you specify the previous statements and then specify these statements, the
slice begins at 135 degrees (the end angle from the previous slice) and extends
another 45 degrees to the end point, 180 degrees.
function=’pie’; angle=.; rotate=45; output;
STYLE=’fill-pattern’
specifies the value of the pattern that fills the pie slices. Fill-pattern can be the
following pie patterns:
PSOLID a solid fill.
PS
PEMPTY an empty fill.
PE
Pdensity<style<angle>> a shaded pattern:
density can be 1...5
style can be X | N
angle can be 0...360
See Also
“CNTL2TXT Function” on page 617
PIECNTR Function
Sets new center and radius values for later use by the PIEXY function but does not draw an arc.
Annotate Dictionary PIEXY Function 631
Syntax
FUNCTION=’PIECNTR’;
Associated Variables
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
SIZE=radius
specifies the new radius of the pie slice. The new radius is used by a subsequent
PIEXY function. The HSYS variable determines the SIZE variable units.
WHEN=’B’ | ’A’
specifies when to draw the pie slice in relation to other procedure output. See
“WHEN Variable” on page 666
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
define the center and radius of the slice. All slices are referenced from that center.
Use the Z variable only with the G3D procedure.
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. Use the XC variable only
with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. Use the YC variable only
with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
PIEXY Function
Calculates a point on the outline of the slice arc.
Updates: XLAST, YLAST
632 PIEXY Function Chapter 25
Syntax
FUNCTION=’PIEXY’;
Associated Variables
ANGLE=rotation-angle
specifies the angle of rotation when moving around the perimeter of a pie. The
ANGLE variable determines the angle at which the point is located relative to 0
(the three o’clock position). The default is 0.00.
SIZE=radius-multiplier
determines the distance from the center of the slice to the point that is being
calculated. The point’s distance is the current value of the SIZE variable
multiplied by the radius (that is, the SIZE variable) of the previously drawn slice.
To position a graphics element inside the pie slice, set the SIZE variable to less
than 1; to position it outside of the pie slice, set the SIZE variable to greater than
1. For example, if you specify these statements, the point calculated is 1.1 times
the radius (where the radius is taken from the SIZE variable that is used with the
previous FUNCTION=’PIE’ or FUNCTION=’PIECNTR’ observation).
function=’piexy’; size=1.1; output;
WHEN=’B’ | ’A’
specifies when to update the internal coordinate pair (XLAST, YLAST) in relation
to other procedure output. See“WHEN Variable” on page 666.
Details
PIEXY does not draw anything but places the calculated coordinates of the point in the
internal coordinate pair (XLAST, YLAST). Then you can use XLAST and YLAST with
other functions to perform other graphics actions, such as labeling pie slices. If you
need to use the calculated position for a text function, use the SWAP or CNTL2TXT to
put (XLAST, YLAST) into (XLSTT, YLSTT).
PIEXY assumes that a pie slice has been drawn or that FUNCTION=’PIECNTR’ has
been used. Erroneous results can occur if a slice has not been drawn and PIEXY is
invoked.
Figure 25.11 on page 632 shows a pie slice that is drawn with the PIE function.
Figure 25.12 on page 633 shows a point beyond the arc that was calculated using the
PIEXY function.
See Also
“CNTL2TXT Function” on page 617
POINT Function
Places a single point at the (X, Y) coordinates in the color you specify. The point is one visible
pixel in size.
Updates: XLAST, YLAST
Syntax
FUNCTION=’POINT’;
Associated Variables
COLOR=’color’
specifies the color of the point to be drawn. Color can be any SAS/GRAPH color
name.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates when used with HBAR and VBAR charts from the GCHART
procedure. Use these variables only with the data coordinate systems 1, 2, 7, and 8.
WHEN=’B’ | ’A’
specifies when to draw the point in relation to other procedure output. See
“WHEN Variable” on page 666
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify the coordinates of the point that is to be drawn. Use the Z variable only
with the G3D procedure.
634 POLY Function Chapter 25
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. Use the XC variable only
with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. Use the YC variable only
with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
POLY Function
Specifies the beginning point of a polygon. Associated variables can define the fill pattern and
color, as well as the line type that outlines the polygon.
Syntax
FUNCTION=’POLY’;
Associated Variables
COLOR=’color’
specifies the color of the interior of the polygon, if a pattern is specified for the
STYLE variable. The outline color is specified with the POLYCONT function.
Color can be any SAS/GRAPH color name.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with data coordinate systems 1, 2, 7, and 8.
HTML=’link-string’
specifies the text that defines the link for drill-down.
LINE=1...46
specifies the line type that outlines the polygon. See “Specifying Line Types” on
page 207 for an illustration of the line types.
SIZE=thickness
specifies a line thickness for the polygon
STYLE=’fill-pattern’
specifies the value of the pattern that fills the polygon. Fill-pattern can be the
following map patterns:
MSOLID a solid pattern
MS
MEMPTY an empty pattern
ME
Annotate Dictionary POLYCONT Function 635
For example, if STYLE=’MSOLID’ for the POLY function, the fill area that is
drawn by the POLYCONT sequence uses a solid fill. If STYLE=’M5N15’, the fill
area uses a shaded fill of parallel lines. The fill-pattern value M5N15 specifies that
the lines use the heaviest density, are parallel, and are drawn at a 15-degree angle
from the horizontal. See also the discussion of fill patterns for maps in VALUE=
on page 173.
WHEN=’B’ | ’A’
specifies when to begin the polygon in relation to other procedure output. See
“WHEN Variable” on page 666
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify the initial point of the polygon that is being created. Use the Z variable
only with the G3D procedure.
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. Use the XC variable only
with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. Use the YC variable only
with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
Use POLY with POLYCONT to define and fill areas in the graphics output. POLY and
POLYCONT do not update the (XLAST, YLAST) coordinates.
See Also
“POLYCONT Function” on page 635
POLYCONT Function
Continues drawing a polygon begun with the POLY function. POLYCONT specifies each successive
point in the polygon definition.
636 POLYCONT Function Chapter 25
Syntax
FUNCTION=’POLYCONT’;
Associated Variables
COLOR=’color’
specifies the polygon outline color. Color can be any SAS/GRAPH color name. You
can specify an outline color only with the first POLYCONT command in the
sequence; all subsequent POLYCONT commands ignore the COLOR variable. If
you do not specify a color, the POLYCONT function uses the interior color that was
specified with the POLY function.
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
WHEN=’B’ | ’A’
specifies when to draw the polygon in relation to other procedure output. See
“WHEN Variable” on page 666
X=horizontal-coordinate
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify a point on the outline of the polygon that is being created. Use the Z
variable only with the G3D procedure.
XSYS=’coordinate-system’
specifies the coordinate system for the X and XC variable. Use the XC variable
only with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y and YC variable. Use the YC variable
only with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
The polygon definition is terminated by a new POLY command or by any of these
functions:
BAR
DRAW
DRAW2TXT
FRAME
Annotate Dictionary POLYCONT Function 637
LABEL
MOVE
PIE
PIECNTR
PIEXY
POINT
SYMBOL
Use POLY and POLYCONT together to draw a polygon. The (X, Y) observation from
the POLY function and the last (X, Y) observation from POLYCONT are assumed to
connect. Thus, you are not required to respecify the first point. For example, these
statements draw a pentagon like the one in Figure 25.13 on page 638:
data house;
retain xsys ysys ’3’;
length function $ 8;
/* start at the lower left corner */
function=’poly’; x=35; y=25; output;
/* move to the lower right corner */
function=’polycont’; x=65; y=25; output;
/* move to the upper right corner */
function=’polycont’; x=65; y=65; output;
/* move to the center top*/
function=’polycont’; x=50; y=80; output;
/* move to the upper left corner and complete the figure */
function=’polycont’; x=35; y=65; output;
run;
Figure 25.13 Pentagon Produced with the POLY and POLYCONT Functions
(50,80)
Obs. 5 Obs. 4
POLYCONT POLYCONT
(35,65) (65,65)
Obs. 3
POLYCONT
Obs. 1
POLY
Missing values for the X and Y variables that are specified with POLYCONT are
interpreted differently from the way that they are interpreted with the other functions.
Other functions use the missing values to request a default value. POLYCONT
interprets a missing value as a discontinuity (that is, a hole) in the polygon. If you are
not using the data coordinate system and you specify an X or Y value of –999 in a
POLYCONT observation, the default of (XLAST, YLAST) is used. Missing values
indicate holes and are handled identically in the Annotate facility and the GMAP
procedure. See “Displaying Map Areas and Response Data” on page 1005 for more
information on handling missing values.
POP Function
Removes the (XLAST, YLAST) and (XLSTT, YLSTT) values from the LIFO stack and updates the
internal coordinate pairs with the retrieved values.
Updates: (XLAST, YLAST) and (XLSTT, YLSTT)
Syntax
FUNCTION=’POP’;
Annotate Dictionary SWAP Function 639
Details
Use POP when you want to access the values of (XLAST, YLAST) and (XLSTT, YLSTT)
that you most recently stored with the PUSH function. See the PUSH function for a
description of the LIFO stack.
PUSH Function
Adds current (XLAST, YLAST) and (XLSTT, YLSTT) values to the LIFO stack.
Syntax
FUNCTION=’PUSH’;
Details
The LIFO (last-in-first-out) stack is a storage area where you can keep internal
coordinate values for later use by utility functions without recalculating those values.
LIFO stacks manage the stored data so that the last data stored in the stack is the first
data removed from the stack.
Use the stack to save the current values of (XLAST, YLAST) and (XLSTT, YLSTT)
and use them with functions later in the DATA step. You store and retrieve these
values from the stack with the PUSH and POP functions. The PUSH function copies
the current values of XLAST, YLAST, XLSTT, and YLSTT onto the stack. The POP
function copies values from the stack into XLAST, YLAST. XLSTT, and YLSTT.
SWAP Function
Exchanges values of (XLAST, YLAST) with (XLSTT, YLSTT) and vice versa.
Syntax
FUNCTION=’SWAP’;
Details
Use SWAP when you want to use both the (XLAST, YLAST) and (XLSTT, YLSTT)
coordinates for text and nontext functions, respectively.
640 SYMBOL Function Chapter 25
SYMBOL Function
Places symbols in the graphics output. Associated variables can specify the color, font, and height
of the symbols displayed.
Updates: XLSTT, YLSTT
Syntax
FUNCTION=’SYMBOL’;
Associated Variables
CBORDER=’color’ | ’CTEXT’
draws a colored border around the text. Color can be any SAS/GRAPH color name.
CBOX=’color’ | ’CBACK’
draws a solid, colored box behind the text. Color can be any SAS/GRAPH color
name.
COLOR=’color’
specifies the symbol color. Color can be any SAS/GRAPH color name. The COLOR
variable behaves in the same way as the COLOR= option in the SYMBOL
statement. See COLOR= on page 185 for details
GROUP=group-value
MIDPOINT=midpoint-value
SUBGROUP=subgroup-value
specify coordinates for HBAR and VBAR charts from the GCHART procedure. Use
these variables only with the data coordinate systems 1, 2, 7, and 8.
HSYS=’coordinate-system’
specifies the coordinate system for the SIZE variable. See “HSYS Variable” on
page 649 for an explanation of coordinate-system.
HTML=’link-string’
specifies the text that defines the link for drill-down.
SIZE=height
specifies the height of the symbol that is being drawn, using units determined by
the HSYS variable. The SIZE variable is equivalent to the HEIGHT= option in the
SYMBOL statement. See HEIGHT= on page 187 for details.
STYLE=’font’ | "’hardware-font-name’" | ’NONE’;
specifies the font that is used to draw the symbol that is specified by the TEXT
variable. See “STYLE Variable (Fonts)” on page 661 for a description of the
various font specifications.
When the STYLE variable is used with the SYMBOL function, it behaves the
same as the FONT= option in the SYMBOL statement. By default, no font is
specified and the symbol that is specified by the TEXT variable is taken from the
special symbol table. If you use STYLE to specify a symbol font, such as Marker,
the string that is assigned by the TEXT variable is the character code for a
symbol. If you use STYLE to specify a text font, such as Swiss, the string assigned
by the TEXT variable is displayed as text. See FONT= on page 186 for details.
Annotate Dictionary TXT2CNTL Function 641
TEXT=’special-symbol’ | ’text-string’;
specifies the symbol to be displayed. Special-symbol can be up to eight characters
long. Values for special-symbol are those described in the VALUE= option of the
SYMBOL statement and are illustrated in VALUE= on page 199.
For client-side rendering using ActiveX, the following values are supported:
plus, X, star, square, diamond, triangle, dot, circle, ", #, $, %, =. If a symbol is not
supported, a plus sign (+) is drawn instead.
For client-side rendering using Java, the following values are supported: plus,
X, star, square, diamond, triangle, dot (draws a circle), circle, *, +, >. If a symbol is
not supported, a plus sign (+) is drawn instead.
If you also specify a text font with the STYLE variable, you can specify a text
string that is displayed as the symbol. The maximum length for text-string is 200
characters.
When the TEXT variable is used with the SYMBOL function, it behaves the
same as the VALUE= option in the SYMBOL statement. See VALUE= on page 199
for details.
WHEN=’B’ | ’A’
specifies when to draw the symbols in relation to other procedure output. See
“WHEN Variable” on page 666
Y=vertical-coordinate
Z=depth-coordinate (PROC G3D only)
XC=’character-type-horizontal-coordinate’
YC=’character-type-vertical-coordinate’
specify the point at which the symbol is placed. Use the Z variable only with the
G3D procedure.
XSYS=’coordinate-system’
specifies the coordinate system for the X or XC variable. Use the XC variable only
with XSYS=’2’. See “XSYS Variable” on page 670 for an explanation of
coordinate-system.
YSYS=’coordinate-system’
specifies the coordinate system for the Y or YC variable. Use the YC variable only
with YSYS=’2’. See “YSYS Variable” on page 674 for an explanation of
coordinate-system.
ZSYS=’coordinate-system’
specifies the coordinate system for the Z variable. See “ZSYS Variable” on page
676 for an explanation of coordinate-system.
Details
SYMBOL is similar to the LABEL function with these exceptions:
3 SYMBOL draws symbols. If you do not specify a font, SYMBOL can use the
symbols found in Figure 7.21 on page 202.
3 The text cannot be rotated or angled.
3 The text string cannot be longer than eight characters.
3 The text string is always centered with respect to x and y.
TXT2CNTL Function
Copies the values (XLSTT, YLSTT) to (XLAST, YLAST), replacing previous values of (XLAST,
YLAST).
642 Annotate Variables Chapter 25
Syntax
FUNCTION=’TXT2CNTL’;
Details
TXT2CNTL allows nontext functions to use the ending position of a text string as a
starting or ending point.
Annotate Variables
When an Annotate data set is processed, the Annotate facility looks at the values of
specific variables in order to draw graphics. This section describes all of the Annotate
variables in alphabetical order. Not all variables are used with all functions. Refer to
the description of the individual functions in “Annotate Functions” on page 615 for more
information about how each variable is used with each function. For a summary of
Annotate variables and their uses, see Table 24.1 on page 591.
ANGLE Variable
Specifies the angle at which the graphics output is drawn.
Type: numeric
Default: function dependent
Syntax
ANGLE=0...360;
Functions
The ANGLE variable is function dependent.
Annotate Dictionary CBORDER Variable 643
LABEL the baseline angle of the character string with respect to the horizontal. With
the LABEL function, the pivot point is at (X,Y) and the direction of rotation is
counterclockwise. The default value is 0.
PIE the starting angle of the slice arc, measured counterclockwise. The default for
the first PIE function is ANGLE=0 (horizontal, or 3:00 postion), or is the
ending point of the arc of the previous slice. Specify a value for the ANGLE
variable if you want the next slice to start at an angle that is different from
the edge of the previous slice, or if you want the first slice to start at an angle
other than horizontal.
PIEXY the angle that works with the SIZE variable to establish the new XLAST,
YLAST point relative to the last pie element established with the PIE or
PIECNTR functions. The angle is measured counterclockwise starting at the
3:00 position. The default value is 0.
CBORDER Variable
Draws a colored border around text or symbols.
Type: character
Length: 8 for color codes and up to 64 for color names
See also: CBOX
Syntax
CBORDER=’color’ | ’CTEXT’;
color
specifies the color that fills the box. The color value can be any SAS/GRAPH color
name. See Chapter 6, “SAS/GRAPH Colors and Images,” on page 91 for more
information about specifying colors.
Specifying a null value for the color value (CBOX=’ ’)cancels the CBOX variable.
CTEXT
draws the border in the same coloras the text or symbol. The text color is determined
by (1) the COLOR variable or (2) the CTEXT=graphics option or (3) the first color in
the colors list.
Functions
You can use the CBORDER variable with these functions:
LABEL
SYMBOL
644 CBOX Variable Chapter 25
Details
Once you have specified CBORDER, it remains in effect for all subsequent observations
that use the LABEL or SYMBOL function and draws a border around all text or
symbols. To turn off the border for subsequent text or symbols, specify CBORDER=’ ’.
To fill the area defined by CBORDER, use the CBOX variable in conjunction with
CBORDER.
CBOX Variable
Draws a solid box behind the text or symbol and fills the box with the specified color.
Type: character
Length: 8 for color codes and up to 64 for color names
See also: CBORDER
Syntax
CBOX=’color’ | ’CBACK’;
color
specifies the color that fills the box. Color is any SAS/GRAPH color name. See
Chapter 6, “SAS/GRAPH Colors and Images,” on page 91 for more information about
specifying colors.
Specifying a null value for color (CBOX=’ ’)cancels the CBOX variable.
CBACK
fills the box with the same color as the background color of the graph. The
background color is either (1) the color specified by the CBACK= graphics option or
(2) the default background color for the device.
Functions
You can use the CBOX variable with these functions:
LABEL
SYMBOL
Details
Once you have specified CBOX, it remains in effect for all subsequent observations that
use the LABEL or SYMBOL function.
The color of the text or symbol within the box is controlled by the COLOR variable.
By default, the solid box has no border. To add a colored border to the box, use the
CBORDER variable in conjunction with CBOX.
Annotate Dictionary COLOR Variable 645
COLOR Variable
Specifies the color used by the function.
Type: character
Length: 8 for color codes and up to 64 for color names
Default:
1 first color in colors list of the COLORS= graphics option
2 first color in device’s default colors list.
Syntax
COLOR=’color’;
color
specifies any SAS/GRAPH color name. See Chapter 6, “SAS/GRAPH Colors and
Images,” on page 91 for more information about specifying colors.
Functions
The COLOR variable is function dependent.
FUNCTION Variable
Specifies a graphics command or programming function for the Annotate facility to perform.
Type: character
Length: 8
Default: LABEL
Syntax
FUNCTION=’function-name’;
function-name
specifies the name of an Annotate function. The function-name value can be any of
the following.
BAR draws and, optionally, fills a rectangle.
CNTL2TXT, copies (XLAST, YLAST) to (XLSTT, YLSTT), overwriting the
DRAW2TXT previous values of (XLSTT, YLSTT).
COMMENT places comments in your data set. The observation is ignored
when the data set is processed.
DEBUG writes the values of all Annotate variables to the SAS log before
and after the next observation.
DRAW draws a line in the graphics output.
FRAME draws a border around the area defined by XSYS and YSYS and
specifies a background color for the framed area .
IMAGE displays an image in the graphics output from the current (X,Y)
coordinates to the coordinates that are associated with the
IMGPATH variable.
LABEL draws text and is the default for the FUNCTION variable.
MOVE moves to the specified point (does not draw a line).
PIE draws a pie slice, arc, or circle that can be filled.
PIECNTR sets new center and radius values. The PIEXY function can use
this information in a later observation.
PIEXY returns the coordinates of a point on a pie slice. Other functions
can use this information in a later observation.
POINT draws a point.
POLY begins drawing a polygon (first vertex). Use the POLYCONT
function in successive observations to supply the remaining
vertices.
POLYCONT continues drawing a polygon.
POP gets values from the LIFO stack and changes the current value of
(XLAST, YLAST) and (XLSTT, YLSTT) to those values.
Annotate Dictionary GROUP Variable 647
PUSH puts the current values for (XLAST, YLAST) and (XLSTT, YLSTT)
in the LIFO stack.
SWAP exchanges the values of (XLAST, YLAST) and (XLSTT, YLSTT).
SYMBOL draws a symbol. See Figure 7.21 on page 202 for a list of the
symbols.
TXT2CNTL copies the values (XLSTT, YLSTT) to (XLAST, YLAST),
overwriting the previous values of (XLAST, YLAST).
All other variables in the observation that contain the function act as parameters
for the action. For a detailed description of each function and the Annotate variables
that can be used in conjunction with it, see “Annotate Functions” on page 615.
GROUP Variable
Positions graphics elements on the bars of a vertical or horizontal bar chart drawn using the
GROUP= option in the GCHART procedure.
Numeric or character; must match the type of the GROUP= variable used in the
Type:
GCHART procedure.
Length: Should match the length of GROUP= variable in the GCHART procedure.
Default: none
Restriction: Used only with vertical or horizontal bar charts produced by the GCHART
procedure.
Syntax
GROUP=group-value;
group-value
references value(s) of the variable that is identified by the GROUP= option in the
GCHART procedure either as a variable name or as an explicit data value.
Group-value can be one of the following:
group-variable the name of a group variable.
group-data- a specific numeric data value.
value
’group-data- a specific character data value.
value’
To annotate all the bars in a horizontal or vertical bar chart, specify a variable
name. To annotate a bar chart for a specific value of the GROUP variable, specify a
specific value.
648 GROUP Variable Chapter 25
Functions
You can use the GROUP variable only with the data coordinate systems 1, 2, 7, and 8,
and with these functions:
BAR
DRAW
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
Using the GROUP variable is similar to using the X and Y variables with data system
coordinates to position graphics elements in a vertical or horizontal bar chart.
Figure 25.14 on page 649 shows how the GROUP variable works with the
SUBGROUP and MIDPOINT variables to label the bars of a vertical bar chart.
Annotate Dictionary HSYS Variable 649
Figure 25.14 Using the GROUP Variable to Position a Label in a Bar Chart
The label showing the number of units that were sold in Dallas in the year 1997 is
positioned by the values that are assigned to these Annotate variables:
3 GROUP=YEAR (where YEAR is a variable in the GCHART data set)
3 MIDPOINT=CITY (where CITY is a variable in the GCHART data set)
3 SUBGROUP=ITEM (where ITEM is a variable in the GCHART data set).
HSYS Variable
Defines the coordinate system and area of the output used by the SIZE variable to display the
Annotate graphics. Additionally, you can use the HSYS variable with client-side annotation with
Java or ActiveX to control the markersize and linesize for the BAR, DRAW, DRAW2TXT, POLY, and
SYMBOL functions.
Type: character
Length: 1
650 HSYS Variable Chapter 25
Default: 4
Syntax
HSYS=’coordinate-system’;
coordinate-system
specifies a value that represents a coordinate system. Values can be 1 through 9 and
A through C as shown in the following table:
Absolute Relative
Systems Systems Coordinate System Units
These values are also used by the XSYS and YSYS variables. See “Coordinate
Systems” on page 596 for a description of the areas and coordinate systems.
Functions
You can use HSYS with these functions, all of which also use the SIZE variable:
DRAW
DRAW2TXT
FRAME
LABEL
PIE
PIECNTR
SYMBOL
Details
The coordinate system that you specify with the HSYS variable affects how the function
interprets the value of the SIZE variable. For example, if you use HSYS=’3’ and
SIZE=10 with the DRAW function, the thickness of the line is 10 percent of the graphics
output area. If you use HSYS=’1’ and SIZE=10 with DRAW, the thickness of the line is
10 percent of the data area.
Annotate Dictionary HTML Variable 651
HTML Variable
Defines a link in the HTML file created for a drill-down graph. This link is associated with an area
of the graph and contains valid HTML syntax that can point to a report or another graph that you
want to display when the user drills down on the area.
Type: character
Length: up to 1024
Default: none
Syntax
HTML=’link-string’;
link-string
specifies the text that defines the link for drill-down. For more information about
drill-down graphs and how to specify the link string, see “Adding Links with the
HTML= and HTML_LEGEND= Options” on page 574.
Functions
You can use the HTML variable with these functions:
BAR
FRAME
IMAGE
LABEL
PIE
POLY
SYMBOL
Details
Use a LENGTH statement to set the length of the HTML variable to the longest string
you need for the link string. Be sure to set the HTML value to a null if you continue
writing observations to the annotate data set after you are done assigning links. For
example, the following code defines link information for two squares, but then sets the
HTML variable to null when drawing a frame; otherwise the backgound area within the
frame will use the link information from the last defined HTML value and become a hot
zone in the graph.
data squares;
length function style color $ 8
html text $ 15;
xsys=’3’; ysys=’3’;
html=’href=green.gif’; output;
IMGPATH Variable
Specifies an image to be displayed from the current (X,Y) coordinates to the (X,Y) coordinates that
are associated with this variable.
Type: character
Length: 255
Syntax
IMGPATH = fileref | ’external-file’;
fileref
specifies an existing fileref that points to an external image file.
external-file
specifies the full path or full file name of an external image file. The format of the
external file specification varies between operating envirionments.
Details
The IMGPATH variable can be used only with the “IMAGE Function” on page 625.
The manner in which the specified image is to be displayed is determined by the
“STYLE Variable (Images)” on page 662.
LINE Variable
Controls the drawing of a line by determining either the type of line to draw or the relative
position of the line.
Type: numeric
Default for all functions: 1
Annotate Dictionary LINE Variable 653
Syntax
LINE=line-type;
Functions
The behavior and syntax of the LINE variable is function-dependent.
BAR
In the BAR function, valid values for the LINE variable can be 0, 1, 2, or 3. These
values determine how the outline of the bar is to be drawn, as shown in the
following figure.A value of 0 draws the outline all the way around the bar. A value
of 1 draws the outline only on the vertical sides of the bar. A value of 2 draws the
outline only on the horizontal sides of the bar. A value of 3 draws no outline.
MIDPOINT Variable
Positions graphics elements on the bars of a vertical or horizontal bar chart drawn by the GCHART
procedure.
Type: Numeric or character; must match the type of the MIDPOINT= variable in the
GCHART procedure.
Length: Should match the length of the MIDPOINT= variable in the GCHART
procedure.
Default: none
Restriction: Used only with vertical or horizontal bar charts produced by the GCHART
procedure.
Syntax
MIDPOINT=midpoint-value;
midpoint-value
references midpoint data value(s) in the GCHART procedure either as a variable
name or as an explicit data value. Midpoint-value can have one of the following
forms:
midpoint- the name of a midpoint variable.
variable
midpoint-data- a specific numeric data value.
value
’midpoint-data- a specific character data value.
value’
Generally, specify a variable name if you want to annotate all of the bars in a
horizontal or vertical bar chart. To annotate a bar chart for a specific value of the
MIDPOINT variable, specify a specific value.
Functions
You can use the MIDPOINT variable only with the data coordinate systems 1, 2, 7, and
8, and with these functions:
BAR
DRAW
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Annotate Dictionary MIDPOINT Variable 655
Details
Using the MIDPOINT variable is similar to using the X and Y variables to position
graphics elements in a vertical or horizontal bar chart when using data system
coordinates. For example, suppose you produce a vertical bar chart in which the chart
variable CITY produces a bar for each city in a data set. The height of each bar is
determined by the value of the SUMVAR= variable, UNITS.
You can label these bars by assigning the chart variable CITY to the Annotate
MIDPOINT variable. The MIDPOINT variable provides the x coordinate for the label.
By default, Annotate assigns the statistic variable, in this case the SUMVAR= variable,
UNITS, to the Annotate Y variable, which provides the y coordinate for the label.
Figure 25.17 on page 655 shows how the values of the MIDPOINT and Y variables
position the label that shows the number of units sold in Atlanta. The value, which is
calculated and printed by the LABEL function, is 56.
Figure 25.17 Using the MIDPOINT Variable to Position a Label in a Bar Chart
Y➛UNITS100
MIDPOINT=Atlanta
Y=56
MIDPOINT=Chicago
56 Y=UNITS/2
The labels in this figure are positioned by the values that are assigned to these
Annotate variables:
3 MIDPOINT=CITY (where CITY is the chart variable); the MIDPOINT variable
provides the horizontal coordinate in the vertical bar chart.
3 Y=UNITS (where UNITS is the SUMVAR= variable); the Y variable provides the
vertical coordinate. By specifying Y=units/2, you can vertically center the label in
the bar.
Note: In a horizontal bar chart, the MIDPOINT variable controls the y coordinate
and the statistic variable controls the x coordinate. 4
CAUTION:
Be careful when using MIDPOINT and X and Y variables in the same data set. Using the
MIDPOINT and X variables in an Annotate data set that is used to annotate a VBAR
chart or the MIDPOINT and Y variables in the same data set used to annotate an
HBAR chart can cause unexpected results. When annotating a VBAR chart, the
656 POSITION Variable Chapter 25
POSITION Variable
Controls placement and alignment of a text string specified by the LABEL function.
Type: character
Length: 1
Default: 5
Syntax
POSITION=’text-position’ | ’0’;
text-position
specifies the placement of the text string in relation to the position that is defined by
the X and Y variables. Text-position can be one of the characters 1 through 9, A
through F, <, +, or >. These characters represent the positions that are described in
the following table:
Details
Stacking text strings To stack text strings, specify a different position value of each
string. Figure 25.18 on page 657 shows two ways to stack text.
POSITION='2'
POSITION='B'
POSITION='5'
POSITION='E'
POSITION='8'
Positioning numeric labels The <, +, and > positions perform the same function as 4,
5, and 6, respectively, but are recommended only for labels that are numbers. The <, +,
and > positions are especially useful when you are labeling a horizontal bar chart. You
can use <, +, or > if the numbers in your font are significantly smaller than the text and
you are having trouble centering labels. If the numbers in your font are the same
height or close to the same height as the text, you can use positions 4, 5, and 6 to center
the labels.
Note: You cannot stack <, +, and > positions as you can 4, 5, and 6 positions. 4
658 POSITION Variable Chapter 25
Changing attributes in the middle of a text string 0 is a special value to use when you
want to pause and then continue a text string. With this value you can change colors,
fonts, and so on in the middle of a line, while retaining the exact position of the text at
Annotate Dictionary ROTATE Variable 659
the pause. When POSITION=’0’, the combined text string is left-justified beginning at
the point that is defined by the X and Y variables. However, you must define missing
values for X for the continuation string. The following Annotate data set changes the
font in the middle of the string. The result is shown in Figure 25.20 on page 659.
data anno;
length style $ 8 text $ 12;
xsys=’3’; ysys=’3’; hsys=’3’; x=5; y=50;
style=’swissb’; size=10; text=’This is the’;
position=’0’; output;
x=.; style=’swissbi’; text=’ ITALIC font’;
output;
run;
ROTATE Variable
Specifies the angle at which to rotate the graphics element.
Type: numeric
Default: 0.00
Syntax
ROTATE=rotation-angle;
Functions
The ROTATE variable is function dependent.
660 SIZE Variable Chapter 25
PIE specifies the sweep of the generated arc that begins at the angle that is
specified by the ANGLE variable that is used with the PIE function.
LABEL rotates the individual text characters with respect to the baseline.
SIZE Variable
Determines the size of the graphics element with which it is used.
Type: numeric
Length: 8
Default: 1.00 (2 when HSYS=3)
Syntax
SIZE=size-factor;
Functions
The SIZE variable is function dependent.
Details
The SIZE variable uses the coordinate system that is specified by the “HSYS Variable”
on page 649, which specifies the type of coordinate system used to generate the graph.
As the thickness of the line increases, it may be impossible to center around a given
coordinate. For example, if you specify a thickness of value 2 and HSYS=’4’, the first
line is drawn at the (X, Y) coordinates. The second is drawn slightly above the first. The
exact amount varies by device, but it is always one pixel in width. A thickness of value
3 produces one line above, one line at, and one line below the (X, Y) coordinate position.
Annotate Dictionary STYLE Variable (Fonts) 661
The SIZE variable is equivalent to the HEIGHT= option in the SYMBOL statement.
See HEIGHT= on page 187 for details.
See Figure 25.6 on page 621 for examples of line thicknesses.
Figure 25.21 Sample Line Thicknesses Used with the SIZE Variable
1 2 3
Syntax
STYLE=’font’ | “’hardware-font-name’” | ’NONE’;
font
specifies a font. Font can be either the name of a software font that is stored in a
catalog or a hardware font specification of the form HWxxxnnn. For example,
STYLE=’CENTB’ specifies a software font that is stored in the catalog
SASHELP.FONTS. The maximum length for font is 8 characters.
hardware-font-name
specifies the name of a hardware font as shown in the Chartype window of the device
entry. The maximum length for hardware-font-name is 256 characters.
Hardware-font-name must be enclosed in both double and single quotation marks, for
example, STYLE="’Palatino-Italic’".
NONE
specifies the default hardware font.
If the value of the STYLE variable is missing, SAS/GRAPH software searches for a
font specification in this order:
1 the font specified by the FTEXT= graphics option
2 the hardware font, if the device supports one
3 the SIMULATE font.
Details
When the STYLE variable is used with the SYMBOL function, it behaves the same as
the FONT= option in the SYMBOL statement. By default, no font is specified and the
662 STYLE Variable (Images) Chapter 25
symbol that is specified by the TEXT variable is taken from the special symbol table. If
you use STYLE to specify a symbol font, such as Marker, the string that is assigned by
the TEXT variable is the character code for a symbol. If you use STYLE to specify a
text font, such as Swiss, the string assigned by the TEXT variable is displayed as text.
See the FONT= option of the SYMBOL statement for details.
Note: Java does not support the STYLE variable. However, you can use special
symbols from the MARKER font by using the SYMBOL function. 4
Syntax
STYLE=’TILE’ | ’FIT’;
’TILE’
Uses copies of the image to fill the image area.
’FIT’
Stretches one instance of the image to fill the image area.
Details
This version of the STYLE variable can be used only with the “IMAGE Function” on
page 625.
Syntax
STYLE=’fill-pattern’;
Annotate Dictionary STYLE Variable (Patterns) 663
fill-pattern
specifies a pattern to use with the graphics element. The value for fill-pattern is
function-dependent:
Function
Valid Fill Pattern Values
BAR,FRAME
SOLID | S Fill with a solid color.
EMPTY | E No fill.
style<density> style R for right-slanted fill lines, L for
left-slanted fill lines, or X for crossing fill
lines
density Whole numbers 1 through 5 specify
increasing thickness for the fill lines.
Note: Client-side rendering using Java or ActiveX supports only SOLID and
EMPTY and defaults to EMPTY if any other value is used. 4
An illustration of these pattern styles is provided in the definition of the
VALUE= option of the PATTERN statement.
PIE
PSOLID | PS Solid fill.
PEMPTY | PE No fill, the default.
Pdensity<style<angle>>
density Whole numbers 1 through 5 specify
increasing thickness for the fill lines.
style N, the default, optionally specifies parallel
fill lines; X optionally specifies crossed fill
lines.
angle Optionally specifies the angle of the fill
lines. Values range from 0 to 360. The
angle is measured counterclockwise from
the horizontal. The default is 0, which
draws horizontal lines.
Note: Client-side rendering using Java or ActiveX supports only PSOLID and
PEMPTY and defaults to PEMPTY if any other value is used. 4
An illustration of these pattern styles is provided in the definition of the
VALUE= option of the PATTERN statement.
POLY
MSOLID | MS Fill with a solid color.
MEMPTY | ME No fill, the default.
Mdensity<style<angle>>
density Whole numbers 1 through 5 specify
increasing thickness for the fill lines.
style N, the default, optionally specifies parallel
fill lines; X optionally specifies crossed fill
lines.
angle Optionally specifies the angle of the fill
lines. Values range from 0 to 360. The
angle is measured counterclockwise from
664 SUBGROUP Variable Chapter 25
SUBGROUP Variable
Positions graphics elements within subgrouped bars of a vertical or horizontal bar chart produced
by the GCHART procedure.
Type: Numeric or character; must match the type of the SUBGROUP variable used in
the GCHART procedure.
Length: Should match the length of the SUBGROUP= variable in the GCHART
procedure.
Default: none
Restriction: The bar charts must have been produced using the SUBGROUP= option.
Syntax
SUBGROUP=subgroup-value;
subgroup-value
references value(s) of the SUBGROUP= variable in the GCHART procedure either as
a variable name or as an explicit data value. Subgroup-value can have one of the
following forms:
subgroup- the name of a subgroup variable.
variable
subgroup-data- a specific numeric data value.
value
subgroup-data- a specific character data value.
value
Generally, specify a variable name if you want to annotate all of the bars in a
horizontal or vertical bar chart. To annotate a bar chart for a specific value of the
SUBGROUP variable, specify a specific value.
Functions
You can use the SUBGROUP variable only with the data coordinate system 1, 2, 7, or 8,
and with these functions:
BAR
DRAW
LABEL
Annotate Dictionary SUBGROUP Variable 665
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
Using the SUBGROUP variable is similar to using the X and Y variables with data
system coordinates to position the graphics elements in subgroup segments in vertical
and horizontal bar charts.For example, in a vertical bar chart that produces a bar for
each city in a data set, you can easily label the subgroups in each bar by setting
subgroup-variable to the GCHART variable by which the bar is being subgrouped. This
variable provides the y coordinate of the label (so don’t specify a competing value for y,
but instead specify y=. or y=y).
The MIDPOINT variable works well with the SUBGROUP variable to provide the x
coordinate. In this example, if you set the MIDPOINT variable to the GCHART
variable that contains the names of the cities, the MIDPOINT variable provides your x
coordinate. Rather than providing the X and Y variables, you would use the
SUBGROUP and MIDPOINT variables. Figure 25.22 on page 665 shows how the
SUBGROUP variable works with the MIDPOINT variable to label the bars of a vertical
bar chart.
Figure 25.22 Using the SUBGROUP Variable to Position a Label in a Bar Chart
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
.......................
....................... .......................
.......................
.......................
....................... .......................
.......................
25
.......................
.......................
.......................
.......................
.......................
....................... .......................
.......................
.......................
....................... .......................
....................... .......................
.......................
.......................
....................... .......................
....................... .......................
.......................
.......................
....................... .......................
....................... .......................
.......................
.......................
....................... .......................
....................... .......................
.......................
.......................
....................... .......................
....................... .......................
.......................
.......................
....................... .......................
.......................
.......................
....................... .......................
.......................
.......................
....................... .......................
.......................
....................... .......................
.......................
.......................
The label showing the number of printers sold in Atlanta is positioned by the values
that are assigned to these Annotate variables:
3 MIDPOINT=CITY (where CITY is a variable in the GCHART data set)
666 TEXT Variable Chapter 25
TEXT Variable
Specifies the text or symbol to be placed on the graphics output.
Type: character
Length: up to 200
Default: blank string
Syntax
TEXT=’text-string’ | ’special-symbol’;
text-string
specifies the text that is used as a label (LABEL or COMMENT function) or symbol
(SYMBOL function). The maximum length for text-string is 200 characters.
special-symbol
specifies the name of a symbol from the special symbol table that is illustrated in
Figure 7.21 on page 202. The maximum length for special-symbol is eight characters.
Functions
You can use the TEXT variable with these functions:
COMMENT
LABEL
SYMBOL
Details
Define the TEXT variable with sufficient length to contain all of the characters in your
text string. If you need longer strings, use separate observations and POSITION=’0’ to
continue the text.
Use a LENGTH statement to set the length of the TEXT variable if the length of a
text string is longer than one character.
WHEN Variable
Specifies when the function is performed in relation to generating other graphics output for the
procedure or in relation to generating other Annotate graphics.
Type: character
Length: 1
Default: B
Annotate Dictionary X Variable 667
Syntax
WHEN=’B’ | ’A ;
B|A
specifies whether to draw the annotation before (B) or after (A) the graph. These
values are not case sensitive. A missing value is equivalent to specifying B.
Note: Some annotations coded with WHEN=’B’ that work on the server may not
be visible with client-side rendering using Java or ActiveX because the annotations
are drawn behind the backplane. The only solution is to code WHEN=’A’. 4
Functions
You can use the WHEN variable with these functions:
BAR
DRAW
DRAW2TXT
FRAME
LABEL
MOVE
PIE
PIECNTR
PIEXY
POINT
POLY
POLYCONT
SYMBOL
Details
Normally, observations in an Annotate data set are processed sequentially. If you use
the WHEN variable, all those observations with a WHEN value of B are processed first,
the procedure output is then processed (if one is to be produced), and finally the
observations with a WHEN value of A are processed.
X Variable
Identifies the x coordinate of where a graphics element is to be drawn.
Type: numeric
Default: value of XLAST or XLSTT
668 XC Variable Chapter 25
Syntax
X=horizontal-coordinate;
Functions
You can use the X variable with these functions:
BAR
DRAW
IMAGE
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Note: The X or XC variable is required unless either the MIDPOINT, GROUP, or
SUBGROUP variable provides the horizontal coordinate. 4
Details
Specify a corresponding vertical coordinate when using the X variable. This vertical
coordinate can be specified with the Y, YC, MIDPOINT, or SUBGROUP variables,
depending on the type of graph that you are annotating.
The X variable uses the units that are specified in the XSYS variable. If you use
XSYS=’2’ and the data axis is typed as character, use the XC variable instead of the X
variable.
If the value of the X variable is missing for a function that requires it, the value of
the XLAST variable is used with nontext functions and the value of the XLSTT variable
is used with text functions.
XC Variable
Identifies the x coordinate of a graphics element when the coordinate value is character.
Type: character
Length: Should match that of the plot variable in the procedure.
Default: the value of XLAST or XLSTT
Restrictions: Used only with output from the GCHART and GPLOT procedures. Ignored
if the axes are numeric.
Annotate Dictionary XC Variable 669
Syntax
XC=’character-type-horizontal-coordinate’;
Functions
You can use the XC variable with these functions:
BAR
DRAW
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
The XC variable is the character equivalent of the X variable. Use XC when the axis
values are character. You must also specify a value of 2 (absolute data values) for the
XSYS variable. (See also “XSYS Variable” on page 670.) If you use a value other than 2
for the XSYS variable, the graphics output is not displayed properly.
Figure 25.23 on page 669 illustrates the XC variable.
CAUTION:
Do not use the X and XC variables in the same data set. Using both X and XC variables
in the same data set can cause unpredictable results. 4
XSYS Variable
Defines the coordinate system and area of the output used by the X and XC variables to display
the Annotate graphics.
Type: character
Length: 1
Default: 4
Syntax
XSYS=’coordinate-system’;
coordinate-system
specifies a value that represents a coordinate system. Values can be 1 through 9 and
A through C as shown in the following table:
Absolute Relative
Systems Systems Coordinate System Units
These values are also used by the HSYS and YSYS variables. See “Coordinate
Systems” on page 596 for a description of the areas and coordinate systems.
Functions
You can use the XSYS variable with these functions:
BAR
Annotate Dictionary XSYS Variable 671
DRAW
FRAME
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
The behavior of the XSYS variable is function-dependent for the following functions:.
BAR, DRAW The coordinate system that you specify with the XSYS variable
affects how the function interprets the value of the X or XC variable.
If XC is used, XSYS=’2’ must also be used.
FRAME The XSYS and YSYS variables define the area enclosed by the
frame. To draw a frame that encloses the axis area, use XSYS=’1’
and YSYS=’1’, as shown in the following figure.
frame when
XSYS = '1' and YSYS = '1'
graphics
output
area
Y
graphics
output area
and frame
when XSYX = '3'
and YSYS = '3'
To limit the size of the frame to the size of the procedure output
area, specify a value of 5 for XSYS and YSYS.
Note that the values of XSYS and YSYS can differ. You can
specify a frame that occupies the entire width of the graphics output
area and only the vertical width of the procedure output area by
specifying XSYS=’3’ and YSYS=’5’, as shown in the following figure.
graphics
TITLE 1 output
TITLE 2 area
frame when
XSYS = '3'
and YSYS = '5'
FOOTNOTE
Details
The coordinate system that you specify with the XSYS variable affects how the function
interprets the value of the X or XC variable.
Note: Not all coordinate systems can be used with all Annotate variables. For any
restrictions, see the individual variables in this section. 4
Annotate Dictionary YC Variable 673
Y Variable
Identifies the y coordinate of where a graphics element is to be drawn.
Type: numeric
Default: value of YLAST or YLSTT
Syntax
Y=vertical-coordinate;
Functions
You can use the Y variable with these functions:
BAR
DRAW
IMAGE
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Note: The Y or YC variable is required unless either the MIDPOINT, GROUP, or
SUBGROUP variable provides the vertical coordinate. 4
Details
Specify a corresponding horizontal coordinate when using the Y variable. You can
specify the horizontal coordinate with the X, XC, MIDPOINT, or SUBGROUP variable,
depending on the type of graph you are annotating.
The Y variable uses the units specified in the YSYS variable. If you use YSYS=’2’
and the axis data is type character, use the YC variable instead of the Y variable.
If the value of the Y variable is missing for a function that requires it, the value
YLAST is used for nontext functions and the value of YLSTT is used for text functions.
YC Variable
Identifies the y coordinate of a graphics element when the coordinate value is character.
674 YSYS Variable Chapter 25
Type: character
Length: Should match that of the plot variable in the procedure.
Default: YLAST | YLSTT
Restrictions: Used only with output from the GCHART and GPLOT procedures. Ignored
if the axes are numeric.
Syntax
YC=’character-type-vertical-coordinate’;
Functions
You can use the YC variable with these functions:
BAR
DRAW
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
The YC variable is the character equivalent of the Y variable. Use YC when the axis
values are character. You must also specify a value of 2 (absolute data values) for the
YSYS variable. (See “YSYS Variable” on page 674.) If you use a value other than 2 for
the YSYS variable, the graphics output is not displayed properly.
See Figure 25.23 on page 669 for an illustration of the YC variable.
Note: The X or XC variable is required unless either the MIDPOINT, GROUP, or
SUBGROUP variable provides the horizontal coordinate. 4
CAUTION:
Do not use Y and YC variables in the same data set. Using both Y and YC variables in
the same data set can cause unpredictable results. 4
YSYS Variable
Defines the coordinate system and area of the output used by Y and YC to display the Annotate
graphics.
Annotate Dictionary YSYS Variable 675
Type: character
Length: 1
Default: 4
Syntax
YSYS=’coordinate-system’;
coordinate-system
specifies a value that represents a coordinate system. Values can be 1 through 9 and
A through C, as shown in the following table:
Absolute Relative
Systems Systems Coordinate System Units
These values are also used by the HSYS and XSYS variables. See “Coordinate
Systems” on page 596 for a description of the areas and coordinate systems.
Functions
The YSYS variable is function-dependent, as defined in the “XSYS Variable” on page 670
You can use the YSYS variable with these functions:
BAR
DRAW
FRAME
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
The coordinate system that you specify with the YSYS variable affects how the function
interprets the value of the Y or YC variable.
676 Z Variable Chapter 25
Note: Not all coordinate systems can be used with all Annotate variables. For any
restrictions, see the individual variables in this section. 4
Z Variable
Identifies the z coordinate of where a graphics element is to be drawn.
Type: numeric
Length: 8
Default: none
Restrictions: On the server, is used only with output from the G3D procedure. For
client-side annotation with Java or ActiveX, you can use the Z variable with GMAP,
GCHART, GCONTOUR, GPLOT, and G3D, for example to add annotations above the
plane of the map.
Syntax
Z=depth-coordinate;
Functions
You can use the Z variable with these functions:
BAR
DRAW
IMAGE
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
The Z variable uses the units that are specified in the ZSYS variable.
ZSYS Variable
Defines the coordinate system and area of the output used by Z variable to display the Annotate
graphics.
Annotate Dictionary ZSYS Variable 677
Type: character
Length: 1
Default: 2
Syntax
ZSYS=’coordinate-system’;
coordinate-system
specifies a value that represents a coordinate system. Values can be 1, 2, 7, or 8 as
shown in the following table:
Absolute Relative
Systems Systems Coordinate System Units
See “Coordinate Systems” on page 596 for a description of the areas and coordinate
systems.
Functions
You can use the ZSYS variable with these functions:
BAR
DRAW
IMAGE
LABEL
MOVE
PIE
PIECNTR
POINT
POLY
POLYCONT
SYMBOL
Details
The coordinate system that you specify with the ZSYS variable affects how the function
interprets the value of the Z variable.
Note: Not all coordinate systems can be used with all Annotate variables. For any
restrictions, see the individual variables in this section. 4
678 Annotate Internal Coordinates Chapter 25
Details
The coordinate values that are stored in the (XLAST, YLAST) variables are
automatically updated by these nontext functions: BAR, DRAW, MOVE, PIE, and
POINT. These values are then available for use by other nontext functions that follow
in the DATA step. (The DRAW2TXT graphics function uses XLAST and YLAST but
does not update them.)
Because (XLAST, YLAST) are updated internally, you cannot specify values for them.
However, their values can be manipulated by these programming functions:
CNTL2TXT
PIECNTR
PIEXY
POP
PUSH
SWAP
TXT2CNTL
Details
The coordinate values stored in the (XLSTT, YLSTT) variables are automatically
updated by the LABEL and SYMBOL text functions. These values are then available
for use by other text functions that follow in the DATA step.
Annotate Dictionary %BAR, %BAR2 Macros 679
Because (XLSTT, YLSTT) are updated internally, you cannot specify values for them.
However, their values can be manipulated by these programming functions:
CNTL2TXT
DRAW2TXT
POP
PUSH
SWAP
TXT2CNTL
Annotate Macros
You can use Annotate macros within a SAS DATA step to simplify the process of
creating Annotate observations. With a macro, you specify a function and assign
variable values in one step without having to write explicit variable assignment
statements. You can mix assignment statements and macro calls in the same DATA
step.
This section describes all of the Annotate macros including the complete syntax and
a description of the parameters. For more information on accessing and using macros,
and for a summary of operations performed by the Annotate macros, see “Using
Annotate Macros” on page 697.
%ANNOMAC Macro
Compiles Annotate macros and makes them available for use.
Variables written out: none directly
Syntax
%ANNOMAC;
Details
In a SAS session, you must submit the ANNOMAC macro before you can use the
Annotate macros.
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%BAR (x1, y1, x2, y2, color, line, style);
%BAR2(x1, y1, x2, y2, color, line, style, width);
x1, y1
specify the location of the first corner of the bar. Values can be numeric coordinates,
numeric constants, or numeric variables. For details, see the Annotate “X Variable”
on page 667.
x2, y2
specify the location of second corner of the bar, which is drawn diagonal to the first
corner. Values can be numeric coordinates, numeric constants, or numeric variables.
color
specifies the outline color and optional fill color using a character string without
quotation marks. For details, see the Annotate “COLOR Variable” on page 645.
line
specifies which of the outlines of the bar are to be drawn. The value can be a
number, a numeric constant, or a numeric variable. For valid values, see the
Annotate “LINE Variable” on page 652 for the BAR function.
style
specifies the fill pattern for the bar using a character string without quotation marks.
For valid values, see the Annotate “STYLE Variable (Patterns)” on page 662 for the
BAR function.
width
specifies the width of the outline and optional fill lines. The value can a number, a
numeric constant, or a numeric variable. For details and valid values, see the
Annotate “SIZE Variable” on page 660 for the DRAW function.
%CENTROID Macro
Retrieves the centroids of polygons
X, Y, id variables
Variables written out:
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%CENTROID (input-data-set, output-data-set, list-of-id-variables);
input-data-set
Annotate Dictionary %CNTL2TXT Macro 681
%CIRCLE Macro
Draws an empty circle with the center at (x, y).
Variables written out: ANGLE, FUNCTION, ROTATE, SIZE, STYLE, X, Y
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%CIRCLE (x, y, size, color);
x, y
specify coordinates for the center of the circle. Values can be coordinate numbers,
numeric constants, or numeric variables. For details, see the Annotate “X Variable”
on page 667.
size
specifies the radius of the circle. The value can be a number, a numeric constant, or
a numeric variable. For details and valid values, see the Annotate “SIZE Variable”
on page 660.
color
specifies the color of the circle using a character string without quotation marks. For
details, see the Annotate“COLOR Variable” on page 645. Use an asterisk (*) to
specify the previous value of the color parameter.
See Also
“%SLICE Macro” on page 695 to draw a filled circle.
%CNTL2TXT Macro
Copies the values of the internal coordinates (XLAST, YLAST) to the text coordinate (XLSTT,
YLSTT).
Variables written out: FUNCTION
682 %COMMENT Macro Chapter 25
Syntax
%CNTL2TXT;
Details
The %CNTL2TXT macro is useful when you are calculating the position of labels on a
graph. For an example, see “CNTL2TXT Function” on page 617.
%COMMENT Macro
Inserts a comment into an Annotate data set.
Variables written out: FUNCTION, TEXT
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%COMMENT (text-string);
text-string
specifies the text to insert in the Annotate data set. The value can be a a character
string enclosed in quotation marks or the name of a character variable. For details,
see the Annotate“TEXT Variable” on page 666.
%DCLANNO Macro
Automatically sets the correct length and data type for all Annotate variables except the TEXT
variable.
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%DCLANNO;
Annotate Dictionary %DRAW2TXT Macro 683
%DRAW Macro
Draws a line from (XLAST, YLAST) to the specified coordinate.
Variables written out: COLOR, FUNCTION, LINE, SIZE, X, Y
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%DRAW (x, y, color, line, size);
x, y
specify coordinates for the end point of the line. Values can be coordinate numbers,
numeric constants, or numeric variables. For details, see the Annotate “X Variable”
on page 667.
color
specifies the color of the line using a character string without quotation marks. For
details, see the Annotate“COLOR Variable” on page 645. Use an asterisk (*) to
specify the previous value of the color parameter.
line
specifies the line type (continuous or segmented). The value can be a number, a
numeric constant, or a numeric variable. For valid values, see the Annotate “LINE
Variable” on page 652 for the DRAW function.
size
specifies the width of the line. The value can be a number, a numeric constant, or a
numeric variable. For valid numeric values, see the Annotate“SIZE Variable” on page
660 for the DRAW function.
Details
The point from which the line is drawn is usually set with the MOVE macro.
%DRAW2TXT Macro
Draws a line from the coordinate (XLAST, YLAST) to the text coordinate (XLSTT, YLSTT).
Variables written out: COLOR, FUNCTION, LINE, SIZE
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%DRAW2TXT (color, line, size);
684 %FRAME Macro Chapter 25
color
specifies the color of the line using a character string without quotation marks. For
details, see the Annotate “COLOR Variable” on page 645. Use an asterisk (*) to
specify the previous value of the color parameter.
line
specifies the line type (continuous or segmented). The value can be a number, a
numeric constant, or a numeric variable. For valid values, see the Annotate “LINE
Variable” on page 652 for the DRAW function.
size
specifies the width of the line. The value can be a number, a numeric constant, or a
numeric variable. For valid values, see the Annotate “SIZE Variable” on page 660 for
the DRAW function.
%FRAME Macro
Draws a border around the portion of the display area defined by the reference system and
optionally fills the area.
COLOR, FUNCTION, LINE, SIZE, STYLE
Variables written out:
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%FRAME (color, line, size, style);
color
specifies the outline color and the optional fill color using a character string without
quotation marks. For details, see the Annotate“COLOR Variable” on page 645. Use
an asterisk (*) to specify the previous value of the color parameter.
line
specifies a line type (continuous or segmented) for the frame outline and fill lines. The
value can be a number, a numeric constant, or a numeric variable. For valid numeric
values, see the Annotate“LINE Variable” on page 652 for the DRAW function.
size
specifies the width of the frame outline and fill lines. The value can be a number, a
numeric constant, or a numeric variable. For valid values, see the Annotate “SIZE
Variable” on page 660 for the DRAW function.
style
specifies the fill pattern for the frame using a character string without quotation
marks. For valid values, see the Annotate “STYLE Variable (Patterns)” on page 662
for the FRAME function.
Details
See “%SYSTEM Macro” on page 696for information on setting the reference system.
Annotate Dictionary %LABEL Macro 685
%LABEL Macro
Places a text label at the specified coordinates.
Variables written out: ANGLE, COLOR, FUNCTION, POSITION, ROTATE, SIZE, STYLE,
TEXT, X, Y
Internal variables updated: XLSTT, YLSTT
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%LABEL (x, y, text-string, color, angle, rotate, size, style, position);
x, y
specifies the location of the text string. Values can be coordinate numbers, numeric
constants, or numeric variables. The position of the text string relative to x, y is
determined by the position parameter. For details, see the Annotate “X Variable” on
page 667.
text-string
specifies the text of the label. The value can be a character variable name or a
character string enclosed in quotation marks. For details, see the Annotate “TEXT
Variable” on page 666.
color
specifies the color of the text string using a character string without quotation
marks. For details, see the Annotate “COLOR Variable” on page 645. Use an
asterisk (*) to specify the previous value of the color parameter.
angle
specifies the angle of the text string with respect to the horizontal. The value can be
a number, a numeric constant, or a numeric variable. For valid values, see the
Annotate “ANGLE Variable” on page 642 for the LABEL function. The x, y
coordinates specify the pivot point, and the position parameter positions the text
relative to x, y.
rotate
specifies the rotation angle of each character in the text string. The value can be a
number, a numeric constant, or a numeric variable. For valid values, see the
Annotate “ROTATE Variable” on page 659.
size
specifies the size of the text string. The value can be a number, a numeric constant,
or a numeric variable. For valid values, see the Annotate “SIZE Variable” on page
660 for the LABEL function.
style
specifies the text font, using a character string without quotation marks. For valid
values, see the Annotate “STYLE Variable (Fonts)” on page 661.
position
specifies the placement and alignment of the text string relative to the x, y
coordinates, using a text string without quotation marks. For valid values, see the
Annotate “POSITION Variable” on page 656.
686 %LINE Macro Chapter 25
%LINE Macro
Draws a line between two sets of coordinates.
COLOR, FUNCTION, LINE, SIZE, X, Y
Variables written out:
XLAST, YLAST
Internal variables updated:
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%LINE (x1, y1, x2, y2, color, line, size);
x1, y1
specify the coordinates of the start of the line. Values can be numbers, numeric
constants, or numeric variables. For details, see the Annotate “X Variable” on page
667 variable.
x1, y2
specify the coordinates of the end of the line. Values can be numbers, numeric
constants, or numeric variables.
color
specifies the color of the line using a character string without quotation marks. For
valid values, see the Annotate“COLOR Variable” on page 645. Use an asterisk (*) to
specify the previous value of the color parameter.
line
specifies the line type, which can be continuous or segmented. The value can be a
number, a numeric constant, or a numeric variable. For valid values, see the
Annotate“LINE Variable” on page 652 for the DRAW function.
size
specifies the width of the line. The value can be a number, a numeric constant, or a
numeric variable. For valid values, see the Annotate “SIZE Variable” on page 660 for
the DRAW function.
%MAPLABEL Macro
Creates an output data set that can be used with the ANNO= option for PROC GMAP.
FUNCTION, STYLE, COLOR, SIZE, HSYS
Variables written out:
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%MAPLABEL (map-dataset,
attr-dataset,output-dataset,label-var,id-list,font=font_name,color=n,size=n,hsys=n);
Annotate Dictionary %MOVE Macro 687
map-dataset
the name of the map to be annotated.
attr-dataset
the name of the dataset containing the text to be shown on each ID value.
output-dataset
the name of the annotate data set created by the macro.
label-var
the name of the label variable to place on the map (the text for annotate).
id-list
the list of ID vars that you would issue in PROC GMAP to create the map. These
values need to be on both the map and the attribute data sets. If you also supply the
SEGMENT variable, then every polygon will get a value. Without the SEGMENT
variable, only one label per ID set will be shown over the collection of polygons. For
instance, Hawaii with SEGMENT gets a label on each island, whereas without
SEGMENT, there is only one label centered on the entire set of islands.
font
specifies a font name for the “STYLE Variable (Fonts)” on page 661 variable.
color
specifies a value for the “COLOR Variable” on page 645 variable.
size
specifies a value for the “SIZE Variable” on page 660 variable. Defaults to 2.
hsys
specifies a value for the “HSYS Variable” on page 649 variable. Defaults to 3.
%MOVE Macro
Moves to the (x, y) coordinate.
Variables written out: FUNCTION, X, Y
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%MOVE (x, y);
x, y
specify new coordinates for the next annotation. Values can be numeric coordinates,
numeric constants, or numeric variables. For details, see the Annotate “X Variable”
on page 667.
688 %PIEXY Macro Chapter 25
%PIEXY Macro
Calculates a point in relation to the latest pie slice.
Variables written out: ANGLE, FUNCTION, SIZE, X, Y
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%PIEXY (angle, size);
angle
specifies the angle used to calculate the point, relative to the center of the latest pie
slice. The value can be a number, a numeric constant, or a numeric variable. For
details, see the Annotate “ANGLE Variable” on page 642 for the PIEXY function.
size
specifies the radius multiplier that works with the angle parameter to determine the
location of the point. The value can be a number, a numeric constant, or a numeric
variable. For details and valid values, see the Annotate “SIZE Variable” on page 660
for the PIEXY function.
Details
This macro is useful when you want to label a pie chart or a circle.
When you use this macro, the Annotate facility expects a slice to have been
previously drawn. If a slice has not been drawn or if the “PIECNTR Function” on page
630 has not been processed, you can get erroneous results.
Syntax
%POLY (x, y, color, style, line);
%POLY2(x, y, color, style, line, width);
Annotate Dictionary %POLYCONT Macro 689
x, y
specify the starting point for a new polygon. Values can be numeric coordinates,
numeric constants, or numeric variables. For details, see the Annotate or the names
of the Annotate variables “X Variable” on page 667.
color
specifies the optional polygon fill color using a character string without quotation
marks. For valid values, see the Annotate“COLOR Variable” on page 645. Use an
asterisk (*) to specify the previous value of the color parameter. To specify the color
of the polygon outline, see the “%POLYCONT Macro” on page 689.
style
specifies the fill pattern for the polygon, using a character string without quotation
marks. For valid values, see the Annotate “STYLE Variable (Patterns)” on page 662
for the POLY function.
line
specifies the polygon’s line type, which can be continuous or segmented. The value
can be a number, a numeric constant, or a numeric variable. For valid values, see the
Annotate“LINE Variable” on page 652 for the POLY function.
width
specifies the width of the polygon’s outline and optional fill lines. The value can be a
number, a numeric constant, or a numeric variable. For details and valid values, see
the Annotate “SIZE Variable” on page 660 for the POLY function.
See Also
“POLY Function” on page 634
%POLYCONT Macro
Continues drawing the polygon to the next specified coordinates.
Variables written out: COLOR, FUNCTION, X, Y
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%POLYCONT (x, y, color);
x, y
specify the end point of the next line in the polygon. Values can be numeric
coordinates, numeric constants, or numeric variables. For details, see the Annotate
“X Variable” on page 667.
color
specifies the color of the polygon outline using a character string without quotation
marks. For valid values, see the Annotate“COLOR Variable” on page 645. Use an
asterisk (*) to specify the previous value of the color parameter.
690 %POP Macro Chapter 25
Details
The first invocation of the %POLYCONT macro in the polygon-drawing sequence
determines the outline color of that polygon. Subsequent color specifications for that
polygon in later invocations of the %POLYCONT macro are ignored.
The polygon fill color and line type are specified in the initial “%POLY, %POLY2
Macro” on page 688 or %POLY2 macro.
%POP Macro
Removes the coordinates (XLAST, YLAST) and (XLSTT, YLSTT) from the LIFO system stack and
updates the internal coordinate pairs with these retrieved values.
FUNCTION
Variables written out:
XLAST, YLAST, XLSTT, YLSTT
Internal variables updated:
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%POP;
Details
Use the %POP macro when you want to access the values of the XLAST, YLAST,
XLSTT, and YLSTT variables that you previously stored with the %PUSH macro. For
more information, see “XLAST, YLAST Variables” on page 678, “XLSTT, YLSTT
Variables” on page 678, and “%PUSH Macro” on page 690.
%PUSH Macro
Enters the coordinates (XLAST, YLAST) and (XLSTT, YLSTT) in a LIFO system stack.
Variables written out: FUNCTION, internal coordinates
Internal variables updated: XLAST, YLAST, XLSTT, YLSTT
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%PUSH;
Details
The last-in, first-out (LIFO) stack provides a way to save previously calculated
coordinates. It enables you to retain coordinate values for later use by utility functions
without recalculating those values. In order to save coordinate values in the stack, you
Annotate Dictionary %RECT Macro 691
must explicitly push them onto the stack. See “Using the LIFO Stack” on page 603 for a
description of the LIFO stack.
%RECT Macro
Draws a rectangle with diagonal corners at two specified points.
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%RECT (x1, y1, x2, y2, color, line, size) ;
x1, y1
specify the coordinates of the first corner of the rectangle. Values can be numeric
coordinates, numeric constants, or numeric variables. For details, see the Annotate
“X Variable” on page 667.
x2, y2
specify the coordinates of the second corner of the rectangle, which is drawn diagonal
to the first corner. Values can be numeric coordinates, numeric constants, or numeric
variables.
color
specifies the color of the rectangular line using a character string without quotation
marks. For valid values, see the Annotate“COLOR Variable” on page 645. Use an
asterisk (*) to specify the previous value of the color parameter.
line
specifies the rectangle’s line type, which can be continuous or segmented. The value
can be a number, a numeric constant, or a numeric variable. For details, see the
Annotate “LINE Variable” on page 652 for the DRAW function.
size
specifies the width of the line. The value can be a number, a numeric constant, or a
numeric variable. For valid values, see the “SIZE Variable” on page 660 for the
DRAW function.
Details
The rectangle is drawn such that the first corner is diagonal to the second corner.
The %RECT macro produces rectangles that do not have fill patterns. Use the %BAR
macro to generate filled rectangles. For more information, see “%BAR, %BAR2 Macros”
on page 679.
692 %SCALE Macro Chapter 25
%SCALE Macro
Scales input coordinates relative to the origin (0, 0) based on the relationship between two ranges
of minima and maxima.
Variables written out: X, Y
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%SCALE (ptx, pty, x1, y1, x2, y2, vx1, vy1, vx2, vy2);
ptx, pty
specifies the coordinates to scale. Values can be numbers, numeric constants, or
numeric variables. For details, see the Annotate “X Variable” on page 667.
x1, y1
specifies the minima of the first range. Values can be numbers, numeric constants, or
numeric variables.
x2, y2
specifies the maxima of the first range. Values can be numbers, numeric constants,
or numeric variables.
vx1, vy1
specifies the minima of the second range. Values can be numbers, numeric constants,
or numeric variables.
vx2, vy2
specifies the maxima of the second range. Values can be numbers, numeric constants,
or numeric variables.
Details
The %SCALE macro reduces or enlarges Annotate graphics elements that use
two-dimensional, numeric coordinates. The %SCALE macro does not affect graphics
elements that are drawn with text functions.
The difference between the %SCALE and %SCALET macros is that the %SCALE
macro always places the origin at (0, 0) and plots the new coordinates with respect to
that origin. The %SCALET macro plots the new coordinates with respect to the minima
of the second range. For details, see “%SCALET Macro” on page 693.
The following example uses the %SCALE macro to reduce x and y coordinates by 50
percent, as shown in Figure 25.27 on page 693:
%SCALE(x, y, 0, 0, 100, 100, 0, 0, 50, 50);
Annotate Dictionary %SCALET Macro 693
Figure 25.27 Using the %SCALE Macro to Reduce the Size of a Box
100
(10,80) (60,80)
50
(5,40)
(30,40)
(10,20)
(60,20)
(5,10) (30,10)
(0,0) 50 100
%SCALET Macro
Scales input coordinates based on the relationship between two ranges of minima and maxima.
The scaled coordinates are plotted relative to the minima of the second range.
Variables written out: X, Y
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%SCALET (ptx, pty, x1, y1, x2, y2 , vx1, vy1, vx2, vy2);
ptx, pty
specifies the coordinates to scale. Values can be numbers, numeric constants, or
numeric variables. For details, see the Annotate “X Variable” on page 667.
x1, y1
specifies the minima of the original range. Values can be numbers, numeric
constants, or numeric variables.
x1, y2
specifies the maxima of the original range. Values can be numbers, numeric
constants, or numeric variables.
vx1, vy1
specifies the minima of the second range using numeric values. Values can be
numbers, numeric constants, or numeric variables. These coordinates are also used
as the origin against which the scaled point is plotted.
694 %SEQUENCE Macro Chapter 25
vx2, vy2
specifies the maxima of the second range. Values can be numbers, numeric constants,
or numeric variables.
Details
The %SCALET macro reduces or enlarges Annotate graphics elements that use
two-dimensional numeric coordinates. The %SCALET macro does not affect graphics
elements that are drawn with text functions.
The difference between the %SCALET and %SCALE macros is that the SCALET
macro plots the new coordinates with respect to minima of the second range (vx1, vy1).
The %SCALE macro plots the new coordinates with respect to the origin (0, 0).
The following example uses the %SCALET macro reduces x and y coordinates by 50
percent and plots the new coordinates with respect to (50, 0), as shown in Figure 25.28
on page 694:
%SCALET(x, y, 0, 0, 100, 100, 50, 0, 50, 100);
Figure 25.28 Using the %SCALET Macro to Reduce the Size of a Box
100
(10,80) (60,80)
(30,40)
+
(50,0)
translation
50
(80,40)
(10,20)
50% of (60,20)
(10,20)
(5,10) (55,10) (80,10)
(5,10) with respect to (vxl,cyl) moves (5,10) to (55,10)
%SEQUENCE Macro
Specifies when to draw Annotate graphics elements, relative to the procedure’s graphics output or
relative to the other Annotate graphics drawn.
Syntax
%SEQUENCE (when);
when
Values can be BEFORE or AFTER, as defined for the Annotate “WHEN Variable” on
page 666.
%SLICE Macro
Draws a arc, pie slice, or circle, with available line types, colors, and fill types.
Variables written out: ANGLE, COLOR, FUNCTION, LINE, ROTATE, SIZE, STYLE, X, Y
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%SLICE (x, y, angle, rotate, size, color, style, line);
x, y
specify the center point of the arc. Values can be numbers, numeric constants, or
numeric variables. For details, see the Annotate “X Variable” on page 667.
angle
specifies the starting point of the arc. The value can be a number, a numeric
constant, or a numeric variable. For details and valid values, see the Annotate
“ANGLE Variable” on page 642 for the PIE function.
rotate
specifies the sweep of the arc. The value can be a number, a numeric constant, or a
numeric variable. For valid values, see the Annotate “ROTATE Variable” on page 659
for the PIE function.
size
specifies the radius of the arc. The value can be a number, a numeric constant, or a
numeric variable. For details, see the Annotate “SIZE Variable” on page 660.
color
specifies the color of the arc outline and optional fill using a character string without
quotation marks. For valid values, see the Annotate “COLOR Variable” on page 645.
Use an asterisk (*) to specify the previous value of the color parameter.
style
specifies the fill pattern for the slice or circle, using a character string without
quotation marks. For details and valid values, see the Annotate “STYLE Variable
(Patterns)” on page 662 for the PIE function.
696 %SWAP Macro Chapter 25
line
specifies which lines of a pie slice are to be drawn. The value can be a number, a
numeric constant, or a numeric variable. For valid values and details, see the “LINE
Variable” on page 652 for the PIE function.
%SWAP Macro
Exchanges control between (XLAST, YLAST) and text (XLSTT, YLSTT) coordinates.
Variables written out: FUNCTION
Internal variables updated: XLAST, YLAST, XLSTT, YLSTT
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%SWAP;
%SYSTEM Macro
Defines the Annotate reference systems and the XSYS, YSYS, and HSYS variables.
HSYS, XSYS, YSYS
Variables written out:
Prequisite: You must run the %ANNOMAC macro before using any other annotate
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%SYSTEM (xsys, ysys, hsys);
Details
Note: Not all coordinate systems are valid with all Annotate variables or all SAS/
GRAPH procedures. See “Annotate Functions” on page 615 for any restrictions that
apply to the variable that you want to use. 4
The ZSYS variable cannot be set through this macro. Use an explicit variable
assignment instead:
zsys=’value’; output;
Annotate Dictionary Making the Macros Available 697
%TXT2CNTL Macro
Assigns the values of the text (XLSTT, YLSTT) coordinates to the control (XLAST, YLAST)
coordinates.
Variables written out: FUNCTION
Internal variables updated: XLAST, YLAST
You must run the %ANNOMAC macro before using any other annotate
Prequisite:
macros. For more information, see “Making the Macros Available” on page 697.
Syntax
%TXT2CNTL;
Details
Use the %TXT2CNTL macro when you want nontext functions to use the ending
position of a text string as a starting or ending point.
Macro Structure
The general form of an Annotate macro is
%MACRO (parameters);
In general, the macro name represents a function and the parameters contain the
values for the variables that can be used with the function. All macros except
DCLANNO, SYSTEM, and SEQUENCE output an observation.
The parameters are either numeric or character. Numeric parameters can be
numeric constants or numeric variable names that have been initialized to the
appropriate value. Most character parameters must be expressed as literals, that is
character strings without quotation marks. Exceptions are the text values that are used
with the COMMENT and LABEL macros, which can be expressed as character strings
enclosed in quotation marks or as character variable names.
The Annotate facility assigns the parameter values to the corresponding Annotate
variables. Therefore, the observations in an Annotate data set that is created with
macros that look the same as the ones that you created with assignment statements.
with your SAS Software Consultant to find out if the fileref for the data set that
contains the Annotate macros that are supplied with SAS/GRAPH software is allocated
automatically at your site. Then access the Annotate macros in one of these ways:
3 If the fileref is not set automatically, find out where the Annotate macros are
stored and allocate a fileref that points to the data set:
filename fileref ’external-file’;
3 If the fileref is set automatically, compile the Annotate macros and make them
available by simply submitting the ANNOMAC macro:
%annomac;
Note: The ANNOMAC macro must be run before any other Annotate macros
are used in a SAS session. You will see a message in the SAS log that indicates
that the Annotate macros are now available. The message also shows you how to
get help for using the macros. 4
scale input %SCALE(ptx, pty, x0, y0, x1, y1, x0, vy0, vx1, vy1);
set the coordinate system for the observation %SYSTEM(xsys, ysys, hsys);
20 TOTAL ERRORS
User Action: Check for misspelling or wrong variable assignment, or check for
quotes in the assignment statement.
ANNOTATE GROUP DATATYPE DOES NOT MATCH GCHART- INPUT WAS #
Explanation: The GROUP variable in the Annotate data set is character, and the
GCHART group is numeric or vice versa.
User Action: Check for misspelling or wrong variable assignment, or check for
quotes in the assignment statement.
ANNOTATE SUBGROUP DATATYPE DOES NOT MATCH GCHART- INPUT WAS #
Explanation: The SUBGROUP variable in the Annotate data set is character, and
the GCHART subgroup is numeric or vice versa.
User Action: Check for misspelling or wrong variable assignment, or check for
quotes in the assignment statement.
BOTH OLD AND NEW VARIABLE NAMES ENCOUNTERED IN ANNOTATE=
DATA SET
Explanation: Variables named both MIDPOINT and MIDPNT or SUBGROUP and
SUBGRP occur in the Annotate data set.
User Action: Determine which variable has the proper values for the Annotate
data set and either delete the other variable or rename MIDPNT to MIDPOINT
and SUBGRP to SUBGROUP.
CALCULATED COORDINATES LIE COMPLETELY OFF THE VISIBLE AREA
Explanation: Both the x and y coordinates supplied are outside the visible display
area.
User Action: Check for improper or inappropriate coordinate system
specification or coordinates out of range.
CANNOT HAVE MISSING GROUP VALUE IF GROUPS ARE PRESENT
Explanation: The GROUP variable in the Annotate data set contains a missing
value.
User Action: If the GROUP= option is specified in the GCHART procedure, the
Annotate GROUP variable cannot contain missing values. Remove the missing
value from the request. Check reference system for data-dependent request.
CANNOT HAVE SUBGROUP AND X/Y MISSING IN GCHART STREAM
Explanation: Data coordinate system was requested and the X, Y and
SUBGROUP variables contain missing values.
User Action: The X, Y or SUBGROUP variable must have a value if a data
coordinate system is requested. Check stream for improper request.
CANNOT OMIT GROUP VARIABLE IF GCHART GROUPS ARE PRESENT
Explanation: You used a data coordinate system and specified GROUP= in the
GCHART procedure, but the Annotate data set does not contain the GROUP
variable.
User Action: Supply the GROUP variable in the Annotate data set.
CHARACTER VALUE SHOWN IS NOT ON THE HORIZONTAL AXIS
Explanation: The specified value of the XC variable is not on the x axis of the
graph or chart. The observation is ignored.
User Action: Check for misspelling, for uppercase or lowercase conflict, or for
exclusion in an axis specification.
CHARACTER VALUE SHOWN IS NOT ON THE VERTICAL AXIS
Explanation: The specified value of the YC variable does not occur on the y axis of
the graph or chart. The observation is ignored.
User Action: Check for misspelling, for uppercase or lowercase conflict, or for
exclusion in an axis specification.
Annotate Dictionary Annotate Error Messages 701
4
P A R T
SAS/GRAPH Procedures
Chapter 26. . . . . . . . .The GANNO Procedure 707
CHAPTER
26
The GANNO Procedure
Overview 707
Procedure Syntax 708
PROC GANNO Statement 708
Examples 710
Example 1: Scaling Data-Dependent Output 710
Example 2: Storing Annotate Graphics 713
Example 3: Using the NAME= Option to Produce Multiple Graphs 715
Example 4: Using Annotate Graphics in a Drill-Down Graph 719
Overview
The GANNO procedure displays graphs created by Annotate data sets. The
procedure can also be used to scale data-dependent graphics to fit the graphics output
area. Note that the GANNO procedure ignores all currently defined title and footnote
statements and some graphics option specifications, including BORDER=. To include
titles, footnotes, and graphics options along with your Annotate data set, use the
GSLIDE procedure instead of the GANNO procedure.
By default, both the GANNO and GSLIDE procedures scale graphics output from the
data set to fill the entire graphics area. However, if you are using a data coordinate
system and the data values are so large that some of the graphics elements do not fit in
the graphics output area and are not displayed, you can use the GANNO procedure
with the DATASYS option. This will cause the procedure to scale the output to fit the
available space. The GSLIDE procedure does not have this capability.
Figure 26.1 on page 707 displays output from an Annotate data set.
Procedure Syntax
Requirements: An input Annotate data set is required.
Supports: Output Delivery System (ODS)
Syntax
PROC GANNO ANNOTATE=Annotate-data-set
<DATASYS>
<DESCRIPTION=’entry-description’>
<GOUT=<libref.>output-catalog>
<IMAGEMAP=output-data-set>
<NAME=’entry-name’ | variable-name>;
Required Arguments
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set that includes Annotate variables that identify graphics commands
and parameters.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
Options
Options in the GANNO statement affect all graphs produced by that statement. You
can specify as many options as you want and list them in any order.
DATASYS
indicates that absolute or relative data-dependent coordinates occur in the Annotate
data set and scales the coordinates to fit the graphics output area. Use the DATASYS
option only with Annotate data sets in which the coordinate system variables XSYS,
YSYS, and HSYS specify the values 1, 2, 7, or 8.
The GANNO Procedure PROC GANNO Statement 709
Use the DATASYS option when graphics elements that were created with
data-dependent variables do not fit in the graphics output area. This happens when
the coordinate values generated by the data exceed a range of 0 to 100.
If you omit the DATASYS option, the GANNO procedure attempts to draw each
graphics element according to the data values assigned to it, without scaling the
values. If the range of data values is too large, some graphics elements will not
display.
See also: “Using the DATASYS Option to Scale Graphs” on page 710
Featured in: Example 1 on page 710
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length is
256 characters. The description does not appear on the chart. By default, the
GANNO procedure assigns the description OUTPUT FROM PROC GANNO.
Featured in: Example 2 on page 713
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GANNO procedure. If you omit the libref, the SAS/GRAPH software looks for the
catalog in the temporary library called WORK and creates the catalog if it does not
exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53
Featured in: Example 2 on page 713
IMAGEMAP=output-data-set
creates a temporary SAS data set that is used to generate an image map in an
HTML output file. The information in the image map data set includes the shape
and coordinates of the elements in the graph and drill-down URLs that have been
associated with those elements. The drill-down URLs are provided by one or two
variables in the input data set. These variables are identified to the GANNO
procedure with the HTML= and/or HTML_LEGEND= options.
The %IMAGEMAP macro generates the image map in the HTML output file. The
macro takes two arguments, the name of the image map data set and the name or
fileref of the HTML output file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
See also:Chapter 25, “Annotate Dictionary,” on page 613 and “Adding Links with
the HTML= and HTML_LEGEND= Options” on page 574.
Featured in: Example 4 on page 719
NAME=’entry-name’ | variable-name
specifies one of the following:
3 the name of the catalog entry for the graph
3 a variable name for each value for which a separate graph is produced.
If the value you assign to the NAME= option is enclosed in quotation marks, the
procedure interprets it as a catalog entry name; if the value is not enclosed in quotes,
the procedure interprets it as a variable name.
The value entry-name specifies the name of the catalog entry for the graph. The
maximum length is 8 characters. The default name is GANNO. If the specified name
duplicates the name of an existing entry, SAS/GRAPH software adds a number to the
duplicate name to create a unique entry, for example, GANNO1.
If you specify variable-name, the GANNO procedure produces a separate graph for
each different value of that variable. In addition, when you specify
710 Examples Chapter 26
NAME=variable-name, each value of the variable is used as the name of the catalog
entry for that graph. A value that is longer than 8 characters is truncated. For
example, if the value is Frankfurt, it is truncated to Frankfur. A second catalog
entry would be Frankfu1. Consequently, you cannot use NAME=’entry-name’ at the
same time.
Note: Specifying NAME=variable-name in the PROC GANNO statement
produces results similar to those produced by the BY statement in a procedure that
supports BY-group processing. See “BY Statement” on page 141 for details. 4
Featured in: Example 2 on page 713Example 3 on page 715
Examples
This example uses an Annotate data set to scale data-dependent output with the
DATASYS option and create a vertical bar chart of sales for each of six sites. The
values that determine the height of each bar range from 137 to 999. The range of
values is so large that the GANNO procedure cannot fit all of the bars in the output
area without scaling the output. This program uses the DATASYS option to scale the
data values so that the bars fit in the graphics output area.
Create the data set WRLDTOTL. WRLDTOTL contains sales data for six sites. SITENAME
contains the names of the sites. MEAN contains the average sales for each site.
data wrldtotl;
length sitename $ 10;
input sitename $ 1-10 mean 12-15;
datalines;
Paris 999
Munich 571
Tokyo 137
London 273
Frankfurt 546
New York 991
;
run;
712 Example 1: Scaling Data-Dependent Output Chapter 26
Create the Annotate data set, WRLDANNO. XSYS and YSYS specify coordinate system 2
(absolute data values) for X and Y. HSYS specifies coordinate system 3 (percent of the graphics
output area) for SIZE. The SET statement processes every observation in WRLDTOTL.
data wrldanno;
length function color $ 8 text $ 20;
retain line 0 xsys ysys ’2’ hsys ’3’ x 8;
set wrldtotl end=end;
Draw the bars. The MOVE function defines the lower left corner of the bar. The BAR function
draws the bar. Bar height (Y) is controlled by MEAN.
function=’move’; x=x+8; y=20; output;
function=’bar’; y=y+(mean); x=x+9;
style=’empty’; color=’red’; output;
Move to the top of the bar and write the value of MEAN.
function=’move’; y=y+(mean)-3; output;
function=’label’; x=x-1; text=left(put(mean,3.));
position=’5’; style=’swiss’; size=3; output;
After all the observations are processed, add an axis line, title, footnote, and frame.
The MOVE and DRAW functions draw the axis line. The LABEL function writes the title and
the footnote. The FRAME function draws a border around the output.
if end then do;
function=’move’; x=10; y=20; output;
function=’draw’; x=90; y=20; line=1;
size=.5; color=’blue’; output;
function=’label’; x=50; y=95; text=’Projected Sales’;
xsys=’3’; ysys=’3’; position=’5’; style=’swissb’;
size=5; color=’ ’; output;
x=92; y=5; size=3; style=’swiss’; text=’GANSCALE’; output;
function=’frame’; color=’blue’; when=’b’;
style=’empty’; output;
end;
run;
Display the annotate graphics. The ANNOTATE= identifies the data set that contains the
graphics commands. DATASYS tells the procedure to use the maximum and minimum data
values to construct the output environment. In addition, the values of X and Y are scaled to fit
the environment and all of the bars display on the graph.
The GANNO Procedure Example 2: Storing Annotate Graphics 713
This example creates an Annotate data set that draws four colored squares, displays
the data set as a single graphics output, and stores the output as a catalog entry in a
permanent catalog. In this example, the NAME= option specifies a text string that
identifies the name that is stored with the graphics output in the catalog.
Create the Annotate data set, SQUARES. XSYS and YSYS specify coordinate system 3
(percent of the graphics output area) for X and Y.
data squares;
length function style color $ 8 text $ 15;
xsys=’3’; ysys=’3’;
Draw the first square. The COLOR variable assigns the color for the square. The FUNCTION
variable selects the operation to be performed by the Annotate facility. The X and Y variables
contain coordinate values. The BAR function draws the square. When the STYLE variable is
used with the BAR function, it selects the fill pattern for the bar.
color=’green’;
function=’move’; x=10; y=65; output;
function=’bar’; x=30; y=95; style=’solid’; output;
Label the first square. The LABEL function creates the label. The POSITION value of 6
left-justifies the text with respect to X and Y. The TEXT variable specifies the text string to be
written.
function=’label’; x=10; y=63; position=’6’;
style=’swissb’; size=2; text=’Green’; output;
Add a footnote.
The GANNO Procedure Example 3: Using the NAME= Option to Produce Multiple Graphs 715
Display the annotate graphics. GOUT= assigns the catalog in which the graphics output is
stored. NAME= assigns a name to the entry stored in the WORK.EXCAT catalog.
DESCRIPTION= assigns a description to the catalog entry.
proc ganno annotate=squares
gout=excat
name=’GANSQUAR’
description=’Four squares’;
run;
quit;
In this example, the GANNO procedure uses the NAME= option to generate multiple
graphs from one Annotate data set. Since NAME= is assigned the variable COLOR, the
GANNO procedure generates separate graphics output for each value of the COLOR, as
shown in Figure 26.4 on page 717, Figure 26.5 on page 718, Figure 26.4 on page 717
and Figure 26.6 on page 718.
Each output is stored as a separate entry in the temporary output catalog
WORK.EXCAT. The entries are named according to the values of COLOR: BLUE, GRAY,
GREEN, and RED. Note that the output for GRAY includes the footnote shown in Example
2 on page 713. The output for RED shows the frame that is generated by the Annotate
data set. The black borders in the other outputs are not generated by the code.
Create the Annotate data set, SQUARES. XSYS and YSYS specify coordinate system 3
(percent of the graphics output area) for X and Y.
716 Example 3: Using the NAME= Option to Produce Multiple Graphs Chapter 26
data squares;
length function style color $ 8 text $ 15;
xsys=’3’; ysys=’3’;
Draw the first square. The COLOR variable assigns the color for the square. The FUNCTION
variable selects the operation to be performed by the Annotate facility. The X and Y variables
contain coordinate values. The BAR function draws the square. When the STYLE variable is
used with the BAR function, it selects the fill pattern for the bar.
color=’green’;
function=’move’; x=10; y=65; output;
function=’bar’; x=30; y=95; style=’solid’; output;
Label the first square. The LABEL function creates the label. The POSITION value of 6
left-justifies the text with respect to X and Y. The TEXT variable specifies the text string to be
written.
function=’label’; x=10; y=63; position=’6’;
style=’swissb’; size=2; text=’Green’; output;
Add a footnote.
x=88; y=5; position=’5’; size=1.5; style=’swiss’;
text=’GANSQUAR’; output;
The GANNO Procedure Example 3: Using the NAME= Option to Produce Multiple Graphs 717
Generate the annotate graphics, separating graphs by color. NAME= identifies the
variable whose values PROC GANNO uses to generate the output. GANNO produces separate
output for each value of COLOR. The COLOR value is the name of the catalog entry.
This example creates essentially the same Annotate data set used in Example 2 on
page 713. It draws four colored squares and displays the data set as a single graphics
output.
720 Example 4: Using Annotate Graphics in a Drill-Down Graph Chapter 26
However, this time the example shows you how to use Annotate graphics to generate
a drill-down graph. The example uses the HTML variable in the Annotate data set to
specify linking information that defines each of the four squares as a hot zone. When
the graph is viewed in a browser, you can click on a square to drill down to a related
graph. For example, if you click on the green square, it drills down to a graph that
confirms that you selected the green square.
The example uses the HTML device driver to generate the drill-down graph. To
implement the drill-down capability, the Annotate data set uses the HTML variable to
provide the linking information (see “HTML Variable” on page 651), and the GANNO
procedure uses the IMAGEMAP= option to create an Imagemap data set. The presence
of the HTML variable in the Annotate data set and the IMAGEMAP= option on the
GANNO procedure causes the HTML device driver to generate an image map for the
graph. It writes the image map to the file index.html, which the HTML device driver
creates for displaying Web output (see Chapter 17, “Generating Web Output with the
Annotate Facility,” on page 499).
To prevent the HTML device driver from writing over the contents of index.html
after the drill-down graph has been generated, the example switches to the GIF device
driver. It then runs four GSLIDE procedures to generate the target output. Each
GSLIDE procedure uses the NAME= option to name the graph it produces, ensuring
that the GIF driver creates files named green.gif, blue.gif, red.gif, and gray.gif. These
are the files that are referenced as targets by the strings that are specified for the
Annotate data set’s HTML variable.
Allocate a storage location for all the output files, and set the graphics environment.
The HTML device driver generates output that includes both HTML and GIF files, so the libref
must point to an aggregate storage location. It cannot point to a file.
Create the Annotate data set. The HTML variable is used to define the linking information
for each square. Because the GSLIDE procedures that generate the target output use NAME=
to ensure the output files are named green.gif, red.gif, blue.gif, and gray.gif, strings that
reference those names are assigned to the HTML variable for the appropriate observation in the
data. For the final observation, the HTML variable’s value is set to a null string; otherwise it
would retain the last assigned value, which is href=gray.gif. In that case, the graph’s
background area would be defined as a hot zone that links to file gray.gif. For a description of
the other functions and variables used in the Annotate data set, see Example 2 on page 713.
Set the graphics environment for the Web page. DEV= specifies the HTML device driver,
which will create the HTML and GIF files needed for the Web page. GSFNAME= specifies the
libref that points to the storage location that was allocated for the Web output. XPIXELS= and
YPIXELS= define a size in pixels for the graphics area. TRANSPARENCY specifies that the
background areas in all generated graphs should appear to be transparent when the images are
displayed in a browser.
/* set the graphics options for the web page */
goptions dev=html gsfname=webout
xpixels=450 ypixels=400
transparency;
Generate the drill-down graph. IMAGEMAP= specifies ANNOMAP as the name for the
Imagemap data set.
/* generate annotate graphics */
proc ganno annotate=squares
imagemap=annomap
description=’Four squares’;
run;
Change to the GIF driver and generate the target output. DEV= changes the device
driver to GIF so that the target output files will be generated as GIF files. FTEXT= and
CTEXT= specify a font and color for the text in graphics output. PROC GSLIDE is then run four
times to generate the four graphs that will serve as target output for the links that are defined
in the drill-down graph.
/* change to gif driver for target output */
goptions dev=gif ftext=centb ctext=green;
goptions ctext=blue;
proc gslide wframe=4
cframe=blue name=’blue’;
note height=20;
note height=10
justify=center
The GANNO Procedure Example 4: Using Annotate Graphics in a Drill-Down Graph 723
’Blue Sky’;
run;
goptions ctext=red;
proc gslide wframe=4
cframe=red name=’red’;
note height=20;
note height=10
justify=center
’Red Wine’;
run;
goptions ctext=gray;
proc gslide wframe=4
cframe=gray name=’gray’;
note height=20;
note height=10
justify=center
’Gray Mare’;
run;
quit;
724
725
CHAPTER
27
The GAREABAR Procedure
Overview 725
Concepts 726
Procedure Syntax 727
PROC GAREABAR Statement 727
HBAR, HBAR3D, VBAR, VBAR3D Statements 728
Examples 729
Example 1: A Simple Area Bar Chart 729
Example 2: Area Bar Chart with a Numeric Category Variable 731
Example 3: Area Bar Chart with a Subgrouping 733
Example 4: Area Bar Chart with Subgrouping and RSTAT and WSTAT as Percentages 735
Overview
The GAREABAR procedure enables you to produce an area bar chart showing the
magnitudes of two variables for each category of data. For example, the following area
bar chart shows the sales total for each of three geographical sites. An additional
dimension is graphed for the width variable, namely, the number of sales persons at
each site. One can see from this chart that while the sales total of NY is the greatest,
its number of sales people is also the greatest. In a plain bar chart, the width is the
same for each bar. In an area bar chart, the width and height of each bar is determined
by the value of variables.
726 Concepts Chapter 27
Concepts
The GAREABAR procedure produces a chart based on the values of a category
variable. A category variable can be either character or numeric. The GAREABAR
procedure treats all values of a numeric category variable as DISCRETE (such as
quarters 1,2,3,4) even if the values are apparently continuous (such as 1.234 and 4.002).
PROC GAREABAR does not calculate a midpoint.
Also, PROC GCHART, by default, sorts the values of the category variable either
alphabetically or numerically. PROC GAREABAR displays the category variable in data
order (the order in which its values occur in the data set).
For each category variable, PROC GAREABAR graphs the dimensions of two
numeric variables. For the VBAR statement, the SUMVAR variable (response variable)
is graphed along the vertical axis, and the width variable is graphed along the
horizontal axis. Conversely, for the HBAR statement, the SUMVAR variable (response
variable) determines the length of the bar on the horizontal axis, and the width
variable determines the thickness of the bar on the vertical axis.
Both the width variable and the response variable can be displayed as either
percentage or sum. Specify WSTAT=PERCENT or WSTAT=SUM for the width variable,
and specify RSTAT=PERCENT or RSTAT=SUM for the response variable. The default
for both is SUM.
The GAREABAR Procedure PROC GAREABAR Statement 727
In addition, you can use the SUBGROUP option to subgroup the response variable
either by percentage or by sum. Examples of subgrouping are shown in Example 3 on
page 733 and Example 4 on page 735.
Procedure Syntax
Requirements:
GOPTIONS statement with DEV=ACTIVEX | ACTXIMG
ODS HTML statement (before and after)
HBAR, HBAR3D, VBAR, or VBAR3D statement
Global statements: FOOTNOTE, GOPTIONS, TITLE
Supports: RUN-group processing
Syntax
PROC GAREABAR< DATA=input-data-set;>
Requirements
input-data-set
contains the data to be graphed.
GOPTIONS DEV=ACTIVEX|ACTXIMG
PROC GAREABAR requires a GOPTIONS statement where the value of DEV= is
ACTIVEX or ACTXIMG (before the PROC).
ODS HTML
PROC GAREABAR requires an ODS HTML statement (both before and after the
PROC).
728 HBAR, HBAR3D, VBAR, VBAR3D Statements Chapter 27
Syntax
HBAR | HBAR3D | VBAR | VBAR3D category-variable*width-variable
</ SUMVAR=response-variable option(s)>;
Required Arguments
All arguments must be in the input data set.
category-variable
is either character or numeric. Defines the category of data to chart. Each category
variable results in a separate bar. If the category-variable is numeric, all its values
are treated as DISCRETE (such as the years 2000, 2001, 2002). No midpoint is
calculated for a numeric category variable.
response-variable
is always numeric. For HBAR and HBAR3D, the length of the each bar along the
horizontal axis represents the response variable. For VBAR and VBAR3D, the height
of the each bar along the vertical axis measures the response variable.
Use the RSTAT option to specify whether the response variable is measured as a
percentage or as a sum. The default is SUM.
width-variable
is always numeric. For HBAR and HBAR3D, the width variable is measured by the
magnitude of each bar along the vertical axis. For VBAR and VBAR3D, the width
variable is measured by the magnitude of each bar along the horizontal axis.
Use the WSTAT option to specify whether the width variable is measured as a
percentage or as a sum. The default is SUM.
Options
CFR= | CFRAME=background-color
specifies a background color for the chart. The specified color must be a valid SAS/
GRAPH color name, or a character variable of length eight whose value is the color.
The default color is white.
CTEXT=text-color
specifies a color for all text on the chart. The specified color must be a valid SAS/
GRAPH color name, or a character variable of length eight whose value is the color.
The default color is black.
DISCRETE
causes the chart to show discrete width role values on the width axis rather than a
continuous axis. If you do not specify DISCRETE, the continuous axis result is
assumed. .
FRAME | NOFRAME
FRAME (the default) draws a frame around the procedure output area. The frame
color is the first color in the colors list.
The GAREABAR Procedure Example 1: A Simple Area Bar Chart 729
NOFRAME suppresses the frame that is drawn around the chart by default.
NAME=
when DEV=ACTXIMG, specifies the name of the graph (PNG file) produced by
GAREABAR. The maximum length for entry-name is eight characters. If the
specified name duplicates the name of an existing entry, then SAS/GRAPH software
overwrites the existing entry.
Use the PATH or GPATH option of the ODS HTML statement or ODS MARKUP
statement to specify the location for storing the .png file.
SUBGROUP=
used to subdivide the response-variable dimension (SUMVAR). A SUBGROUP
variable can be either character or numeric. For example, if the category variable is
company, and the response variable is revenue, then specifying a SUBGROUP of
country will subdivide the revenue for each company according to country. A numeric
example is subdividing revenue by quarters: 1, 2, 3, 4.
WSTAT= | WIDTHSTAT=SUM or PCT | PERCENT
specifies whether the width variable is represented as a percentage or as a sum. The
default is SUM.
RSTAT= | RESPSTAT=SUM or PCT | PERCENT
If SUBGROUP is specified, then RSTAT specifies whether the subgrouping is
represented as a percentage or as a sum. The default is SUM.
If SUBGROUP is not specified, then the response variable can only be SUM.
Examples
SUMVAR=
Sample library member: GABSUMVR
This example graphs the total sales for each of three geographic sites (Rome, NY,
Lima) along the X axis. Along the Y axis, the relative thickness of each bar shows the
number of salespersons at each site. The chart shows that although NY had the highest
sales (the longest bar), it also had the greatest number of salespersons (as shown by the
thickness of the bar).
730 Example 1: A Simple Area Bar Chart Chapter 27
Uncomment this line, and change the output destination to a directory and file name that
makes sense for you.
*filename odsout ’c:\test\filename.htm’;
data totals;
input Site $ Quarter Sales Salespersons;
cards;
Lima 1 4043.97 4
NY 1 8225.26 12
Rome 1 3543.97 6
Lima 2 3723.44 5
NY 2 8595.07 18
Rome 2 5558.29 10
Lima 3 4437.96 8
NY 3 9847.91 24
Rome 3 6789.85 14
Lima 4 6065.57 10
NY 4 11388.51 26
Rome 4 8509.08 16
;
The GAREABAR Procedure Example 2: Area Bar Chart with a Numeric Category Variable 731
Because SUMVAR=SALES, the total sales are plotted along the horizontal axis (HBAR).
Because SITE*SALESPERSONS and WSTAT=PERCENT, the percentage of salespersons at
each site is shown by the relative thickness of each bar along the vertical axis.
SUMVAR=
Sample library member: GABSUMVR
This example is similar to Example 1 and shows that the category variable can be
numeric—in this case 1, 2, 3, 4 for the four quarters of a year. The GAREABAR
procedure treats all values of a numeric category variable as DISCRETE and does not
calculate a midpoint even if the values of the category variable are continuous.
This example graphs the total sales for each quarter of the year along the horizontal
axis. The relative thickness of each bar along the vertical axis shows the total number
of salespersons during that quarter. The chart shows that as the number of
salespersons increased from quarter to quarter, the total sales also increased.
732 Example 2: Area Bar Chart with a Numeric Category Variable Chapter 27
Uncomment this line, and change the output destination to a directory and file name that
makes sense for you.
data totals;
input Site $ Quarter Sales Salespersons;
cards;
Lima 1 4043.97 4
NY 1 8225.26 12
Rome 1 3543.97 6
Lima 2 3723.44 5
NY 2 8595.07 18
Rome 2 5558.29 10
Lima 3 4437.96 8
NY 3 9847.91 24
Rome 3 6789.85 14
Lima 4 6065.57 10
NY 4 11388.51 26
Rome 4 8509.08 16
;
Because SUMVAR=SALES, the total sales are plotted along the horizontal axis (HBAR).
Because QUARTER*SALESPERSONS and WSTAT=PERCENT, the percentage of salespersons
for each quarter is shown by the relative thickness of each bar along the vertical axis.
The GAREABAR Procedure Example 3: Area Bar Chart with a Subgrouping 733
SUBGROUP=
Sample library member: GABSUBGR
This example uses the SUBGROUP= option to display the same magnitudes as
displayed by Examples 1 and 2. Like Example 1, this example shows the total sales for
each of three geographic sites along the horizontal axis. The relative thickness of each
bar along the vertical axis shows the number of salespersons at each site.
In addition, by subgrouping the response variable by quarter, this example shows the
relative percentage of sales for each quarter. Thus, one can see from this chart that NY
(the middle bar) had most of its sales in the fourth quarter, whereas Rome (the topmost
bar) had most of its sales in the first quarter.
The value of SUBGROUP= can be character or numeric.
734 Example 3: Area Bar Chart with a Subgrouping Chapter 27
Uncomment this line, and change the output destination to a directory and file name that
makes sense for you.
data totals;
input Site $ Quarter $ Sales Salespersons;
cards;
Lima 1 4043.97 4
NY 1 4225.26 12
Rome 1 16543.97 6
Lima 2 3723.44 5
NY 2 4595.07 18
Rome 2 2558.29 10
Lima 3 4437.96 8
NY 3 5847.91 24
Rome 3 3789.85 14
Lima 4 6065.57 10
NY 4 23388.51 26
Rome 4 1509.08 16
;
The GAREABAR Procedure Example 4: Area Bar Chart with Subgrouping and RSTAT and WSTAT as Percentages 735
/* define title */
title1 ’Ratio of Sales to Salespersons by Site’;
title2 ’(with Site subgrouped by Quarter)’;
Because SUMVAR=SALES, the total sales are plotted along the horizontal axis (HBAR).
Because SITE*SALESPERSONS and WSTAT=PERCENT, the percentage of salespersons for
each quarter is shown by the relative thickness of each bar along the vertical axis.
Because SUBGROUP=QUARTER and RSTAT=SUM, the quarters are displayed as absolute
numbers along the horizontal bar.
Example 4: Area Bar Chart with Subgrouping and RSTAT and WSTAT as
Percentages
Procedure features:
This example uses the RSTAT= option, in conjunction with the SUBGROUP= option,
to display the response variable (medals won in the winter Olympics), subgrouped by
the percentage (RSTAT=PCT) of each medal type (gold, silver, bronze). The width
variable is the number of athletes, displayed (in this case along the vertical axis) as the
percentage of athletes (WSTAT=PCT) of each of five different nationalities.
When the SUBGROUP= option is specified, you can use the RSTAT= option to specify
whether the subgrouping is to be displayed as a percentage or as a sum.
736 Example 4: Area Bar Chart with Subgrouping and RSTAT and WSTAT as Percentages Chapter 27
Uncomment this line, and change the output destination to a directory and file name that
makes sense for you.
*filename odsout ’c:\test\filename.htm’;
data medals;
input country $15. medaltype $ winter summer athletes;
datalines;
Germany Gold 12 14 176
Germany Silver 16 17 0
Germany Bronze 7 26 0
United States Gold 10 39 210
United States Silver 13 25 0
United States Bronze 11 33 0
Norway Gold 11 4 42
Norway Silver 7 3 0
Norway Bronze 6 3 0
Canada Gold 6 3 157
Canada Silver 3 3 0
Canada Bronze 4 8 0
Russia Gold 6 32 160
Russia Silver 7 28 0
The GAREABAR Procedure Example 4: Area Bar Chart with Subgrouping and RSTAT and WSTAT as Percentages 737
Russia Bronze 3 28 0
;
Because SUMVAR=WINTER, this proc displays the number medals won in the winter Olympics,
subgrouped by the percentage (RSTAT=PCT) of each medal type (gold, silver, bronze). The width
variable is the number of athletes, displayed (in this case along the vertical axis) as the
percentage of athletes (WSTAT=PCT) of each of five different nationalities.
When the SUBGROUP= option is specified, you can use the RSTAT= option to specify whether
the subgrouping is to be displayed as a percentage or as a sum.
CHAPTER
28
The GBARLINE Procedure
Overview 739
About Bar Line Charts 740
About Interpolation Methods 740
Concepts 741
About the Bar Variable 742
About Midpoints 742
Character Values 742
Discrete Numeric Values 743
Continuous Numeric Values 744
Selecting and Ordering Midpoints 744
About the Plot Variable 745
About Chart Statistics 745
Frequency 745
Cumulative Frequency 745
Percentage 746
Cumulative Percentage 746
Sum 746
Mean 746
Calculating Weighted Statistics 746
Missing Values 747
Plot Variable Values Out of Range 747
About Patterns 748
Default Patterns and Outlines 748
User-Defined Patterns, Outlines, and Images 748
Version 6 Patterns 749
Procedure Syntax 749
PROC GBARLINE Statement 750
BAR Statement 751
PLOT Statement 765
Examples 768
Example 1: Producing a Basic Bar Line Graph with Styles 768
Example 2: Calculating Weighted Statistics 770
Overview
The GBARLINE procedure produces bar line charts. Bar line charts are vertical bar
charts with a plot overlay. These charts graphically represent the value of a statistic
calculated for one or more variables in an input SAS data set. The charted variables
can be either numeric or character.
The procedure calculates these statistics:
740 About Bar Line Charts Chapter 28
3 connect the data points to the zero line on the vertical axis (NEEDLE)
3 use a step function to connect the data points (STEP)
3 produce overlay plots with unconnected data points (NONE)
3 connect data points with straight lines (JOIN).
For bar line graphs, points on the plot overlay are automatically joined, which is
equivalent to specifying the JOIN interpolation method.
“SYMBOL Statement” on page 183 describes the JOIN, NEEDLE, STEP, and NONE
interpolation methods.
Concepts
The GBARLINE procedure produces bar charts based on the values of a bar variable
with plot overlays based on the values of a plot variable. The values of the bar variable
are represented by a set of midpoints. The graph itself displays information about the
bar variable in the form of bar statistics.
Figure 28.2 on page 741 illustrates the parts of a bar line graph.
3 a right response axis that displays the scale of values for the plot statistic.
The response axes are divided into evenly spaced intervals identified with major tick
marks that are labeled with the corresponding statistic value. Minor tick marks are
evenly distributed between the major tick marks. Each axis is labeled with the variable
name or label.
About Midpoints
Midpoints are the values of the bar variable that identify categories of data. By
default, midpoints are selected or calculated by the procedure. The way the procedure
handles the midpoints depends on whether the values of the bar variable are character,
discrete numeric, or continuous numeric.
Character Values
A character bar variable generates a midpoint for each unique value of the variable.
In the following example, the bar variable CITY contains the names of three different
cities, and each city is a midpoint, resulting in three midpoints for the chart:
The GBARLINE Procedure About Midpoints 743
In this case, values excluded by the option are not included in the calculation of the
bar statistic.
You can order or select discrete numeric midpoint values just as you do character
values, but you omit the quotation marks when specifying numeric values.
For continuous numeric variables, use the LEVELS= or MIDPOINTS= option to
change the number of midpoints, to control the range of values each midpoint
The GBARLINE Procedure About Chart Statistics 745
represents, or to change the order of the midpoints. To control the range of values each
midpoint represents, use the MIDPOINTS= option to specify the median value of each
range. For example, to select the ranges 20–29, 30–39, and 40–49, specify
midpoints=25 35 45
Alternatively, to select the number of midpoints that you want and let the procedure
calculate the ranges and medians, use the LEVELS= option.
You can also use formats to control the ranges of continuous numeric variables, but
in that case the values are no longer continuous but become discrete.
Note: You cannot use the MIDPOINTS= option to exclude continuous numeric
values from the chart because values below or above the ranges specified by the option
are automatically included in the first and last midpoints, respectively. To exclude
continuous numeric values from a chart, use a WHERE statement in a DATA step or
the WHERE= DATA set option. 4
See also the description of the LEVELS= and MIDPOINTS= options.
When you specify a plot variable with the SUMVAR= option, the only statistics
available for the plot are the sum or the mean. You can specify the statistic with the
TYPE= option. SUM (TYPE=SUM) is the default.
If you do not specify a plot variable, then the bar variable is used as the plot variable.
The only statistics available for the plot are percentage, cumulative percentage,
frequency, or cumulative frequency. The default statistic is frequency (TYPE=FREQ).
For more information about these statistics, see “About Chart Statistics” on page 745.
See also the descriptions of the SUMVAR= and TYPE= options for the PLOT statement.
Frequency
The frequency statistic is the total number of observations in the data set for each
midpoint. For example, seven observations of the bar variable, CITY, contain the value
Denver, so the frequency for the Denver midpoint is 7.
Cumulative Frequency
The cumulative frequency statistic adds the frequency for the current midpoint to the
frequency of all of the preceding midpoints. For example, the frequency for the Denver
746 About Chart Statistics Chapter 28
midpoint is 7, and the frequency for the next midpoint, Seattle, is 9, so the cumulative
frequency for Seattle is 16.
Percentage
The percentage statistic is calculated by dividing the frequency for each midpoint by
the total frequency count for all midpoints in the chart or group and multiplying it by
100. For example, the frequency count for the Denver midpoint is 7 and the total
frequency count for the chart is 21, so the percentage statistic for Denver is 33.3%.
Cumulative Percentage
The cumulative percentage statistic adds the percentage for the current midpoint to
the percentage for all of the preceding midpoints in the chart or group. For example,
the percentage for the Denver midpoint is 33.3, and the percentage for the next
midpoint, Seattle, is 42.9, so the cumulative percentage for Seattle is 76.2.
Sum
The sum statistic is the total of the values, for each midpoint, for the variable
specified by the SUMVAR= option. For example, if you specify SUMVAR=SALES and
the values of the SALES variable for the seven Denver observations are 8734, 982,
1504, 3207, 4502, 624, and 918, the sum statistic for the Denver midpoint is 20,471.
You must use the SUMVAR= option to specify the variable for which you want the
sum statistic.
Mean
The mean statistic is the average of the values, for each midpoint, for the variable
specified by the SUMVAR= option. For example, if TYPE=MEAN and
SUMVAR=SALES, the mean statistic for the Denver midpoint is 2924.42.
You must use the SUMVAR= option to specify the variable for which you want the
mean statistic.
Value of COUNT Value of HEIGHT Number of times the Value used for
observation is used HEIGHT
1 55 1 55
5 65 5 325
. 63 0 -
-3 60 0 -
By default, the percentage and cumulative percentage statistics are calculated based
on the frequency. If you want to graph a percentage or cumulative percentage based on
a sum, then you can use the FREQ= option to specify a variable to use for the "sum"
calculation and specify the PCT statistic, as shown in this example:
freq=count type=pct
Because the variable that is specified by the FREQ= option determines the number of
times an observation is counted, the value of COUNT is the equivalent of the sum
statistic.
See also the descriptions of the TYPE=, SUMVAR=, and FREQ= options.
Missing Values
By default, the GBARLINE procedure ignores missing midpoint values for the bar
variable. If you specify the MISSING option, then missing values are treated as a valid
midpoint and are included on the chart.
When the value of the variable that is specified in the FREQ= option is missing, 0, or
negative, the observation is excluded from the calculation of the chart statistic.
When the value of the variable specified in the SUMVAR= option is missing, the
observation is excluded from the calculation of the chart statistic.
If the value of the plot variable is missing, then the GBARLINE procedure does not
include the observation in the plot overlay. If you specify interpolation with a SYMBOL
definition, then the plot is not broken at the missing value.
About Patterns
When a chart needs one or more patterns, the procedure uses either default patterns
and outlines that are automatically generated by SAS/GRAPH, or patterns, colors,
outlines, and images that are defined by PATTERN statements, graphics options, and
procedure options.
The following sections summarize pattern behavior for the GBARLINE procedure.
For more information, see “PATTERN Statement” on page 169.
When you use PATTERN statements, the procedure uses the specified patterns until
all of the PATTERN definitions they generate have been used. Then, if more patterns
are required, the procedure returns to the default pattern rotation.
Whenever you specify any PATTERN statement, the default pattern outline changes.
Instead of the foreground color, the outline color is the same as the fill color; for
example, a blue bar has a blue outline. The effect is the same as specifying
COUTLINE=SAME. Even when the procedure runs out of user-defined patterns and
generates default patterns, the outlines continue to match the interior pattern color.
To change the outline color of any pattern, whether it’s a default or user-defined
pattern, use the COUTLINE= option in the BAR statement that generates the chart.
You can use the PATTERN statement to fill specified bars with specified images. For
details, see “Placing Images on the Bars of Two-Dimensional Bar Charts” on page 116.
You can also add background images. The IBACK= goption (see “IBACK” on page
317) specifies image files that fill the background area. For further information,
including a listing of recognized image file types, see “Image File Types Supported by
SAS/GRAPH” on page 106 and “Placing a Background Image” on page 113.
Version 6 Patterns
If you specify the V6COMP graphics option, then the procedure generates patterns
by rotating the appropriate Version 6 default patterns through all of the colors in the
colors list. With V6COMP, all patterns are outlined in the same color as the fill.
Note: The V6COMP graphics option is not supported by ActiveX for graphs
generated by the GBARLINE procedure. 4
Procedure Syntax
Requirements:
One BAR statement
Syntax
PROC GBARLINE < DATA=input-data-set>
<ANNOTATE=Annotate-data-set>
<IMAGEMAP=output-data-set>;
Options
PROC GBARLINE statement options affect all graphs produced by the procedure.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GBARLINE
procedure. To annotate individual graphs, use the ANNOTATE= option in the BAR
statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
DATA=input-data-set
specifies the SAS data set that contains the variable(s) to chart. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29 and “About the Bar Variable” on page 742
IMAGEMAP=output-data-set
creates a temporary SAS data set that is used to generate an image map in an
HTML output file. The information in the image map data set includes the shape
and coordinates of the elements in the graph and drill-down URLs that have been
associated with those elements. The drill-down URLs are provided by one or two
variables in the input data set. These variables are identified to the GBARLINE
procedure with the HTML= option.
The %IMAGEMAP macro generates the image map in the HTML output file. The
macro takes two arguments, the name of the image map data set and the name or
fileref of the HTML output file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
The GBARLINE Procedure BAR Statement 751
BAR Statement
Creates vertical bar charts in which the height of the bars represents the value of the bar statistic
for each category of data.
Requirements: One bar variable is required.
Global statements: AXIS, FOOTNOTE, PATTERN, TITLE
Supports: Drill-down functionality
Not supported by: Java
Description
The BAR statement specifies the variable that defines the categories of data to chart.
These statements automatically
3 determine the midpoints
3 calculate the bar statistic for each midpoint (the default is FREQ)
3 scale the response axis and the bars according to the statistic value
3 determine bar width and spacing
3 assign patterns to the bars; the default bar pattern is SOLID
3 draw a frame around the axis area using the first color in the colors list.
You can use statement options to select or order the midpoints (bars), to control the
tick marks on the response axis, to change the type of bar statistic, to display specific
statistics, and to modify the appearance of the chart. You can also specify additional
variables by which to sum the data.
In addition, you can
3 use global statements to modify the axes and the bar patterns. See Chapter 7,
“SAS/GRAPH Statements,” on page 121 for more information.
3 add titles and footnotes to the chart. See “TITLE, FOOTNOTE, and NOTE
Statements” on page 210 for more information.
3 use an Annotate data set to enhance the chart. See Chapter 24, “Using Annotate
Data Sets,” on page 587 for more information.
3 display an image in the background of the chart. See “IBACK” on page 317 for
more information.
3 display images in the bars of the chart. See the IMAGE= option on page 171 for
the PATTERN statement.
Syntax
BAR bar-variable < /option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ANNOTATE=Annotate-data-set
CAUTOREF=reference-line-color
CAXIS=axis-color
CERROR=error-bar-color
CFRAME=background-color
COUTLINE=bar-outline-color | SAME
752 BAR Statement Chapter 28
CREF=reference-line-color|(reference-line-color)|reference-line-color-list
CTEXT=text-color
FRAME | NOFRAME
FRONTREF
LAUTOREF=reference-line-type
LREF=reference-line-type|(reference-line-type)|reference-line-type-list
PATTERNID=BY|MIDPOINT
SPACE=bar-spacing
WIDTH=bar-width
WOUTLINE=bar-outline-width
3 statistic options
CFREQ
CLM=confidence-level
CPERCENT
ERRORBARS=BARS | BOTH | TOP
FREQ
FREQ=numeric-variable
INSIDE=statistic
MEAN
OUTSIDE=statistic
PERCENT
SUM
SUMVAR=summary-variable
TYPE=statistic
3 midpoint options
DISCRETE
LEVELS=number-of-midpoints
MIDPOINTS=value-list
MIDPOINTS=OLD
MISSING
3 axes options
ASCENDING
AUTOREF
AXIS=AXIS<1...99>
CLIPREF
DESCENDING
MAXIS=AXIS<1...99>
MINOR=number-of-minor-ticks
NOAXIS
NOBASEREF
NOZERO
RANGE
RAXIS=value-list | AXIS<1...99>
REF=value-list
3 catalog entry description options
The GBARLINE Procedure BAR Statement 753
DESCRIPTION=’entry-description’
NAME=’string’
3 ODS options
HTML=variable
Required Arguments
bar-variable
specifies the variable that defines the categories of data to chart. The variable must
be in the input data set.
See also: “About the Bar Variable” on page 742
Options
Options in the BAR statement affect all graphs that are produced by that statement.
You can specify as many options as you want and list them in any order. For details on
specifying colors, see Chapter 6, “SAS/GRAPH Colors and Images,” on page 91. For
details on specifying images, see “Specifying Images in SAS/GRAPH Programs” on page
106. For a complete description of the graphics options, see Chapter 8, “Graphics
Options and Device Parameters Dictionary,” on page 261.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts produced by the BAR statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
ASCENDING
arranges the bars in ascending order of the value of the bar statistic. By default,
bars are arranged in ascending order of midpoint value, without regard to the
lengths of the bars. ASCENDING reorders the bars from shortest to longest. The
ordering is left to right.
ASCENDING overrides any midpoint order specified in the MIDPOINTS= option or
specified in the ORDER= option in an AXIS statement assigned to the midpoint axis.
AUTOREF
draws a reference line at each major tick mark on the chart (left) response axis. To
draw reference lines at specific points on the response axis, use the REF= option.
By default, reference lines are drawn in front of the bars. To draw reference lines
behind the bars, use the CLIPREF option.
AXIS=AXIS<1...99>
See RAXIS= on page 761.
CAUTOREF=reference-line-color
specifies the color of reference lines drawn at major tick marks, as determined by the
AUTOREF option. The default color is either the value of the CAXIS= option or the
first color in the color list. To specify a line type for these reference lines, use the
LAUTOREF= option.
CAXIS=axis-color
specifies a color for the response and midpoint axis lines and for the default axis area
frame. If you omit the CAXIS= option, PROC GBARLINE searches for a color
specification in this order:
1 the COLOR= option in AXIS definitions
754 BAR Statement Chapter 28
specifies colors for reference lines. Specifying a single color without parentheses
applies that color to all reference lines, including lines drawn with the AUTOREF
and REF= options. The CAUTOREF= option overrides the CREF= reference line
color for reference lines drawn with the AUTOREF option. Specifying a single color
in parentheses applies that color only to the first reference line drawn with the REF=
option. Specifying a reference color list applies colors in sequence to successive lines
drawn with the REF= option. The syntax of the color list is of the form (color1 color2
...colorN) or (color1, color2 ..., colorN). The default color for reference lines is either
the value of the CAXIS= option or the first color in the color list. To specify line types
for these reference lines, use the LREF= option.
CTEXT=text-color
specifies the color of all text on the chart that is not otherwise assigned a color. Text
includes axis values and axis labels in the response and midpoint axes; and the
displayed statistics. For the ActiveX device, the default color is black. For other
devices, if you omit the CTEXT= option, PROC GBARLINE searches for a color
specification in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the first color in the colors list (the default).
The CTEXT= option overrides the color specification for the axis label and the tick
mark values in the COLOR= option in an AXIS definition assigned to an axis.
The CTEXT= option is overridden by the COLOR= suboption of a LABEL= or
VALUE= option in an AXIS definition assigned to an axis. In this case the suboption
determines the color of the axis label or the color of the tick mark values, respectively.
DESCENDING
arranges the bars in descending order of the value of the bar statistic. By default,
bars are arranged in ascending order of midpoint value, without regard to the
lengths of the bars. DESCENDING reorders the bars from longest to shortest. The
ordering is left to right.
DESCENDING overrides any midpoint order that is specified with the
MIDPOINTS= option or that is specified in the ORDER= option in an AXIS
statement assigned to the midpoint axis.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
the entry-description is 256 characters. The description does not appear on the chart.
By default, the GBARLINE procedure assigns a description of the form GBARLINE
CHART OF variable, where variable is the name of the bar variable.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. Refer to the description of the options on page 222 and to
“Substituting BY Line Values in a Text String” on page 226. The 256-character limit
applies before the substitution takes place for these options; thus, if in the SAS
program the entry-description text exceeds 256 characters, it is truncated to 256
characters, and then the substitution is performed.
The descriptive text is shown in each of the following:
3 the "description" portion of the Results window
3 the catalog-entry properties that you can view from the Explorer window
3 the Table of Contents that is generated when you use CONTENTS= on an ODS
statement (see “Linking to Output through a Table of Contents” on page 495),
assuming the GBARLINE output is generated while the contents page is open
3 the Description field of the PROC GREPLAY window.
756 BAR Statement Chapter 28
DISCRETE
treats a numeric bar variable as a discrete variable rather than as a continuous
variable. The GBARLINE procedure creates a separate midpoint and, hence, a
separate bar for each unique value of the bar variable. If the bar variable has a
format associated with it, then each formatted value is treated as a midpoint.
The LEVELS= option is ignored when you use DISCRETE. The MIDPOINTS=
option overrides DISCRETE. The ORDER= option in an AXIS statement that is
assigned to the midpoint axis can rearrange or exclude discrete midpoint values.
ERRORBAR=BARS | BOTH | TOP
draws confidence intervals for either of the following:
3 the mean of the SUMVAR= variable for each midpoint if you specify
TYPE=MEAN
3 the percentage of observations assigned to each midpoint if you specify
TYPE=PCT with no SUMVAR= option.
The ERRORBAR= option cannot be used with values of the TYPE= option other than
MEAN or PCT. Valid values for ERRORBAR= are:
BARS
draws error bars as bars half the width of the main bars.
BOTH
draws error bars as two ticks joined by a line (default).
TOP
draws the error bar as a tick for the upper confidence limit that is joined to the top
of the bar by a line.
By default, ERRORBAR= uses a confidence level of 95 percent. You can specify
different confidence levels with the CLM= option.
When you use ERRORBAR= with TYPE=PCT, the confidence interval is based on
a normal approximation. Let TOTAL be the total number of observations, and PCT
be the percentage assigned to a given midpoint. The standard error of the percentage
is approximated as
APSTDERR=100 * SQRT((PCT/100) * (1--(PCT/100)) / TOTAL);
Let LEVEL be the confidence level specified using the CLM= option, with a default
value of 95. The upper confidence limit for the percentage is computed as
UCLP = PCT + APSTDERR * PROBIT( 1-(1-LEVEL/100)/2 );
When you use ERRORBAR= with TYPE=MEAN, the sum variable must have at
least two non-missing values for each midpoint. Let N be the number of observations
assigned to a midpoint, MEAN be the mean of those observations, and STD be the
standard deviation of the observations. The standard error of the mean is computed
as
STDERR = STD / SQRT(N);
Let LEVEL be the confidence level specified using the CLM= option, with a default
value of 95. The upper confidence limit for the mean is computed as
UCLM = MEAN + STDERR * TINV( 1-(1-LEVEL/100)/2, N-1);
If you want the error bars to represent a given number C of standard errors
instead of a confidence interval, and if the number of observations assigned to each
midpoint is the same, then you can find the appropriate value for the CLM= option
by running a DATA step. For example, if you want error bars that represent one
standard error (C=1) with a sample size of N , you can run the following DATA step
to compute the appropriate value for the CLM= option and assign that value to a
macro variable &LEVEL:
data null;
c = 1;
n = 10;
level = 100 * (1 - 2 * (1 - probt( c, n-1)));
put all;
call symput(’level’,put(level,best12.));
run;
Then when you run the GBARLINE procedure, you can specify CLM=&LEVEL.
Note that this trick does not work precisely if different midpoints have different
numbers of observations. However, choosing an average value for N may yield
sufficiently accurate results for graphical purposes if the sample sizes are large or do
not vary much.
FRAME | NOFRAME
FR | NOFR
specifies whether the axis area frame is drawn. The default is FRAME, which draws
a frame around the axis area. Specifying NOFRAME removes the axis area frame,
including any background color or image. To remove one or more axis elements, use
either the AXIS statement or the NOAXIS option.
The NOFRAME option overrides the CFRAME= option and “IBACK” on page 317.
The color of the frame or backplane outline is the color of the midpoint axis, which
is determined by the CAXIS= option.
If the V6COMP graphics option is in effect, the default value for GRSEGs is
NOFRAME. See “Version 6 Patterns” on page 749 for more information.
FREQ
displays the frequency statistic above the bars. Non-integer values are rounded down
to the nearest integer. A maximum of two statistics can be printed. This option is
ignored if the bars are too narrow to avoid overlapping values. This option overrides
the CFREQ, PERCENT, CPERCENT, SUM, and MEAN options.
See also:“About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
FREQ=numeric-variable
specifies a variable whose values weight the contribution of each observation in the
computation of the bar statistic. Each observation is counted the number of times
that is specified by the value of numeric-variable for that observation. If the value of
numeric-variable is missing, 0, or negative, then the observation is not used in the
statistic calculation. Non-integer values of numeric-variable are truncated to
integers. The FREQ= option is valid with all bar statistics.
Because you cannot use TYPE=PERCENT, TYPE=CPERCENT, TYPE=FREQ, or
TYPE=CFREQ with the SUMVAR= option, you must use the FREQ= option to
calculate percentages, cumulative percentages, frequencies, or cumulative
frequencies based on a sum.
The statistics will not be affected by applying a format to numeric-variable.
Not supported by: ActiveX, Java
See also: “Calculating Weighted Statistics” on page 746
758 BAR Statement Chapter 28
FRONTREF
specifies that reference lines drawn by the AUTOREF or REF= options should be
drawn in front of the bars.
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS statement. These links are associated with the bars and
point to the data or graph you wish to display when the user drills down on the area.
The values of variable can be up to 1024 characters long. Characters after the
1024-character limit (including any closing quotes) are truncated.
INSIDE=statistic
displays the values of the specified statistic inside the bars. Statistic can be one of
the following:
3 FREQ
3 CFREQ
3 PERCENT | PCT
3 CPERCENT | CPCT
3 SUM
3 MEAN
To display statistics with INSIDE=SUM or INSIDE=MEAN, you must also specify
the SUMVAR= option.
See also: “About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
LAUTOREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks, as specified by the
AUTOREF option. The reference-line-type value can be a whole number from 1 to 46.
A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The
default value 1 draws a solid line. To specify colors for these reference lines, use the
CAUTOREF= option.
LEVELS=number-of-midpoints
specifies the number of midpoints for a numeric bar variable. The range for each
midpoint is calculated automatically, using the algorithm in Terrell and Scott (1985).
The LEVELS= option is ignored if
3 the bar variable is character type
3 the DISCRETE option is used
3 the MIDPOINTS= option is used.
Featured in: Example 1 on page 768
LREF=reference-line-type|( reference-line-type|reference-line-type-list)
LR=reference-line-type|( reference-line-type|reference-line-type-list)
specifies line types for reference lines. Line types are specified as whole numbers
from 1 to 46, with 1 representing a solid line and the other values representing
dashed lines. Specifying a line type without parentheses applies that type to all
reference lines drawn with the AUTOREF and REF= options. Note that the
LAUTOREF= option overrides LREF=reference-line-type for reference lines drawn
with the AUTOREF option. Specifying a single line type in parentheses applies that
line type to the first reference line drawn with the REF= option. Specifying a line
type list applies line types in sequence to successive reference lines drawn with the
REF= option. The syntax of the line-type list is of the form (type1 type2 ...typeN). The
default line type is specified by the AXIS statement’s STYLE= option. By default,
STYLE=1, a solid line. To specify colors for these reference lines, use the CREF=
option.
The GBARLINE Procedure BAR Statement 759
MAXIS=AXIS<1...99>
assigns the specified AXIS definition to the midpoint axis. The MAXIS= option is
ignored if the specified AXIS definition does not exist.
See also: “AXIS Statement” on page 124 and “About Midpoints” on page 742
MEAN
displays the mean statistic above the bars. A maximum of two statistics can be
printed. This option is ignored if the bars are too narrow to avoid overlapping values
or if the FREQ, CFREQ, PERCENT, CPERCENT, or SUM option is specified. MEAN
is ignored unless you also use the SUMVAR= option.
See also:“About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
MIDPOINTS=value-list
specifies the midpoint values for the bars. The way you specify value-list depends on
the type of the bar variable.
3 For numeric bar variables, value-list is either an explicit list of values, or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
n<...n> TO n <BY increment> <n <...n>>
If a numeric variable has an associated format, the specified values must be
the unformatted values.
By default, numeric variable values are treated as continuous (if you omit the
DISCRETE option), and
3 the lowest midpoint consolidates all data points from negative infinity to
the median of the first two midpoints
3 the highest midpoint consolidates all data points from the median of the
last two midpoints up to infinity
3 all other values in value-list specify the median of a range of values, and
the GBARLINE procedure calculates the midpoint values.
If you include the DISCRETE option, then each value in value-list specifies a
unique numeric value.
3 For character bar variables, value-list is a list of unique character values
enclosed in quotation marks and separated by blanks:
’value-1’ <...’value-n’>
If a character variable has an associated format, the specified values must be
the formatted values.
For a complete description of value-list, see ORDER= on page 130.
If the value-list for either type of variable specifies so many midpoints that the
axis values overwrite each other, then the values may be unreadable. In this case the
procedure writes a warning to the SAS log. On many devices, this problem can be
corrected by either adjusting the size of the text with the HTEXT= graphics option or
by increasing the number of cells in your graphics display using the HPOS= and
VPOS= graphics options.
The ORDER= option in the AXIS statement overrides the order specified in the
MIDPOINTS= option. The BAR statement options ASCENDING and DESCENDING
also override both the MIDPOINTS= and ORDER= options in the AXIS statement.
See also: “About Midpoints” on page 742
760 BAR Statement Chapter 28
MIDPOINTS=OLD
generates default midpoints using the Nelder algorithm (Applied Statistics 25:94–7,
1976). The MIDPOINTS=OLD option is ignored unless the bar variable is numeric.
MINOR=number-of-minor-ticks
specifies the number of minor tick marks between each major tick mark on the bar
response axis.
The MINOR= option in a bar chart statement overrides the number of minor tick
marks specified in the MINOR= option in an AXIS definition assigned to the
response axis with the RAXIS= option.
MISSING
accepts a missing value as a valid midpoint for the bar variable. By default,
observations with missing values are ignored.
NAME=’string’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GBARLIN. If the name
duplicates an existing entry name, then SAS/GRAPH software uses a number to
generate a unique name—for example, GBARLIN1.
NOAXIS
suppresses all axes, including axis lines, axis labels, axis values, and all major and
minor tick marks. If you specify an axis definition with the MAXIS= or RAXIS=
options, then the axes are generated as defined in the AXIS statement, but then all
lines, labels, values, and tick marks are suppressed. Therefore, axis statement
options such as ORDER=, LENGTH=, and OFFSET= will still be used.
To remove only selected axis elements such as lines, values, or labels, use specific
AXIS statement options.
NOAXIS does not suppress either the default frame or an axis area fill requested
by the CFRAME= option. To remove the axis frame, use the NOFRAME option in the
procedure.
NOBASEREF
suppresses the zero reference line when the SUM or MEAN bar statistic has negative
values.
NOZERO
suppresses any midpoints for which there are no corresponding values of the bar
variable and, hence, no bar.
Note: If a bar is omitted and if you have also specified bar labels with the
VALUE= option in an AXIS statement, then the labels can be shifted and not
displayed with the correct bar. 4
OUTSIDE=statistic
displays the values of the specified statistic above the bars. Statistic can be one of
the following:
3 FREQ
3 CFREQ
3 PERCENT | PCT
3 CPERCENT | CPCT
3 SUM
3 MEAN
To display statistics with OUTSIDE=SUM or OUTSIDE=MEAN, you must also
specify the SUMVAR= option.
The GBARLINE Procedure BAR Statement 761
See also:“About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
PATTERNID=BY | MIDPOINT
specifies the way fill patterns are assigned. By default, PATTERNID=MIDPOINT.
Values for PATTERNID= are as follows:
BY
changes patterns each time the value of the BY variable changes. All bars use the
same pattern if the GBARLINE procedure does not include a BY statement.
MIDPOINT
changes patterns every time the midpoint value changes.
See also: “Controlling Bar Line Chart Patterns, Colors, and Images” on page 764
PERCENT
PCT
displays the percentages of observations having a given value for the bar variable
above the bars. A maximum of two statistics can be printed. This option is ignored if
the bars are too narrow to avoid overlapping values or if the FREQ or CFREQ option
is specified.
See also:“About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
RANGE
displays on the axis of the chart the range of numeric values represented by each
bar. In the graphics output, the less-than symbol (<) and the less-than-or-equal-to
symbol (<=) are used to accurately specify the starting and ending values of each
range. The RANGE option has no affect on axes that represent character data. By
default, the values shown on the axis are determined by the value of the
MIDPOINTS= option on page 759. If specified, the DISCRETE option on page 756
overrides the RANGE option.
RAXIS=value-list | AXIS<1...99>
AXIS=value-list | AXIS<1...99>
specifies values for the major tick mark divisions on the response axis or assigns the
specified AXIS definition to the axis. See the MIDPOINTS= option on page 759 for a
description of value-list. By default, the GBARLINE procedure scales the response
axis automatically and provides an appropriate number of tick marks.
You can specify negative values, but negative values are reasonable only when
TYPE=SUM or TYPE=MEAN and one or more of the sums or means are less than 0.
Frequency and percentage values are never less than 0.
For lists of values, a separate major tick mark is created for each individual value.
A warning message is written to the SAS log if the values are not evenly spaced.
If the values represented by the bars are larger than the highest tick mark value,
then the bars are truncated at the highest tick mark.
See also: “AXIS Statement” on page 124
REF=value-list
draws reference lines at the specified points on the bar response axis. See the
MIDPOINTS= option on page 759 for a description of value-list.
Values can be listed in any order, but should be within the range of values
represented by the response axis. A warning is written to the SAS log if any of the
points are off of the axis, and no reference line is drawn for such points. You can use
the AUTOREF option to draw reference lines automatically at all of the major tick
marks.
762 BAR Statement Chapter 28
SPACE=bar-spacing
specifies the amount of space between individual bars. Bar-spacing can be any
non-negative number, including decimal values. Units are character cells. By
default, the GBARLINE procedure calculates spacing based on the size of the axis
area and the number of bars on the chart. Use SPACE=0 to leave no space between
adjacent bars.
The SPACE= option is ignored if the specified spacing requests a chart that is too
large to fit in the space available for the midpoint axis, and a warning message is
issued.
SUM
displays the sum statistic above the bars. A maximum of two statistics can be
printed. This option is ignored if the bars are too narrow to avoid overlapping values
or if the FREQ, CFREQ, PERCENT, or CPERCENT option is specified. SUM is
ignored unless you also use the SUMVAR= option.
See also: “About Chart Statistics” on page 745 and “Displaying Statistics In Bar
Line Charts” on page 763
SUMVAR=summary-variable
specifies a numeric variable for sum or mean calculations. The GBARLINE
procedure calculates the sum or, if requested, the mean of summary-variable for each
midpoint. The resulting statistics are represented by the length of the bars along the
response axis, and they are displayed at major tick marks.
When you use the SUMVAR= option, the TYPE= option must be either SUM or
MEAN. With the SUMVAR= option, the default is TYPE=SUM.
Featured in: Example 1 on page 768
TYPE=statistic
specifies the bar statistic.
3 If the SUMVAR= option is not used, statistic can be one of the following:
FREQ
frequency (the default)
CFREQ
cumulative frequency
PERCENT PCT
percentage
CPERCENT CPCT
cumulative percentage
3 If the SUMVAR= option is used, statistic can be:
SUM
sum (the default)
MEAN
mean
Because you cannot use TYPE=FREQ, TYPE=CFREQ, TYPE=PERCENT, or
TYPE=CPERCENT with the SUMVAR= option, you must use the FREQ= option to
calculate percentages, cumulative percentages, frequencies, or cumulative
frequencies based on a sum. See also “Calculating Weighted Statistics” on page 746.
See also: “About Chart Statistics” on page 745 for a complete description of statistic
types
WIDTH=bar-width
specifies the width of the bars. By default, the GBARLINE procedure selects a bar
width that accommodates the midpoint values displayed on the midpoint axis using a
The GBARLINE Procedure BAR Statement 763
hardware font and a height of one cell. Units for bar-width are character cells. The
value for bar-width must be greater than 0, but it does not have to be an integer, for
example,
bar site / width=1.5;
If the requested bar width results in a chart that is too large to fit in the space
available for the midpoint axis, then the procedure issues a warning in the log and
ignores the WIDTH= specification. If the specified width is too narrow, the procedure
may display the midpoint values vertically.
WOUTLINE=bar-outline-width
specifies the width of the bar outline in pixels.
number of midpoints for numeric variables may change the range of values for
individual midpoints, it does not change the range of values for the chart as a whole.
For details, see “About Midpoints” on page 742.
Like the MIDPOINTS= option, the ORDER= option in the AXIS statement can
rearrange the order of the midpoints or suppress the display of discrete numeric or
character values. However, the ORDER= option cannot calculate the midpoints for a
continuous numeric variable, or exclude values from the calculations. For details, see
the description of the ORDER= option on page 130.
User-Defined Patterns
To override the default patterns and select fills and colors for the bars, use the
PATTERN statement. Only solid and empty bar patterns are valid; all other pattern
fills are ignored. For a complete description of all bar patterns, see the VALUE= option
on page 171.
Whenever you use PATTERN statements, the default pattern outline color changes to
SAME. That is, the outline color is the same as the fill color. To specify the outline
color, use the COUTLINE= option (see COUTLINE= on page 754).
Axis Color
By default, axis elements use the first color in the colors list or the colors that are
specified by AXIS statement color options. However, BAR statement options can also
control the color of the axis lines, text, and frame.
PLOT Statement
Creates a plot overlay on top of the bar line chart.
Requirements: If specified, the PLOT statement must be specified after the BAR
statement.
Global statements: AXIS, FOOTNOTE, PATTERN, SYMBOL, TITLE
Supports: Drill-down functionality
Not supported by: Java
Description
The PLOT statement specifies one plot request. This statement automatically
3 scales the plot response (right) axis to include the maximum and minimum data
values
3 plots data points within the axis
3 labels the plot response axis with the name of its variable and displays each major
tick mark value.
You can use statement options to specify a plot variable, manipulate the plot
response axis, modify the appearance of your graph, and describe catalog entries. You
can use SYMBOL definitions to modify plot symbols for the data points, join data
points, or specify other types of interpolations. For more information on the SYMBOL
statement, see “SYMBOL Statement” on page 183.
In addition, you can use global statements to modify the axis, or add titles, footnotes,
and notes to the plot.
Syntax
PLOT </options(s)>;
The PLOT statement is optional, but if specified, it must follow the BAR statement.
If you do not specify a PLOT statement, GBARLINE generates only a bar chart and
duplicates the bar response axis (left axis) as the plot response axis (right axis).
To specify a variable to plot, use the SUMVAR= option. If you do not specify a plot
variable, GBARLINE uses the bar variable as the plot variable. For more information,
see “About the Plot Variable” on page 745 and the description of the SUMVAR= option.
option(s) can be one or more options from any or all of the following categories:
3 appearance options:
NOLINE
NOMARKER
766 PLOT Statement Chapter 28
3 statistic options:
CFREQ
CPERCENT
FREQ
FREQ=numeric-variable
MEAN
PERCENT
SUM
SUMVAR=plot-variable
TYPE=statistic
3 axes options:
ASCENDING
AXIS=AXIS<1...99>
DESCENDING
RAXIS=value-list | AXIS<1...99>
MINOR=number-of-minor-ticks
3 ODS options:
HTML=variable
Options
You can specify as many options as you want and list them in any order.
ASCENDING
joins the plot points in ascending order of the value of the plot statistic. By default,
data points are joined in ascending order of the midpoint value.
AXIS=AXIS<1...99>
See RAXIS= on page 767.
DESCENDING
joins the plot points in descending order of the value of the plot statistic. By default,
plot points are arranged in ascending order of the midpoint value.
FREQ=numeric-variable
specifies a variable whose values weight the contribution of each observation in the
computation of the plot statistic. Each observation is counted the number of times
that is specified by the value of numeric-variable for that observation. If the value of
numeric-variable is missing, 0, or negative, then the observation is not used in the
statistic calculation. Non-integer values of numeric-variable are truncated to
integers. The FREQ= option is valid with all plot statistics.
Because you cannot use TYPE=PERCENT, TYPE=CPERCENT, TYPE=FREQ, or
TYPE=CFREQ with the SUMVAR= option, you must use the FREQ= option to
calculate percentages, cumulative percentages, frequencies, or cumulative
frequencies based on a sum.
The statistics will not be affected by applying a format to numeric-variable.
Not supported by: ActiveX, Java
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS statement. These links are associated with the plot points.
The links point to the data or graph that you wish to display when the user drills
down on the plot point or area. The values of variable can be up to 1024 characters
The GBARLINE Procedure PLOT Statement 767
long. Characters after the 1024-character limit (including any closing quotes) are
truncated.
PERCENT PCT
percentage
CPERCENT CPCT
cumulative percentage
3 If SUMVAR= is used, statistic can be one of the following:
SUM
sum (the default)
MEAN
mean
Because you cannot use TYPE=FREQ, TYPE=CFREQ, TYPE=PERCENT, or
TYPE=CPERCENT with SUMVAR=, you must use FREQ= to calculate percentages
or frequencies based on a sum.
See also: “About Chart Statistics” on page 745 and “Calculating Weighted
Statistics” on page 746
Examples
FORMAT statement
STYLE= option on the ODS statement
Sample library member: GBLSTOCK
This example produces a basic bar line graph showing the volume and closing price
for each of five days of trading activity on the New York Stock Exchange. The vertical
bars indicate the volume, and the overlay plot graphs the closing price. It uses the ODS
style ANALYSIS.
Set the graphics environment. Some graphics options may override style attributes, so if you
are using a style, specify the minimum goptions needed by your graph.
Define the odsout fileref. Specify the path of the HTML file where you want ODS to write the
output.
Open the HTML output destination and specify the ANALYSIS style.
Create the data set NYSE. NYSE contains one observation for each of five workdays. Each
observation includes the date, closing price, and volume.
data nyse;
informat day date9.;
format day date5.;
input day $ high low close volume;
770 Example 2: Calculating Weighted Statistics Chapter 28
volume=volume/1000;
datalines;
02AUG2002 10478.76 10346.24 10426.91 1908809
03AUG2002 11042.92 10298.44 10274.65 1807543
04AUG2002 10498.22 10400.31 10456.43 1500656
05AUG2002 10694.47 10636.32 10762.98 1498403
06AUG2002 10801.12 10695.13 10759.48 1695602
;
run;
Produce the bar line graph. The SUMVAR= option on the BAR statement specifies the
variable whose values determine the height of the bars. The DISCRETE option creates a
separate midpoint for each unique value of the bar variable. The SUMVAR= option on the PLOT
statement specifies the variable whose values are used to calculate the overlay plot.
Close the ODS HTML destination. You must close the HTML destination before you can view
the output with a browser.
This example uses the FREQ= option to calculate weighted statistics for the overlay
plot. During the manufacture of a metal-oxide semiconductor (MOS) capacitor, two
different cleaning processes were used by two manufacturing systems that were
operating in parallel. Process A used a standard cleaning solution, while Process B
used a different cleaning mixture that contained less particulate matter. For five
consecutive days, the causes of failure with each process were recorded.
Create the data set FAILURE. Each observation specifies the manufacturing process that
resulted in the defect, the date, the cause of the defects, and the total number of defects for that
date. Each observation also contains a variable, COST, that specifies the cost associated with
that type of defect.
data failure;
label cause = ’Cause of Failure’ ;
input process $ 1-9 day $ 13-19 cause $ 23-36 count 40-41;
datalines;
Process A March 1 Contamination 15
Process A March 1 Corrosion 2
Process A March 1 Doping 1
Process A March 1 Metallization 2
...more data lines...
Process B March 5 Metallization 0
Process B March 5 Miscellaneous 1
772 Example 2: Calculating Weighted Statistics Chapter 28
data failure;
set failure;
if cause=’Contamination’ then cost=3.5;
else if cause=’Metallization’ then cost=10;
else if cause=’Oxide Defect’ then cost=10.5;
else if cause=’Corrosion’ then cost=4.5;
else if cause=’Doping’ then cost=3.6;
else if cause=’Silicon Defect’ then cost=5.4;
else cost=1.0;
output;
run;
AXIS1 label=("Defects");
AXIS2 label=("Total Cost");
Specify the symbol, color, and symbol size to use for the overlay plot.
Produce the bar line graph. The SUMVAR= option on the BAR statement specifies the
variable that determines the height of the bars. The SUMVAR= option on the PLOT statement
specifies the plot variable. GBARLINE multiplies the value of the FREQ= variable by the value
of the COUNT variable, and uses the result to determine the plot points.
CHAPTER
29
The GCHART Procedure
Overview 774
About Block Charts 774
About Bar Charts 775
About Pie, Detail Pie, and Donut Charts 776
About Star Charts 777
Concepts 778
About Chart Variables 779
Missing Values 779
About Midpoints 780
Character Values 780
Discrete Numeric Values 780
Continuous Numeric Values 781
Selecting and Ordering Midpoints 781
About Chart Statistics 782
Frequency 782
Cumulative Frequency 782
Percentage 782
Cumulative Percentage 783
Sum 783
Mean 783
Calculating Weighted Statistics 783
About Patterns 784
Default Patterns and Outlines 784
User-Defined Patterns, Outlines, and Images 785
Version 6 Patterns 785
Procedure Syntax 785
PROC GCHART Statement 786
BLOCK Statement 787
HBAR, HBAR3D, VBAR, and VBAR3D Statements 796
PIE, PIE3D, and DONUT Statements 818
STAR Statement 833
Examples 842
Example 1: Specifying the Sum Statistic in a Block Chart 842
Example 2: Grouping and Subgrouping a Block Chart 844
Example 3: Specifying the Sum Statistic in Bar Charts 846
Example 4: Subgrouping a 3D Vertical Bar Chart 848
Example 5: Controlling Midpoints and Statistics in a Horizontal Bar Chart 850
Example 6: Generating Error Bars in a Horizontal Bar Chart 854
Example 7: Creating Bar Charts with Drill-down for the Web 856
Example 8: Specifying the Sum Statistic for a Pie Chart 869
Example 9: Subgrouping a Donut or Pie Chart 872
774 Overview Chapter 29
Overview
The GCHART procedure produces six types of charts: block charts, horizontal and
vertical bar charts, pie and donut charts, and star charts. These charts graphically
represent the value of a statistic calculated for one or more variables in an input SAS
data set. The charted variables can be either numeric or character.
The procedure calculates these statistics:
3 frequency or cumulative frequency counts
3 percentages or cumulative percentages
3 sums
3 means.
Use the GCHART procedure to
3 display and compare exact and relative magnitudes
3 examine the contribution of parts to the whole
3 analyze where data are out of balance.
The program for this chart is in Example 1 on page 842. For more information on
producing block charts, see “BLOCK Statement” on page 787.
The program for this chart is Example 3 on page 846. For more information on
producing horizontal and vertical bar charts, see “HBAR, HBAR3D, VBAR, and
VBAR3D Statements” on page 796.
Figure 29.5 on page 776 show the three-dimensional version of the same pie chart.
Figure 29.6 on page 777 shows a detail pie chart generated from the same data.
The GCHART Procedure About Star Charts 777
The programs for these charts are in Example 8 on page 869 and Example 15 on
page 883. For more information on producing pie or donut charts, see “PIE, PIE3D, and
DONUT Statements” on page 818.
The program for this chart is Example 13 on page 879. For more information on
producing star charts, see “STAR Statement” on page 833.
Concepts
The GCHART procedure produces charts based on the values of a chart variable.
These values are represented by a set of midpoints. The chart itself displays
information about the chart variable in the form of chart statistics.
Figure 29.8 on page 778 and Figure 29.9 on page 779 illustrate these terms as well
as other terms used with the GCHART procedure.
subgroups frame
table of statistics
chart variable
(midpoint axis label) summary variable
group variable
(group axis label)
group axis
midpoint axis major tick mark
value
response axis
response axis
label
type of statistic
response variable
subgroup values
legend
subgroup variable
Bar charts have two axes: a midpoint axis that shows the categories of data, and a
response axis that displays the scale of values for the chart statistic. The response axis
is divided into evenly spaced intervals identified with major tick marks that are labeled
with the corresponding statistic value. Minor tick marks are evenly distributed between
the major tick marks. Each axis is labeled with the chart variable name or label. The
response axis is also labeled with the statistic type.
The GCHART Procedure About Chart Variables 779
type of statistic
pie slice
midpoint
Pie charts show statistics based on values of a variable called the chart variable.
Generally, the values of the chart variable are represented by the slices in the chart.
Next to each pie slice a number (or character string) appears that identifies the value or
range of values assigned to that slice by the GCHART procedure. This number (or
character string) is known as the midpoint for that slice. The statistic value for each
midpoint is displayed beneath the midpoint. The slices in the chart represent all the
values of the chart variable included in the chart. The number of degrees included in
each slice represents the statistic value for the midpoint.
Missing Values
By default, the GCHART procedure ignores missing midpoint values for the chart
variable. If you specify the MISSING option, then missing values are treated as a valid
midpoint and are included on the chart. Missing values for the group and subgroup
variables are always treated as valid groups and subgroups.
When the value of the variable that is specified in the FREQ= option is missing, 0, or
negative, the observation is excluded from the calculation of the chart statistic.
780 About Midpoints Chapter 29
When the value of the variable specified in the SUMVAR= option is missing, the
observation is excluded from the calculation of the chart statistic.
About Midpoints
Midpoints are the values of the chart variable that identify categories of data. By
default, midpoints are selected or calculated by the procedure. The way the procedure
handles the midpoints depends on whether the values of the chart variable are
character, discrete numeric, or continuous numeric.
Character Values
A character chart variable generates a midpoint for each unique value of the
variable. For example, if the chart variable CITY contains the names of three different
cities, each city is a midpoint, resulting in three midpoints for the chart:
(In pie charts, midpoint values that compose a small percentage of the total for the
chart may be placed in the OTHER slice and will not produce a separate midpoint.)
By default, character midpoints are arranged in alphabetic order. If a character
variable has an associated format, the values are arranged in order of the formatted
values.
midpoints=’Tokyo’ ’Seattle’
In this case, values excluded by the option are not included in the calculation of the
chart statistic.
You can order or select discrete numeric midpoint values just as you do character
values, but you omit the quotation marks when specifying numeric values.
For continuous numeric variables, use the LEVELS= or MIDPOINTS= option to
change the number of midpoints, to control the range of values each midpoint
represents, or to change the order of the midpoints. To control the range of values each
midpoint represents, use the MIDPOINTS= option to specify the median value of each
range. For example, to select the ranges 20–29, 30–39, and 40–49, specify
midpoints=25 35 45
Alternatively, to select the number of midpoints that you want and let the procedure
calculate the ranges and medians, use the LEVELS= option.
You can also use formats to control the ranges of continuous numeric variables, but
in that case the values are no longer continuous but discrete.
Note: You cannot use the MIDPOINTS= option to exclude continuous numeric
values from the chart because values below or above the ranges specified by the option
are automatically included in the first and last midpoints, respectively. To exclude
continuous numeric values from a chart, use a WHERE statement in a DATA step or
the WHERE= DATA set option. 4
See also the description of the LEVELS= and MIDPOINTS= options for the
appropriate statement.
Frequency
The frequency statistic is the total number of observations in the data set for each
midpoint. For example, seven observations of the chart variable, CITY, contain the
value Denver, so the frequency for the Denver midpoint is 7.
Cumulative Frequency
The cumulative frequency statistic adds the frequency for the current midpoint to the
frequency of all of the preceding midpoints. For example, the frequency for the Denver
midpoint is 7, and the frequency for the next midpoint, Seattle, is 9, so the cumulative
frequency for Seattle is 16.
You cannot request cumulative frequency with the DONUT, PIE, PIE3D, or STAR
statements.
Percentage
The percentage statistic is calculated by dividing the frequency for each midpoint by
the total frequency count for all midpoints in the chart or group and multiplying it by
The GCHART Procedure About Chart Statistics 783
100. For example, the frequency count for the Denver midpoint is 7 and the total
frequency count for the chart is 21, so the percentage statistic for Denver is 33.3%.
Cumulative Percentage
The cumulative percentage statistic adds the percentage for the current midpoint to
the percentage for all of the preceding midpoints in the chart or group. For example,
the percentage for the Denver midpoint is 33.3, and the percentage for the next
midpoint, Seattle, is 42.9, so the cumulative percentage for Seattle is 76.2.
You cannot request cumulative percentage with the DONUT, PIE, PIE3D, or STAR
statements.
Sum
The sum statistic is the total of the values for the SUMVAR= variable for each
midpoint. For example, if you specify SUMVAR=SALES and the values of the SALES
variable for the seven Denver observations are 8734, 982, 1504, 3207, 4502, 624, and
918, the sum statistic for the Denver midpoint is 20,471.
You must use the SUMVAR= option to specify the variable for which you want the
sum statistic.
Mean
The mean statistic is the average of the values for the SUMVAR= variable for each
midpoint. For example, if TYPE=MEAN and SUMVAR=SALES, the mean statistic for
the Denver midpoint is 2924.42.
You must use the SUMVAR= option to specify the variable for which you want the
mean statistic.
Value of Value of Number of times the observation Value used for HEIGHT
COUNT HEIGHT is used
1 55 1 55
5 65 5 325
. 63 0 -
-3 60 0 -
784 About Patterns Chapter 29
By default, the percentage and cumulative percentage statistics are calculated based
on the frequency. If you want to chart a percentage or cumulative percentage based on
a sum, you can use the FREQ= option to specify a variable to use for the "sum"
calculation and specify the PCT statistic, as shown in this example:
freq=count type=pct
Because the variable that is used by FREQ= determines the number of times an
observation is counted, the value of COUNT is the equivalent of the sum statistic.
See also the descriptions of the TYPE=, SUMVAR=, and FREQ= options for the
action statements.
About Patterns
When a chart needs one or more patterns, the procedure uses either
3 default patterns and outlines that are automatically generated by SAS/GRAPH or
3 patterns, colors, outlines, and images that are defined by PATTERN statements,
graphics options, and procedure options.
The following sections summarize pattern behavior for the GCHART procedure. For
more information, see “PATTERN Statement” on page 169.
3 Whenever there are PATTERN definitions in effect, whether or not the GCHART
procedure can use them, the default outline color for all patterns changes from
foreground to SAME, as described in the following section.
For a description of these graphics options, see Chapter 8, “Graphics Options and
Device Parameters Dictionary,” on page 261.
Version 6 Patterns
If you specify the V6COMP graphics option, then the procedure generates patterns
by rotating the appropriate Version 6 default patterns through all of the colors in the
colors list. With V6COMP, all patterns are outlined in the same color as the fill.
Procedure Syntax
Requirements: At least one BLOCK, HBAR, HBAR3D, VBAR, VBAR3D, PIE, PIE3D,
DONUT, or STAR statement is required.
Global statements: AXIS, FOOTNOTE, GOPTIONS, LEGEND, PATTERN, TITLE
Reminder: The procedure can include the BY, FORMAT, LABEL, and WHERE
statements as well as the SAS/GRAPHNOTE statement.
Supports:
RUN-group processing
Output Delivery System (ODS)
786 PROC GCHART Statement Chapter 29
Syntax
PROC GCHART<DATA=input-data-set>
<ANNOTATE=Annotate-data-set>
<GOUT=<libref.>output-catalog>
<IMAGEMAP=output-data-set>;
Options
PROC GCHART statement options affect all graphs produced by the procedure.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GCHART
procedure. To annotate individual graphs, use ANNOTATE= in the action statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
DATA=input-data-set
specifies the SAS data set that contains the variable(s) to chart. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29 and “About Chart Variables” on page 779
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output that is produced by
the GCHART procedure. If you omit the libref, SAS/GRAPH looks for the catalog in
the temporary library called WORK and creates the catalog if it does not exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53
IMAGEMAP=output-data-set
creates a temporary SAS data set that is used to generate an image map in an
HTML output file. The information in the image map data set includes the shape
and coordinates of the elements in the graph and drill-down URLs that have been
associated with those elements. The drill-down URLs are provided by one or two
variables in the input data set. These variables are identified to the GCHART
procedure with the HTML= and/or HTML_LEGEND= options.
The GCHART Procedure BLOCK Statement 787
The %IMAGEMAP macro generates the image map in the HTML output file. The
macro takes two arguments, the name of the image map data set and the name or
fileref of the HTML file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
BLOCK Statement
Creates block charts in which the height of the blocks represents the value of the chart statistic for
each category of data.
Requirements: At least one chart variable is required.
Global statements: LEGEND, PATTERN, TITLE, FOOTNOTE
Supports: Drill-down functionality
Description
The BLOCK statement specifies the variable or variables that define the categories of
data to chart. This statement automatically
3 determines the midpoints
3 calculates the chart statistic for each midpoint (the default is FREQ)
3 scales the blocks according to the statistic value
3 assigns patterns and colors to the block faces and the grid; the default block
pattern is solid.
You can use statement options to select or order the midpoints (blocks), to change the
type of chart statistic, and to modify the appearance of the chart. You can also specify
additional variables by which to group, subgroup, or sum the data.
Block charts allow grouping, which organizes the blocks into rows based on the
values of a group variable, and subgrouping, which subdivides the blocks into segments
based on the values of a subgroup variable.
In addition, you can use global statements to modify the block patterns and the
legend, as well as add titles, footnotes, and notes to the chart. You can also use an
Annotate data set to enhance the chart.
Note: If you get a message that the chart is too large to display on your terminal or
printer, try one or both of the following: 4
3 reduce the size of the character cells defined for the output device by specifying
larger values for the HPOS= and VPOS= graphics options
3 decrease the size of the chart text with the HTEXT= graphics option.
See “About the Graphics Output Area” on page 34 for details .
Syntax
BLOCK chart-variable(s) </ option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ANNOTATE=Annotate-data-set
788 BLOCK Statement Chapter 29
BLOCKMAX=max-value
CAXIS=grid-color
COUTLINE=block-outline-color | SAME
CTEXT=text-color
LEGEND=LEGEND<1...99>
NOHEADING
NOLEGEND
PATTERNID=BY |GROUP |MIDPOINT |SUBGROUP
WOUTLINE=block-outline-width
3 midpoint options
DISCRETE
GROUP=group-variable
LEVELS=number-of-midpoints
MIDPOINTS=value-list
MIDPOINTS=OLD
MISSING
SUBGROUP=subgroup-variable
3 statistic options
FREQ=numeric-variable
G100
SUMVAR=summary-variable
TYPE=statistic
3 catalog entry description options
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
HTML_LEGEND=variable
Required Arguments
chart-variable(s)
specifies one or more variables that define the categories of data to chart. Each chart
variable draws a separate chart. All variables must be in the input data set.
Separate multiple chart variables with blanks. The values of a chart variable used
with the BLOCK statement have a maximum length of 13.
See also: “About Chart Variables” on page 779
Options
Options in a BLOCK statement affect all graphs produced by that statement. You
can specify as many options as you want and list them in any order. For details on
specifying colors, see Chapter 6, “SAS/GRAPH Colors and Images,” on page 91. For a
complete description of the graphics options, see Chapter 8, “Graphics Options and
Device Parameters Dictionary,” on page 261.
ANNOTATE=Annotate-data-set
The GCHART Procedure BLOCK Statement 789
ANNO=Annotate-data-set
specifies a data set to annotate charts produced by the BLOCK statement.
Note: Annotate coordinate systems 1, 2, 7, and 8 (data system coordinates) are
not valid with block charts. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
BLOCKMAX=max-value
specifies the chart statistic value of the tallest block on the chart. This option lets
you produce a series of block charts using the same scale. All blocks are rescaled as
if max-value were the maximum value on the chart.
Not supported by: Java, ActiveX
CAXIS=grid-color
specifies the color for the midpoint grid. By default, the midpoint grid uses the
foreground color (usually the first color in the colors list).
Featured in: Example 2 on page 844
COUTLINE=block-outline-color | SAME
outlines all blocks or all block segments and legend values in the subgroup legend (if
it appears) using the specified color. SAME specifies that the outline color of a block
or a block segment or a legend value is the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
3 If you do not specify a PATTERN statement, the default outline color is black
for the Java or ActiveX devices. Otherwise, the default outline color is the
foreground color (the first color in the colors list).
3 If you specify the PATTERN statement or the V6COMP graphics option, the
default is COUTLINE=SAME.
default, the GCHART procedure assigns a description of the form BLOCK CHART
OF variable, where variable is the name of the chart variable.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. Refer to the description of the options on page 222, and
“Substituting BY Line Values in a Text String” on page 226. The 256-character limit
applies before the substitution takes place for these options; thus, if in the SAS
program the entry-description text exceeds 256 characters, it is truncated to 256
characters, and then the substitution is performed.
The descriptive text is shown in each of the following:
3 the "description" portion of the Results window
3 the catalog-entry properties that you can view from the Explorer window
3 the Table of Contents that is generated when you use CONTENTS= on an ODS
statement (see “Linking to Output through a Table of Contents” on page 495),
assuming the GCHART output is generated while the contents page is open
3 the Description field of the PROC GREPLAY window
3 the data tip text for web output (depending on the device driver you are using).
See “Adding Data Tips to Web Presentations” on page 568 for details.
DISCRETE
treats a numeric chart variable as a discrete variable rather than as a continuous
variable. The GCHART procedure creates a separate midpoint and, hence, a separate
grid square and block for each unique value of the chart variable. If the chart variable
has a format associated with it, each formatted value is treated as a midpoint.
The LEVELS= option is ignored when you use DISCRETE. The MIDPOINTS=
option overrides DISCRETE.
FREQ=numeric-variable
specifies a variable whose values weight the contribution of each observation in the
computation of the chart statistic. Each observation is counted the number of times
specified by the value of numeric-variable for that observation. If the value of
numeric-variable is missing, 0, or negative, the observation is not used in the statistic
calculation. Non-integer values of numeric-variable are truncated to integers.
FREQ= is valid with all chart statistics.
Because you cannot use the PERCENT, CPERCENT, FREQ, or CFREQ statistics
with the SUMVAR= option, you must use the FREQ= option to calculate percentages,
cumulative percentages, frequencies, or cumulative frequencies based on a sum.
The statistics will not be affected by applying a format to numeric-variable.
See also: “Calculating Weighted Statistics” on page 783
G100
calculates the percentage and cumulative percentage statistics separately for each
group. When you use G100, the individual percentages reflect the contribution of the
midpoint to the group and total 100 percent for each group. G100 is ignored unless
you also use the GROUP= option.
By default, the individual percentages reflect the contribution of the midpoint to
the entire chart and total 100 percent for the entire chart.
GROUP=group-variable
organizes the data according to the values of group-variable. Group-variable can be
either character or numeric and is always treated as a discrete variable. The group
variable can have up to 12 different values.
GROUP= produces a group grid that contains a separate row of blocks for each
unique value of the group variable. Each row contains a square for each midpoint.
The groups are arranged from front to back in ascending order of the group variable
The GCHART Procedure BLOCK Statement 791
values. These values are printed to the left of each row; the group variable name or
label is printed above the list of group values.
By default, each group includes all midpoints, even if no observations for the group
fall within the midpoint range. Missing values for group-variable are treated as a
valid group.
Featured in: Example 2 on page 844
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file that is created by the ODS statement. These links are associated with an area of
the chart and point to the data or graph you wish to display when the user drills down
on the area. The values of variable can be up to 1024 characters long. Characters
after the 1024-character limit (including any closing quotes) are truncated.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file that is created by the ODS statement. These links are associated with a legend
value and point to the data or graph that you wish to display when the user drills
down on the value. The values of variable can be up to 1024 characters long.
Characters after the 1024-character limit (including any closing quotes) are
truncated.
Not supported by: Java, ActiveX
LEGEND=LEGEND<1...99>
assigns the specified LEGEND definition to the legend generated by the
SUBGROUP= option. The LEGEND= option itself does not generate a legend.
LEGEND= is ignored if
3 SUBGROUP= is not used.
3 the specified LEGEND definition is not in effect.
3 the NOLEGEND option is used.
3 the PATTERNID= option is set to any value other than SUBGROUP; that is,
the value of PATTERNID= is BY or GROUP or MIDPOINT.
To create a legend based on the chart midpoints instead of the subgroups, use the
chart variable as the subgroup variable:
block city / subgroup=city;
The Java and ActiveX devices do not support all LEGEND statement options. See
“LEGEND Statement” on page 151 for more information.
See also: SUBGROUP= on page 793 and “LEGEND Statement” on page 151
Featured in: Example 2 on page 844
Not supported by: Java (partial), ActiveX (partial)
LEVELS=number-of-midpoints
specifies the number of midpoints for the numeric chart variable. The range for each
midpoint is calculated automatically using the algorithm described in Terrell and
Scott (1985). LEVELS= is ignored if
3 the chart variable is character type.
3 the DISCRETE option is used.
3 the MIDPOINTS= option is used.
MIDPOINTS=value-list
specifies the midpoint values for the blocks. The way you specify value-list depends
on the type of variable:
792 BLOCK Statement Chapter 29
Note: If you use the SUBGROUP= option and specify a PATTERNID= value other
than SUBGROUP, the block segments use the same pattern and are
indistinguishable. 4
See also: “Controlling Block Chart Patterns and Colors” on page 794
Featured in: Example 7 on page 856
SUBGROUP=subgroup-variable
divides the blocks into segments according to the values of subgroup-variable.
Subgroup-variable can be either character or numeric and is always treated as a
discrete variable. SUBGROUP= creates a separate segment within each block for
every unique value of the subgroup variable for that midpoint.
If PATTERNID=SUBGROUP (the default setting), each segment is filled with a
different pattern, and a legend providing a key to the patterns is automatically
generated. If the value of PATTERNID= is anything other than SUBGROUP, the
segments are all the same color, the legend is suppressed, and the subgrouping effect
is lost.
By default the legend appears at the bottom of the chart. To modify the legend,
assign a LEGEND definition with the LEGEND= option. To suppress the legend,
specify NOLEGEND.
See also: “LEGEND Statement” on page 151
Featured in: Example 2 on page 844
SUMVAR=summary-variable
specifies a numeric variable for sum or mean calculations. The GCHART procedure
calculates the sum or, if requested, the mean of numeric-variable for each midpoint.
The resulting statistics are represented by the height of the blocks in each square.
The values of a summary variable used with the BLOCK statement have a maximum
length of 8.
794 BLOCK Statement Chapter 29
When you use SUMVAR=, the TYPE= option value must be either SUM or MEAN.
With SUMVAR=, the default is TYPE=SUM.
Featured in: Example 1 on page 842
TYPE=statistic
specifies the chart statistic.
3 If the SUMVAR= option is not used, statistic can be one of the following:
FREQ
frequency (the default)
CFREQ
cumulative frequency
PERCENT PCT
percentage
CPERCENT CPCT
cumulative percentage
3 If SUMVAR= is used, statistic can be either:
SUM
sum (the default)
MEAN
mean
Because you cannot specify the statistics PERCENT, CPERCENT, FREQ, or
CFREQ in conjunction with the SUMVAR= option, you must use FREQ= to calculate
percentages, cumulative percentages, frequencies, or cumulative frequencies based on
a sum. See also “Calculating Weighted Statistics” on page 783.
If you specify TYPE=MEAN and use the SUBGROUP= option, the height of the
block represents the mean for the entire midpoint. The subgroup segments are
proportional to the subgroup’s contribution to the sum for the block.
See also: “About Chart Statistics” on page 782
Featured in: Example 2 on page 844
WOUTLINE=block-outline-width
specifies the width of the block outline in pixels.
Not supported by: Java
See “About Patterns” on page 784 for more information on how the GCHART
procedure assigns default patterns and outlines.
User-defined patterns
To override the default patterns and select fills and colors for the blocks or block
segments, use the PATTERN statement. Only bar/block patterns are valid; all other
pattern fills are ignored. For a complete description of all bar/block patterns, see the
description of PATTERN statement option VALUE= on page 171.
Whenever you use PATTERN statements, the default pattern outline color changes to
SAME. That is, the outline color is the same as the fill color. To specify the outline
color, use the COUTLINE= on page 789 option.
Axis color
By default, axis elements use the first color in the colors list. To change the grid color,
use the CAXIS= option. To change the axis text color, use the CTEXT= option.
Description
The HBAR, HBAR3D, VBAR, and VBAR3D statements specify the variable or variables
that define the categories of data to chart. These statements automatically
3 determine the midpoints
3 calculate the chart statistic for each midpoint (the default is FREQ)
3 scale the response axis and the bars according to the statistic value
3 determine bar width and spacing
3 assign patterns to the bars; the default bar/block pattern is SOLID.
3 draw a frame around the axis area using the first color in the colors list.
You can use statement options to select or order the midpoints (bars), to control the
tick marks on the response axis, to change the type of chart statistic, to display specific
statistics, and to modify the appearance of the chart. You can also specify additional
variables by which to group, subgroup, or sum the data.
All bar charts allow grouping, which uses an additional category to organize the bars
into groups, and subgrouping, which divides the bars into segments.
In addition, you can:
3 use global statements to modify the axes (including requesting a logarithmic axis),
the bar patterns, and the legend. See Chapter 7, “SAS/GRAPH Statements,” on
page 121 for more information.
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 797
3 add titles, footnotes, and notes to the chart. See “TITLE, FOOTNOTE, and NOTE
Statements” on page 210 for more information.
3 use an Annotate data set to enhance the chart. See Chapter 24, “Using Annotate
Data Sets,” on page 587 for more information.
3 display an image in the background of the chart. For HBAR3D and VBAR3D
charts, see the IFRAME= option on page 806. For HBAR and VBAR charts, see
the IBACK= goption“IBACK” on page 317.
3 display images in the bars of an HBAR or VBAR chart. See the PATTERN
statement IMAGE= option on page 171.
Syntax
HBAR | HBAR3D | VBAR | VBAR3D chart-variable(s) </ option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ANNOTATE=Annotate-data-set
CAUTOREF=reference-line-color
CAXIS=axis-color
CERROR=error-bar-color
CFRAME=background-color
COUTLINE=bar-outline-color | SAME
CREF=reference-line-color|(reference-line-color)|reference-line-color-list
CTEXT=text-color
FRAME | NOFRAME
GSPACE= group-spacing
IFRAME= fileref | ’external-file’
IMAGESTYLE = TILE | FIT
LAUTOREF=reference-line-type
LEGEND=LEGEND<1...99>
LREF=reference-line-type|(reference-line-type)|reference-line-type-list
NOLEGEND
PATTERNID=BY | GROUP | MIDPOINT | SUBGROUP
SHAPE=3D-bar-shape (HBAR3D and VBAR3D only)
SPACE=bar-spacing
WIDTH=bar-width
WOUTLINE=bar-outline-width
3 statistic options
CFREQ
CFREQLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
CLM=confidence-level
CPERCENT
CPERCENTLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
ERRORBAR=BARS | BOTH | TOP
FREQ
FREQLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
FREQ=numeric-variable
G100
798 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
INSIDE=statistic
MEAN
MEANLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
NOSTATS (HBAR and HBAR3D only)
OUTSIDE=statistic
PERCENT
PERCENTLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
SUM
SUMLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
SUMVAR=summary-variable
TYPE=statistic
3 midpoint options
DISCRETE
GROUP=group-variable
LEVELS=number-of-midpoints|ALL
MIDPOINTS=value-list
MIDPOINTS=OLD
MISSING
RANGE
SUBGROUP=subgroup-variable
3 axes options
ASCENDING
AUTOREF
AXIS=AXIS<1...99>
CLIPREF
DESCENDING
FRONTREF (HBAR3D and VBAR3D only)
GAXIS=AXIS<1...99>
MAXIS=AXIS<1...99>
MINOR=number-of-minor-ticks
NOAXIS
NOBASEREF
NOZERO
RANGE
RAXIS=value-list | AXIS<1...99>
REF=value-list
3 catalog entry description options
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
HTML_LEGEND=variable
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 799
Required Arguments
chart-variable(s)
specifies one or more variables that define the categories of data to chart. Each chart
variable draws a separate chart. All variables must be in the input data set.
Multiple chart variables must be separated with blanks.
See also: “About Chart Variables” on page 779
Options
Options in an HBAR, HBAR3D, VBAR, or VBAR3D statement affect all graphs that
are produced by that statement. You can specify as many options as you want and list
them in any order. For details on specifying colors, see Chapter 6, “SAS/GRAPH Colors
and Images,” on page 91. For details on specifying images, see “Specifying Images in
SAS/GRAPH Programs” on page 106. For a complete description of the graphics options,
see Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page 261.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts produced by the bar chart statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
ASCENDING
arranges the bars in ascending order of the value of the chart statistic. By default,
bars are arranged in ascending order of midpoint value, without regard to the
lengths of the bars. ASCENDING reorders the bars from shortest to longest. In
horizontal bar charts the ordering is top to bottom; in vertical bar charts the ordering
is left to right.
If you also use the GROUP= option, the reordering is performed separately for
each group, so the order of the midpoints may be different for each group.
ASCENDING overrides any midpoint order specified with the MIDPOINTS=
option or specified in the ORDER= option in an AXIS statement assigned to the
midpoint axis.
AUTOREF
draws a reference line at each major tick mark on the response axis. To draw
reference lines at specific points on the response axis, use the REF= option.
By default, reference lines in 2D bar charts are drawn in front of the bars. To
draw reference lines behind the bars, use the CLIPREF option.
By default, reference lines in 3D bar charts are drawn on the back plane of the
axis. To draw reference lines in front of the bars, use the FRONTREF option.
Featured in: Example 5 on page 850
AXIS=AXIS<1...99>
See RAXIS= on page 812.
CAUTOREF=reference-line-color
specifies the color of reference lines drawn at major tick marks, as determined by the
AUTOREF option. The default color is either the value of the CAXIS= option or the
first color in the color list. To specify a line type for these reference lines, use the
LAUTOREF= option.
CAXIS=axis-color
specifies a color for the response and midpoint axis lines and for the default axis area
frame. If you omit the CAXIS= option, PROC GCHART searches for a color
specification in this order:
800 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
This option also specifies the default color for all reference lines.
CERROR=error-bar-color
specifies the color of error bars in bar charts. The default is the color of the response
axis, which is controlled by the CAXIS= option.
CFRAME=background-color
CFR=background-color
specifies the color with which to fill the axis area in 2D bar charts or in the
backplane in 3D bar charts.
The axis area color does not affect the frame color, which is always the same as
the midpoint axis line color and controlled by the CAXIS= option. By default, the
axis area in 2D bar charts is not filled.
CFRAME= is overridden by the NOFRAME and IFRAME= options.
Note: If the background color, the bar color, and the outline color are the same,
you may not be able to distinguish the bars. 4
Featured in: Example 4 on page 848
CFREQ
displays the cumulative frequency statistic in the table of statistics and above
vertical bars. Default statistics are suppressed when you request specific statistics.
For vertical bar charts, this option is ignored if the bars are too narrow to avoid
overlapping values or if the FREQ option is specified.
See also: “About Chart Statistics” on page 782, “Displaying Statistics in Horizontal
Bar Charts” on page 815, and “Displaying Statistics in Vertical Bar Charts” on
page 815
CFREQLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
specifies the text of the column label for the CFREQ statistic in the table of statistics.
Column-label can be up to 32 characters long, but a single line of the label can be no
more than 24 characters. By default, a label with more than one word will break as
close to the center of the line as possible. A double space in the string forces a line
break. To suppress the label, specify CFREQLABEL=NONE.
Not supported by: Java, ActiveX
CLIPREF
clips the reference lines at the bars. This makes the reference lines appear to be
behind the bars. Because CLIPREF is the default for 3D bar charts, it affects only
2D charts.
Featured in: Example 5 on page 850
CLM=confidence-level
specifies the confidence intervals to use when drawing error bars on a bar chart.
Values for confidence-level must be greater than or equal to 50 and strictly less than
100. The default is 95. See ERRORBAR= for details on how error bars are computed
and drawn.
Featured in: Example 6 on page 854
COUTLINE=bar-outline-color | SAME
outlines all bars or bar segments and legend values in the subgroup legend (if it
appears) using the specified color. SAME specifies that the outline color of a bar or a
bar segment or a legend value is the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 801
3 If you do not specify a PATTERN statement, the default outline color is black
for the Java or ActiveX devices. Otherwise, the default outline color is the
foreground color (the first color in the colors list).
3 If you specify the PATTERN statement or the V6COMP graphics option, the
default is COUTLINE=SAME.
The LEVELS= option is ignored when you use DISCRETE. The MIDPOINTS=
option overrides DISCRETE. The ORDER= option in an AXIS statement that is
assigned to the midpoint axis can rearrange or exclude discrete midpoint values.
Featured in: Example 7 on page 856
ERRORBAR=BARS | BOTH | TOP
draws confidence intervals on a horizontal or vertical bar chart for either of the
following:
3 the mean of the SUMVAR= variable for each midpoint if you specify
TYPE=MEAN
3 the percentage of observations assigned to each midpoint if you specify
TYPE=PCT with no SUMVAR= option.
The ERRORBAR= option cannot be used with values of the TYPE= option other than
MEAN or PCT. Valid values for ERRORBAR= are:
BARS
draws error bars as bars half the width of the main bars.
BOTH
draws error bars as two ticks joined by a line (default).
TOP
draws the error bar as a tick for the upper confidence limit that is joined to the top
of the bar by a line.
By default, ERRORBAR= uses a confidence level of 95 percent. You can specify
different confidence levels with the CLM= option.
When you use ERRORBAR= with TYPE=PCT, the confidence interval is based on
a normal approximation. Let TOTAL be the total number of observations, and PCT
be the percentage assigned to a given midpoint. The standard error of the percentage
is approximated as
APSTDERR=100 * SQRT((PCT/100) * (1--(PCT/100)) / TOTAL);
Let LEVEL be the confidence level specified using the CLM= option, with a default
value of 95. The upper confidence limit for the percentage is computed as
UCLP = PCT + APSTDERR * PROBIT( 1-(1-LEVEL/100)/2 );
When you use ERRORBAR= with TYPE=MEAN, the sum variable must have at
least two non-missing values for each midpoint. If the GROUP= option is used, each
midpoint within a group must also have two non-missing values. Let N be the
number of observations assigned to a midpoint, MEAN be the mean of those
observations, and STD be the standard deviation of the observations. The standard
error of the mean is computed as
STDERR = STD / SQRT(N);
Let LEVEL be the confidence level specified using the CLM= option, with a default
value of 95. The upper confidence limit for the mean is computed as
UCLM = MEAN + STDERR * TINV( 1-(1-LEVEL/100)/2, N-1);
If you want the error bars to represent a given number C of standard errors
instead of a confidence interval, and if the number of observations assigned to each
804 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
midpoint is the same, then you can find the appropriate value for the CLM= option
by running a DATA step. For example, if you want error bars that represent one
standard error (C=1) with a sample size of N , you can run the following DATA step
to compute the appropriate value for the CLM= option and assign that value to a
macro variable &LEVEL:
data null;
c = 1;
n = 10;
level = 100 * (1 - 2 * (1 - probt( c, n-1)));
put all;
call symput(’level’,put(level,best12.));
run;
Then when you run the GCHART procedure, you can specify CLM=&LEVEL.
Note that this trick does not work precisely if different midpoints have different
numbers of observations. However, choosing an average value for N may yield
sufficiently accurate results for graphical purposes if the sample sizes are large or do
not vary much.
Featured in: Example 6 on page 854
FRAME | NOFRAME
FR | NOFR
specifies whether the 2D axis area frame or the 3D backplane is drawn. The default
is FRAME, which draws a frame around the axis area (in 2D bar charts) or generates
a colored 3D backplane (in 3D bar charts). Specifying NOFRAME removes the axis
area frame from 2D charts, including any background color or image. For 3D charts,
NOFRAME removes the backplane color or image, and leaves the vertical and
horizontal axis planes and axes. To remove these planes, use the NOPLANE option
in the AXIS statement. To remove one or more axis elements, use either the AXIS
statement or the NOAXIS option.
The NOFRAME option overrides the CFRAME= and IFRAME= options and the
IBACK= goption“IBACK” on page 317.
The color of the frame or backplane outline is the color of the midpoint axis, which
is determined by the CAXIS= option.
If the V6COMP graphics option is in effect, the default is NOFRAME.
Featured in: Example 7 on page 856 and Example 6 on page 854
FREQ
displays the frequency statistic in the table of statistics and above vertical bars.
Non-integer values are rounded down to the nearest integer. Default statistics are
suppressed when you request specific statistics. For vertical bar charts, this option is
ignored if the bars are too narrow to avoid overlapping values. This option overrides
the CFREQ, PERCENT, CPERCENT, SUM, and MEAN options.
Featured in: Example 5 on page 850
See also: “About Chart Statistics” on page 782, “Displaying Statistics in Horizontal
Bar Charts” on page 815, and “Displaying Statistics in Vertical Bar Charts” on
page 815
FREQLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
specifies the text of the column label for the FREQ statistic in the table of statistics.
column-label can be up to 32 characters long, but a single line of the label can be no
more than 24 characters. By default, a label with more than one word will break as
close to the center of the line as possible. A double space in the string forces a line
break. To suppress the label, specify FREQLABEL=NONE.
Featured in: Example 5 on page 850 and Example 6 on page 854
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 805
GROUP= also produces a group axis that lists the values that distinguish the
groups. The group axis has no axis line but displays the group variable name or
label. To modify the group axis, assign an AXIS definition with the GAXIS= option.
In horizontal bar charts, the group axis is to the left of the midpoint axis and the
groups are arranged from top to bottom, starting with the lowest value at the top.
In vertical bar charts, the group axis is below the midpoint axis and the groups
are arranged from left to right starting with the lowest value at the left. If the group
label in a vertical bar chart is narrower than all the bars in the group, brackets are
added to the label to emphasize which bars belong in each group. Group brackets are
not displayed if the space between the group values is less than one and one-half
character cells. Use the NOBRACKETS option in the AXIS statement to suppress
the group brackets.
Featured in: Example 7 on page 856
GSPACE=group-spacing
specifies the amount of extra space between groups of bars. Group-space can be any
non-negative number. Units are character cells. Use GSPACE=0 to leave no extra
space between adjacent groups of bars. In this case, the same space appears between
groups of bars as between the bars in the same group.
GSPACE= is ignored unless you also use the GROUP= option. By default, the
GCHART procedure calculates group spacing based on size of the axis area and the
number of bars in the chart.
If the requested spacing results in a chart that is too large to fit in the space
available for the midpoint axis, an error message is written to the SAS log and no
chart is produced.
Featured in: Example 7 on page 856
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS statement. These links are associated with an area of the
chart and point to the data or graph you wish to display when the user drills down
on the area. The values of variable can be up to 1024 characters long. Characters
after the 1024-character limit (including any closing quotes) are truncated.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS statement. These links are associated with a legend value
and point to the data or graph you wish to display when the user drills down on the
value. The values of variable can be up to 1024 characters long. Characters after the
1024-character limit (including any closing quotes) are truncated.
Not supported by: Java, ActiveX
IFRAME=fileref | ’external-file’
identifies the image file you wish to fill the backplane frame of your
three-dimensional bar charts. See also the IMAGESTYLE= option and “Placing a
Backplane Image on Graphs with Frames” on page 115.
This option is overridden by the NOIMAGEPRINT goption“IMAGEPRINT” on
page 318 .
To fill the backplane frame of two-dimensional bar charts, see the IBACK=
goption“IBACK” on page 317 .
Not supported by: Java
IMAGESTYLE= TILE | FIT
for three-dimensional bar charts, specifies whether to use multiple instances of an
image to fill the backplane frame (TILE) or to stretch a single instance of an image to
fill the backplane frame (FIT). The TILE value is the default. See also the IFRAME=
option. Java supports only TILE.
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 807
The Java and ActiveX devices do not support all LEGEND statement options. See
“LEGEND Statement” on page 151 for more information.
See also: “LEGEND Statement” on page 151 and SUBGROUP= on page 813 option
Featured in: Example 4 on page 848
LEVELS=number-of-midpoints|ALL
specifies the number of midpoints for a numeric chart variable. The range for each
midpoint is calculated automatically, using the algorithm in Terrell and Scott (1985).
If you specify LEVELS=ALL, then all unique midpoint values are graphed. If your
data contains a large number of unique midpoint values (over 200), you can use the
XPIXELS and YPIXELS GOPTIONS to allow the device driver to render a larger
(and more readable) graph.
LEVELS= is ignored if
3 the chart variable is character type
3 the DISCRETE option is used
3 the MIDPOINTS= option is used.
LREF=reference-line-type|( reference-line-type|reference-line-type-list)
LR=reference-line-type|( reference-line-type|reference-line-type-list)
specifies line types for reference lines. Line types are specified as whole numbers
from 1 to 46, with 1 representing a solid line and the other values representing
dashed lines. Specifying a line type without parentheses applies that type to all
reference lines drawn with the AUTOREF and REF= options. Note that the
LAUTOREF= option overrides LREF=reference-line-type for reference lines drawn
with the AUTOREF option. Specifying a single line type in parentheses applies that
line type to the first reference line drawn with the REF= option. Specifying a line
type list applies line types in sequence to successive reference lines drawn with the
REF= option. The syntax of the line-type list is of the form (type1 type2 ...typeN). The
default line type is specified by the AXIS statement’s STYLE= option. By default,
STYLE=1, a solid line. To specify colors for these reference lines, use the CREF=
option.
Not supported by: Java
MAXIS=AXIS<1...99>
assigns the specified AXIS definition to the midpoint axis. The MAXIS= option is
ignored if the specified AXIS definition does not exist.
The Java and ActiveX devices do not support all AXIS statement options. See
“AXIS Statement” on page 124 for more information.
See also: “AXIS Statement” on page 124 and “About Midpoints” on page 780
Featured in: Example 4 on page 848
Not supported by: Java (partial), ActiveX (partial)
MEAN
displays the mean statistic in the table of statistics and above vertical bars. By
default, the column heading in the table includes the name of the variable for which
the mean is calculated. Default statistics are suppressed when you request specific
statistics. For vertical bar charts, this option is ignored if the bars are too narrow to
avoid overlapping values or if the FREQ, CFREQ, PERCENT, CPERCENT, or SUM
option is specified. MEAN is ignored unless you also use the SUMVAR= option.
See also: “About Chart Statistics” on page 782, “Displaying Statistics in Horizontal
Bar Charts” on page 815, and “Displaying Statistics in Vertical Bar Charts” on
page 815
MEANLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 809
specifies the text of the column label for the MEAN statistic in the table of statistics.
column-label can be up to 32 characters long, but a single line of the label can be no
more than 24 characters. By default, a label with more than one word will break as
close to the center of the line as possible. A double space in the string forces a line
break. To suppress the label, specify MEANLABEL=NONE.
Featured in: Example 6 on page 854
Not supported by: Java, ActiveX
MIDPOINTS=value-list
specifies the midpoint values for the bars. The way you specify value-list depends on
the type of the chart variable.
3 For numeric chart variables, value-list is either an explicit list of values, or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
n<...n> TO n <BY increment> <n <...n>>
If a numeric variable has an associated format, the specified values must be
the unformatted values.
By default, numeric variable values are treated as continuous (if you omit the
DISCRETE option), and
3 the lowest midpoint consolidates all data points from negative infinity to
the median of the first two midpoints
3 the highest midpoint consolidates all data points from the median of the
last two midpoints up to infinity
3 all other values in value-list specify the median of a range of values, and
the GCHART procedure calculates the midpoint values.
If you include the DISCRETE option, each value in value-list specifies a
unique numeric value.
3 For character chart variables, value-list is a list of unique character values
enclosed in quotation marks and separated by blanks:
’value-1’ <...’value-n’>
If a character variable has an associated format, the specified values must be
the formatted values.
For a complete description of value-list, see the ORDER= on page 130 option in the
AXIS statement.
If the value-list for either type of variable specifies so many midpoints that the
axis values overwrite each other, the values may be unreadable. In this case the
procedure writes a warning to the SAS log. On many devices, this problem can be
corrected by either adjusting the size of the text with the HTEXT= graphics option or
by increasing the number of cells in your graphics display using the HPOS= and
VPOS= graphics options.
The ORDER= option in the AXIS statement overrides the order specified in the
MIDPOINTS= option. The bar chart statement options ASCENDING and
DESCENDING also override both MIDPOINTS= and ORDER= in the AXIS
statement.
See also: “About Midpoints” on page 780
Featured in: Example 5 on page 850
MIDPOINTS=OLD
810 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
generates default midpoints using the Nelder algorithm (Applied Statistics 25:94–7,
1976). The MIDPOINTS=OLD option is ignored unless the chart variable is numeric.
MINOR=number-of-minor-ticks
specifies the number of minor tick marks between each major tick mark on the
response axis.
MINOR= in a bar chart statement overrides the number of minor tick marks
specified in the MINOR= option in an AXIS definition assigned to the response axis
with the RAXIS= option.
MISSING
accepts a missing value as a valid midpoint for the chart variable. By default,
observations with missing values are ignored. Missing values are always valid for
group and subgroup variables.
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GCHART. If the name duplicates
an existing entry name, thenSAS/GRAPH software adds a number to the duplicate
name to create a unique name—for example, GCHART1.
Featured in: Example 7 on page 856
NOAXIS
suppresses all axes, including axis lines, axis labels, axis values, and all major and
minor tick marks. If you specify an axis definition with the GAXIS, MAXIS=, or
RAXIS= options, then the axes are generated as defined in the AXIS statement, but
then all lines, labels, values, and tick marks are suppressed. Therefore, axis
statement options such as ORDER=, LENGTH, and OFFSET= will still be used.
To remove only selected axis elements such as lines, values or labels, use specific
AXIS statement options.
NOAXIS does not suppress either the default frame or an axis area fill requested
by the CFRAME= option. To remove the axis frame or the 3D backplane, use the
NOFRAME option in the procedure. To remove the horizontal or vertical axis planes,
use the NOPLANE option in the AXIS statement.
NOBASEREF
suppresses the zero reference line when the SUM or MEAN chart statistic has
negative values.
NOLEGEND
suppresses the legend that is automatically generated by the SUBGROUP= option.
NOLEGEND is ignored if the SUBGROUP= option is not used.
NOSTATS (HBAR and HBAR3D only)
suppresses the table of statistics. NOSTATS suppresses both the default statistics
and specific statistics requested by the FREQ, CFREQ, PERCENT, CPERCENT,
SUM, and MEAN options.
Not supported by: Java
NOZERO
suppresses any midpoints for which there are no corresponding values of the chart
variable and, hence, no bar. NOZERO usually is used with the GROUP= option to
suppress midpoints when not all values of the chart variable are present for every
group or if the chart statistic for the bar is 0.
Note: If a bar is omitted and if you have also specified bar labels with the
VALUE= option in an AXIS statement, the labels may be shifted and not displayed
with the correct bar. 4
Featured in: Example 7 on page 856
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 811
Note: If you use the SUBGROUP= option and specify a PATTERNID= value other
than SUBGROUP, the bar segments use the same pattern and are
indistinguishable. 4
See also: “Controlling Bar Chart Patterns, Colors, and Images” on page 816
Featured in: Example 4 on page 848 and Example 7 on page 856
PERCENT
PCT
prints the percentages of observations having a given value for the chart variable in
the table of statistics and above vertical bars. Default statistics are suppressed when
you request specific statistics. For vertical bar charts, this option is ignored if the
bars are too narrow to avoid overlapping values or if the FREQ or CFREQ option is
specified.
See also: “About Chart Statistics” on page 782, “Displaying Statistics in Horizontal
Bar Charts” on page 815, and “Displaying Statistics in Vertical Bar Charts” on
page 815
812 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
3 HEXAGON | H
3 PRISM | P
3 STAR | S
The COUTLINE= option is not valid when SHAPE=CYLINDER.
Featured in: Example 7 on page 856
SPACE=bar-spacing
specifies the amount of space between individual bars or between the bars within
each group if you also use the GROUP= option. Bar-space can be any non-negative
number, including decimal values. Units are character cells. By default, the
GCHART procedure calculates spacing based on the size of the axis area and the
number of bars on the chart. Use SPACE=0 to leave no space between adjacent bars.
SPACE= is ignored if
3 you specify the WIDTH= option and are using the Java or ActiveX devices.
3 the specified spacing requests a chart that is too large to fit in the space
available for the midpoint axis. In this case, a warning message is issued.
Featured in: Example 4 on page 848 and Example 7 on page 856
SUBGROUP=subgroup-variable
divides the bars into segments according to the values of subgroup-variable.
Subgroup-variable can be either character or numeric and is always treated as a
discrete variable. SUBGROUP= creates a separate segment within each bar for
every unique value of the subgroup variable for that midpoint.
If PATTERNID=SUBGROUP (the default setting), each segment is filled with a
different pattern and a legend that provides a key to the patterns is automatically
generated. If the value of PATTERNID= is anything other than SUBGROUP, the
segments are all the same color, the legend is suppressed, and the subgrouping effect
is lost.
By default the legend appears at the bottom of the chart. To modify the legend,
assign a LEGEND definition with the LEGEND= option. To suppress the legend,
specify NOLEGEND.
See also: “LEGEND Statement” on page 151
Featured in: Example 4 on page 848, Example 7 on page 856 and Example 5 on
page 850
SUM
displays the sum statistic in the table of statistics and above vertical bars. By
default, the column heading in the table includes the name of the variable for which
the sum is calculated. Default statistics are suppressed when you request specific
statistics. For vertical bar charts, this option is ignored if the bars are too narrow to
avoid overlapping values or if the FREQ, CFREQ, PERCENT, or CPERCENT option
is specified. SUM is ignored unless you also use the SUMVAR= option.
See also: “About Chart Statistics” on page 782, “Displaying Statistics in Horizontal
Bar Charts” on page 815, and “Displaying Statistics in Vertical Bar Charts” on
page 815
SUMLABEL=’column-label’ | NONE (HBAR and HBAR3D only)
specifies the text of the column label for the SUM statistic in the table of statistics.
Column-label can be up to 32 characters long, but a single line of the label can be no
more than 24 characters. By default, a label with more than one word will break as
close to the center of the line as possible. A double space in the string forces a line
break. To suppress the label, specify SUMLABEL=NONE.
Not supported by: Java, ActiveX
814 HBAR, HBAR3D, VBAR, and VBAR3D Statements Chapter 29
SUMVAR=summary-variable
specifies a numeric variable for sum or mean calculations. The GCHART procedure
calculates the sum or, if requested, the mean of summary-variable for each midpoint.
The resulting statistics are represented by the length of the bars along the response
axis, and they are displayed at major tick marks.
When you use SUMVAR=, the TYPE= option must be either SUM or MEAN. With
SUMVAR=, the default is TYPE=SUM.
Featured in: Example 3 on page 846 and Example 6 on page 854
TYPE=statistic
specifies the chart statistic.
3 If the SUMVAR= option is not used, statistic can be one of the following:
FREQ
frequency (the default)
CFREQ
cumulative frequency
PERCENT PCT
percentage
CPERCENT CPCT
cumulative percentage
3 If SUMVAR= is used, statistic can be:
SUM
sum (the default)
MEAN
mean
Because you cannot use TYPE=FREQ, TYPE=CFREQ, TYPE=PERCENT, or
TYPE=CPERCENT with the SUMVAR= option, you must use FREQ= to calculate
percentages, cumulative percentages, frequencies, or cumulative frequencies based on
a sum. See also “Calculating Weighted Statistics” on page 783.
If you specify TYPE=MEAN and use the SUBGROUP= option, the height or length
of the bar represents the mean for the entire midpoint. The subgroup segments are
proportional to the subgroup’s contribution to the sum for the bar. See also
SUBGROUP= on page 813.
See also: “About Chart Statistics” on page 782 for a complete description of statistic
types
Featured in: Example 6 on page 854
WIDTH=bar-width
specifies the width of the bars. By default, the GCHART procedure selects a bar
width that accommodates the midpoint values displayed on the midpoint axis using a
hardware font and a height of one cell. Units for bar-width are character cells. The
value for bar-width must be greater than 0, but it does not have to be an integer, for
example,
vbar site / width=1.5;
If the requested bar width results in a chart that is too large to fit in the space
available for the midpoint axis, the procedure issues a warning in the log and ignores
the WIDTH= specification. If the specified width is too narrow, the procedure may
display the midpoint values vertically.
Featured in: Example 4 on page 848
WOUTLINE=bar-outline-width
The GCHART Procedure HBAR, HBAR3D, VBAR, and VBAR3D Statements 815
specifies the width of the outline in pixels. WOUTLINE= affects both the bar and the
subgroup outlines.
Not supported by: Java
To specify a statistic that you want to display above the bars, specify the statistic
option (FREQ, CFREQ, PERCENT, CPERCENT, SUM, or MEAN) or specify
OUTSIDE=statistic. To specify a statistic that you want to display inside the bars,
specify INSIDE=statistic.
For graphs generated with the Java and ActiveX devices, the OUTSIDE= option
overrides INSIDE=, and INSIDE= overrides the FREQ, CFREQ, PERCENT,
CPERCENT, SUM, and MEAN options. For graphs generated with other devices, the
individual statistic options override the OUTSIDE= option.
If more than one statistic option is specified, only the highest priority statistic is
displayed. The priority order, from highest to lowest, is as follows:
1 FREQ
2 CFREQ
3 PERCENT
4 CPERCENT
5 SUM
6 MEAN
The bars must be wide enough to accommodate the text. You can adjust the width of
the bars with the WIDTH= option. To control the font and size of the text, use the
HTEXT= and FTEXT= graphics options.
User-Defined Patterns
To override the default patterns and select fills and colors for the bars or bar segments,
use the PATTERN statement. Only bar/block patterns are valid; all other pattern fills
are ignored. For a complete description of all bar/block patterns, see VALUE= on page
171 in “PATTERN Statement” on page 169.
Whenever you use PATTERN statements, the default pattern outline color changes to
SAME. That is, the outline color is the same as the fill color. To specify the outline
color, use the COUTLINE= option (see COUTLINE= on page 800).
Axis Color
By default, axis elements use the first color in the colors list or the colors that are
specified by AXIS statement color options. However, action statement options can also
control the color of the axis lines, text, and frame.
Description
The PIE, PIE3D, and DONUT statements specify the variable or variables that define
the categories of data to chart. These statements automatically
3 determine the midpoints.
3 calculate the chart statistic for each midpoint (the default is FREQ).
3 scale each slice to represent its chart statistic. No slice is drawn if the chart
statistic for the midpoint is 0.
3 order the slices by midpoint value in ascending order starting at the three o’clock
position and proceeding counterclockwise around the pie.
3 print the slice name (midpoint value) and slice value (chart statistic) beside each
slice.
3 assign patterns and colors to the slices. The default pie pattern is PSOLID.
You can use statement options to select or order the midpoints (slices), to change the
type of chart statistic, and to modify the appearance of the chart, including the content
and position of the slice labels, and patterns used by the slices. You can also specify
additional variables by which to group, subgroup, or sum the data. Statement options
can also produce special effects, such as exploded or invisible slices.
Donut and pie charts allow grouping and subgrouping. Grouping creates two or more
separate pie or donut charts that display in rows or columns on one graph.
Subgrouping creates a separate ring of slices within the circle for each value of the
subgroup variable. The concentric rings of the subgrouped pie or donut chart make it
easy to compare slice values between subgroups.
In addition, you can use global statements to modify patterns and legends, as well as
add titles, footnotes, and notes to the chart. You can also use an Annotate data set to
enhance the chart.
Syntax
PIE | PIE3D | DONUT chart-variable(s) </ option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ANNOTATE=Annotate-data-set
CFILL=fill-color
COUTLINE=slice-outline-color | SAME
DETAIL_RADIUS=percent (PIE and DONUT only)
EXPLODE=value-list
FILL=SOLID | X
INVISIBLE=value-list
The GCHART Procedure PIE, PIE3D, and DONUT Statements 819
NOHEADING
WOUTLINE=slice-outline-width
3 statistic options
FREQ=numeric-variable
SUMVAR=summary-variable
TYPE=statistic
3 midpoint options
DISCRETE
LEVELS=number-of-midpoints|ALL
MIDPOINTS=value-list
MIDPOINTS=OLD
MISSING
OTHER=percent-of-total
3 detail pie options (PIE and DONUT only)
DETAIL=variable
DETAIL_THRESHOLD=percent
3 grouping and subgrouping options
ACROSS=number-of-columns
DOWN=number-of-rows
GROUP=group-variable
NOGROUPHEADING
SUBGROUP=subgroup-variable
3 slice-ordering options
ANGLE=degrees
ASCENDING
CLOCKWISE
DESCENDING
JSTYLE
3 slice-labeling options
CTEXT=text-color
LEGEND | LEGEND=LEGEND<1...99>
MATCHCOLOR
NOLEGEND
OTHERLABEL=’text-string’
PERCENT=ARROW | INSIDE | NONE | OUTSIDE
SLICE=ARROW | INSIDE | NONE | OUTSIDE
VALUE=ARROW | INSIDE | NONE | OUTSIDE
3 detail pie slice-labeling options (PIE and DONUT only)
DETAIL_PERCENT=BEST|NONE
DETAIL_SLICE=BEST|NONE
DETAIL_VALUE=BEST|NONE
3 donut-labeling options (DONUT only):
DONUTPCT=percent
LABEL=(text argument(s))
3 catalog entry description options
820 PIE, PIE3D, and DONUT Statements Chapter 29
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
HTML_LEGEND=variable
Required Arguments
chart-variable(s)
specifies one or more variables that define the categories of data to chart. Each chart
variable draws a separate chart. All variables must be in the input data set.
Separate multiple chart variables with blanks.
See also: “About Chart Variables” on page 779
Options
Options in a PIE, PIE3D, or DONUT statement affect all graphs that are produced
by that statement. You can specify as many options as you want and list them in any
order. For details on specifying colors, see Chapter 6, “SAS/GRAPH Colors and Images,”
on page 91. For a complete description of the graphics options, see Chapter 8, “Graphics
Options and Device Parameters Dictionary,” on page 261.
ACROSS=number-of-columns
draws number-of-columns pies across the procedure output area. ACROSS is ignored
unless you also use the GROUP= option.
If number-of-columns calls for more pies than fit horizontally in the graphics
output area, no pies are drawn and an error message is written to the SAS log.
If the DOWN= option also is used, the pies are drawn in left-to-right and
top-to-bottom order.
Featured in: Example 11 on page 875
ANGLE=degrees
starts the first slice at the specified angle. A value of 0 for degrees corresponds to the
3 o’clock position. Degrees can be either positive or negative. Positive values move
the starting position in the counterclockwise direction; negative values move the
starting position clockwise. By default, ANGLE=0. Successive slices are drawn
counterclockwise from the starting slice.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts produced by the PIE, PIE3D, or DONUT
statement.
Note: Annotate coordinate systems 1, 2, 7, and 8 (data system coordinates) are
not valid with pie or donut charts. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
ASCENDING
arranges the slices in ascending order of the value of the chart statistic. By default,
slices are arranged in ascending order of midpoint value, without regard to size.
ASCENDING reorders the slices from smallest to largest. The OTHER slice is still
last regardless of its size.
If you also use the GROUP= option, the reordering is performed separately for
each group, so the order of the midpoint values may be different for each pie or donut.
The GCHART Procedure PIE, PIE3D, and DONUT Statements 821
arranges the slices in descending order of the value of the chart statistic. By default,
slices are arranged in ascending order of midpoint value, without regard to size.
DESCENDING reorders the slices from largest to smallest. The OTHER slice is still
last, regardless of its size.
If you also use the GROUP= option, the reordering is performed separately for
each group, so the order of midpoint values may be different for each pie or donut.
DESCENDING overrides any midpoint order that is specified with the
MIDPOINTS= option.
Featured in: Example 11 on page 875
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
entry-description is 256 characters. The description does not appear on the chart. By
default, the GCHART procedure assigns a description of the form PIE (or PIE3D or
DONUT) CHART OF variable, where variable is the name of the chart variable.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. Refer to the description of the options on page 222, and
“Substituting BY Line Values in a Text String” on page 226. The 256-character limit
applies before the substitution takes place for these options; thus, if in the SAS
program the entry-description text exceeds 256 characters, it is truncated to 256
characters, and then the substitution is performed.
The descriptive text is shown in each of the following:
3 the "description" portion of the Results window
3 the catalog-entry properties that you can view from the Explorer window
3 the Table of Contents that is generated when you use CONTENTS= on an ODS
statement (see “Linking to Output through a Table of Contents” on page 495),
assuming the GCHART output is generated while the contents page is open
3 the Description field of the PROC GREPLAY window
3 the data tip text for web output (depending on the device driver you are using).
See “Adding Data Tips to Web Presentations” on page 568 for details.
DETAIL=variable (PIE and DONUT only)
produces a inner pie overlay whose slices show the major components that comprise
the outer pie’s slice. Variable is the variable whose values are used to construct the
detail pie. If you specify the DETAIL= option and either GROUP= or SUBGROUP=,
then the DETAIL= option is ignored.
DETAIL_PERCENT=BEST|NONE (PIE and DONUT only)
specifies the algorithm to use for displaying the percentage values for the detail pie
slices. NONE turns off the display of the percentage values.
DETAIL_RADIUS=percent (PIE and DONUT only)
determines the size of the detail pie. Percent specifies the percent of the outer pie
radius to use as the detail pie radius. The valid range is 25 to 90. The default is 75.
DETAIL_SLICE=BEST|NONE (PIE and DONUT only)
specifies the algorithm to use for displaying the detail variable labels for the inner
pie slices. NONE turns off the display of the detail variable labels.
DETAIL_THRESHOLD=percent (PIE and DONUT only)
determines if a detail slice is included in the inner pie. Any detail slice comprising
percent or more percent of the whole pie is included. The valid range for percent is 0
to 75. The default is 4.
DETAIL_VALUE=BEST|NONE (PIE and DONUT only)
The GCHART Procedure PIE, PIE3D, and DONUT Statements 823
specifies the algorithm to use for displaying the data values for the detail pie slices.
NONE turns off the display of the data values.
DISCRETE
treats a numeric chart variable as a discrete variable rather than as a continuous
variable. The GCHART procedure creates a separate midpoint and, hence, a separate
slice for each unique value of the chart variable. If the chart variable has a format
associated with it, each formatted value is treated as a midpoint.
The LEVELS= option is ignored when you use DISCRETE. The MIDPOINTS=
option overrides DISCRETE.
DONUTPCT=percent (DONUT only)
specifies the size of the donut hole in percent of the radius of the whole chart. Values
of percent range from 0 to 99. By default, DONUTPCT=25.
Featured in: Example 9 on page 872
DOWN=number-of-rows
draws number-of-rows pies vertically in the procedure output area. The DOWN=
option is ignored unless you also use the GROUP= option.
If number-of-rows calls for more pies than fit vertically in the graphics area of the
output device, no pies are drawn and an error message is written to the SAS log.
If you also use the ACROSS= option, the pies are drawn in left-to-right and
top-to-bottom order.
EXPLODE=value-list
pulls the specified slices slightly out from the rest of the pie for added emphasis.
Value-list is the list of midpoint values for the slices to be exploded. See the
MIDPOINTS= on page 826 option for a description of value-list.
The values in the value list must match the existing midpoints exactly, including
the case of character midpoints. Any values in the list that do not correspond to
existing midpoints are ignored.
When you use EXPLODE=, the radius is reduced to allow room for exploded slices.
EXPLODE= does not work with subgroups.
Featured in: Example 8 on page 869
FILL=SOLID | X
specifies the fill pattern for all slices in the chart:
SOLID S
rotates a solid fill through the colors list as many times as necessary. This is the
default.
X
rotates a single hatch pattern through the colors list as many times as necessary.
The Java and ActiveX devices and PIE3D do not support FILL=X.
If you use default device colors (the COLORS= option is omitted), the fill skips the
first color in the colors list.
FILL= overrides any pattern that is specified in PATTERN statements.
By default, the outline color is the first color in the colors list. If PATTERN
statements are used to specify colors, the slice outline color matches the slice fill color.
By default, the fill patterns take the colors from the current colors list in rotation.
If any PATTERN statements have been defined, the colors in the PATTERN
definitions are used, in order, before the default color rotation.
See also: “Controlling Bar Chart Patterns, Colors, and Images” on page 816 and
“PATTERN Statement” on page 169
Not supported by: Java (partial), ActiveX (partial)
FREQ=numeric-variable
824 PIE, PIE3D, and DONUT Statements Chapter 29
specifies a variable whose values weight the contribution of each observation in the
computation of the chart statistic. Each observation is counted the number of times
specified by the value of numeric-variable for that observation. If the value of
numeric-variable is missing, 0, or negative, the observation is not used in the statistic
calculation. Non-integer values of numeric-variable are truncated to integers.
FREQ= is valid with all chart statistics.
Because you cannot use TYPE=PERCENT or TYPE=FREQ with the SUMVAR=
option, you must use FREQ= to calculate percentages and frequencies based on a
sum.
The statistics will not be affected by applying a format to numeric-variable.
See also: “Calculating Weighted Statistics” on page 783
GROUP=group-variable
organizes the data according to values of group-variable and produces a separate pie
(or donut) chart for each unique value of group-variable. Group-variable can be
either character or numeric and is always treated as a discrete variable. Missing
values for group-variable are treated as a valid group. By default, each group
includes only those midpoints with nonzero chart statistic values.
By default, the charts are produced in ascending order of group variable value and
each is drawn on a separate page or display. Therefore, the effect of GROUP= is
essentially the same as using a BY statement except that GROUP= causes the
midpoints with the same value to use the same color and fill pattern. To place more
than one pie on a page or display, use the ACROSS= or DOWN= options, or both.
See also: “BY Statement” on page 141
Featured in: Example 12 on page 877
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file that is created by the ODS statement. These links are associated with an area of
the chart and point to the data or graph that you wish to display when the user drills
down on the area. The values of variable can be up to 1024 characters long.
Characters after the 1024-character limit (including any closing quotes) are
truncated.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS statement. These links are associated with a legend value
and point to the data or graph that you wish to display when the user drills down on
the value. The values of variable can be up to 1024 characters long. Characters after
the 1024-character limit (including any closing quotes) are truncated.
Not supported by: Java, ActiveX
INVISIBLE=value-list
makes the specified slices invisible, as if they had been removed from the pie. Labels
are not printed for invisible slices. Value-list is the list of midpoint values for the
invisible slices. See the MIDPOINTS= option on page 826 for a description of
value-list.
The values in the value list must match the existing midpoints exactly, including
the case of character midpoints. Any values in the list that do not correspond to
existing midpoints are ignored.
JSTYLE
arranges the midpoints in descending order of the statistic value and draws the slices
clockwise starting at the 12 o’clock position. The JSTYLE option has the same effect
as specifying both the DESCENDING and CLOCKWISE options.
LABEL=(text argument(s)) (DONUT only)
The GCHART Procedure PIE, PIE3D, and DONUT Statements 825
defines the text that is displayed in the donut hole. Text-argument(s) defines the text
or the appearance of the label, or both. Text-argument(s) can be one or more of the
following:
’text-string’
provides the text of the label. Enclose each string in quotation marks. Separate
multiple strings with blanks.
text-description-suboption
modifies a characteristic such as the font, color, or size of the text string(s) that
follows it. Text-description-suboption can be
ANGLE=degrees
COLOR=color
FONT=font
HEIGHT=text-height <units>
JUSTIFY=LEFT | CENTER | RIGHT
ROTATE=degrees
The Java and ActiveX devices do not support all of the suboptions. See “Text
Description Suboptions” on page 829 for a complete description.
Specify as many text strings and text description suboptions as you want, but
enclose them all in one set of parentheses.
Featured in: Example 9 on page 872
Not supported by: Java (partial), ActiveX (partial)
LEGEND | LEGEND=LEGEND<1...99>
generates a legend for the slice names (midpoint values) instead of printing them
beside the slices. The legend displays each slice name and its associated pattern.
This option also suppresses the display of the chart statistic values. To display the
chart statistics, use the VALUE= option.
If you use the SUBGROUP= option, the legend is automatically generated.
However, because patterning is always by midpoint, the legend still describes the
midpoint values, not the subgroups.
Note: If you request a legend and the slices use hatch patterns, the patterns in
the slices are oriented to be visually equivalent to the legend. 4
Specifying LEGEND=LEGENDn assigns the specified LEGEND statement to the
legend. The Java and ActiveX devices do not support all LEGEND statement options.
See “LEGEND Statement” on page 151 for more information.
See also: “LEGEND Statement” on page 151 and SUBGROUP= option on page 828
Featured in: Example 9 on page 872 Example 11 on page 875
Not supported by: Java (partial), ActiveX (partial)
LEVELS=number-of-midpoints|ALL
specifies the number of midpoints for a numeric chart variable. The range for each
midpoint is calculated automatically.
If you specify LEVELS=ALL, then all unique midpoint values are graphed. If your
data contains a large number of unique midpoint values (over 200), you can use the
XPIXELS and YPIXELS GOPTIONS to allow the device driver to render a larger
(and more readable) graph.
LEVELS= is ignored if
3 the chart variable is character type
3 the DISCRETE option is used
3 the MIDPOINTS= option is used.
MATCHCOLOR
826 PIE, PIE3D, and DONUT Statements Chapter 29
uses the slice pattern color for all slice labels. MATCHCOLOR overrides the color
that is specified in the CTEXT= option.
MIDPOINTS=value-list
specifies the midpoint values for the slices. The way you specify value-list depends on
the type of variable:
3 For numeric chart variables, value-list is either an explicit list of values, or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
<n...> n TO n <BY increment> <n <...n>>
If a numeric variable has an associated format, the specified values must be
the unformatted values.
By default, numeric variable values are treated as continuous (if you omit the
DISCRETE option), and
3 the lowest midpoint consolidates all data points from negative infinity to
the median of the first two midpoints
3 the highest midpoint consolidates all data points from the median of the
last two midpoints up to infinity
3 all other values in value-list specify the median of a range of values, and
the GCHART procedure calculates the midpoint values.
If you include the DISCRETE option, each value in value-list specifies a
unique numeric value.
3 For character chart variables, value-list is a list of unique character values
enclosed in quotation marks and separated by blanks:
’value-1’ <...’value-n’>
If a character variable has an associated format, the specified values must be
the formatted values.
For a complete description of value-list, see the ORDER= option on page 130 in the
AXIS statement.
Midpoints that represent small percentages are collected into a generic midpoint
named OTHER. See the OTHER= option on page 827 and the OTHERLABEL=
option on page 827 for more information.
See also: “About Midpoints” on page 780
Featured in: Example 10 on page 873
MIDPOINTS=OLD
generates default midpoints using the Nelder algorithm (Applied Statistics 25:94–7,
1976). The MIDPOINTS=OLD option is ignored unless the chart variable is numeric
MISSING
accepts a missing value as a valid midpoint for the chart variable. By default,
observations with a missing value are ignored. Missing values are always valid for
the group and subgroup variable.
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GCHART. If the name duplicates
an existing entry name, thenSAS/GRAPH software adds a number to the duplicate
name to create a unique name—for example, GCHART1.
NOGROUPHEADING
The GCHART Procedure PIE, PIE3D, and DONUT Statements 827
suppresses the headings that are normally printed above each pie when you use the
GROUP= option.
NOHEADING
suppresses the heading that is normally printed at the top of each page or display of
output for all devices except Java and ActiveX. For the Java and ActiveX devices,
NOHEADING is the default.
Featured in: Example 9 on page 872
Not supported by: Java, ActiveX
NOLEGEND
suppresses the legend that is automatically generated by the SUBGROUP= option.
NOLEGEND is ignored if the SUBGROUP= option is not used.
OTHER=percent-of-total
collects all midpoints with chart statistic values less than or equal to percent-of-total
into a generic midpoint named OTHER. The value of percent-of-total can be 0 to 100;
the default value is 4. Therefore, any slice that represents 4 percent or less of the
total is put in the OTHER category.
Note: If you specify a small value for percent-of-total, the GCHART procedure
may not be able to label all of the small slices. 4
The OTHER slice is the last slice in the pie, regardless of the order of the slices.
(In other words, it is the slice immediately before the starting slice.)
If only one midpoint falls into the OTHER category, its slice is displayed in its
normal position in the pie and retains its original label. For example, suppose a pie
has these slices and percent values: Coal 35%, Gas 15%, Hydro 5%, and Oil 45%. If
you specify OTHER=5, Hydro remains the third slice instead of becoming the last
slice.
Featured in: Example 11 on page 875 and Example 12 on page 877
OTHERCOLOR=color
specifies the color to use for the OTHER slice. If you omit the OTHERCOLOR=
option, GCHART searches for a color specification in this order:
1 the CFILL= option
2 the COLOR= option in a PATTERN statement
3 the COLOR= in a GOPTIONS statement
4 the default color list.
For more information, see “Controlling Slice Patterns and Colors” on page 831.
OTHERLABEL=’text-string’
specifies a text string up to 16 characters for the label for the OTHER slice. The
default label is OTHER.
Featured in: Example 11 on page 875
PERCENT=ARROW | INSIDE | NONE | OUTSIDE
prints the percentage represented by each slice using the specified labeling method.
For a description of the option values, see “Selecting and Positioning Slice Labels” on
page 830. By default, PERCENT=NONE (percentage is not displayed).
Whether the slice percent displays with or without decimal places, depends on the
range of values across the chart. The only way to control the appearance of these
values is to calculate the percentage with a DATA step or statistical procedure and
use the resulting data set as input to the GCHART procedure. Assign the variable
that contains the calculated percentages to the SUMVAR= option.
Featured in: Example 10 on page 873 and Example 12 on page 877
828 PIE, PIE3D, and DONUT Statements Chapter 29
The SLICE= and VALUE= options are dependent on each other. If you specify only
VALUE= or only SLICE=, the other option automatically uses the same labeling
method. PERCENT= is independent of these two.
Be careful about the combinations that you specify. For example, if you specify
PERCENT=ARROW and VALUE=OUTSIDE, the line that connects the percentage
information to each slice may overlay the statistic value.
If your pie has many slices, the labels may overlap, particularly if there are several
small slices together. You can correct the overlapping labels by using
3 FTEXT= graphics option to decrease the size of the labels.
3 the Graphics Editor to adjust the labels by moving or resizing the text.
3 ANGLE= to change the orientation of the pie.
3 MIDPOINTS= to rearrange slices so that small slices are not together.
3 OTHER= to group more midpoints into the OTHER category.
3 the HPOS= and VPOS= graphics options to increase the number of cells in your
display. ( See “About the Graphics Output Area” on page 34 for details.)
Controlling Slice Patterns and Colors
Pie and donut charts are always patterned by midpoint. Even when you specify
subgrouping, the patterning method does not change from midpoint to subgroup.
3 outlines slices and subgroup segments using the first color in the colors list. To
change the outline color, use the COUTLINE= option.
See “About Patterns” on page 784 for more information on how the GCHART
procedure assigns default patterns and outlines.
Controlling patterns
You can control slice patterns and their outlines in several ways.
3 To select a different fill for the slices, such as empty or hatched, you can
3 request a single hatched fill pattern for all slices by specifying the FILL=X
option on the PIE or DONUT statement. The pattern specified by FILL=X
rotates through the colors list as many times as needed to generate all of the
patterns that are required by the chart. If you specify a single color with
either CFILL= or the graphics option, CPATTERN=, all slices use the same
color as well as the same pattern.
3 specify a pattern with the VALUE= option in the PATTERN statement. Only
pie patterns are valid; all other pattern specifications are ignored. For a
complete description of all pie patterns, see VALUE= on page 174 in
“PATTERN Statement” on page 169.
If no color options are specified, the procedure rotates each specified fill
once through the colors list. Otherwise the PATTERN statement generates
one pattern definition for the specified pattern and color. When all of the
specified patterns are exhausted, the procedure starts rotating through the
default pie patterns, beginning with PSOLID.
3 To select colors for the slices, you can
3 specify a single pattern color with the CFILL= option, or with the
CPATTERN= graphics option, or with a colors list of one color. For the PIE
and DONUT statements, CFILL= starts with the default solid color and uses
the foreground color for outlines, whereas CPATTERN= and a colors list of
one color skip the solid pattern and, beginning with P2N0, use each pie hatch
pattern with the specified color, and use the fill color for the outline color.
3 specify only COLOR= in one or more PATTERN statements. In this case, the
procedure creates a solid pattern for each specified color. When it runs out of
PATTERN statements, it returns to the default patterns, beginning with
PSOLID, and rotates them each through the colors list. Whenever you specify
a PATTERN statement, the default outline color is SAME.
3 To define specific patterns and colors for the slices, use PATTERN statements and
specify both the VALUE= and COLOR= options. If you provide fewer PATTERN
definitions than the chart requires, the GCHART procedure uses the default
pattern rotation for the slices that are drawn after all of the defined patterns are
exhausted.
Whenever you use PATTERN statements, the default outline color changes to
SAME. That is, the outline color is the same as the fill color. To change the outline
color, use the COUTLINE= option on page 821.
See “About Patterns” on page 784 for more information on how the GCHART
procedure uses patterns and outlines. See “PATTERN Statement” on page 169 for a
description of default pie patterns.
When you use the GROUP= option, a heading is printed above each pie indicating
the name of the group variable and its value for the particular pie– for example,
SITE=Paris. You can suppress these headings with the NOGROUPHEADING option.
You can also suppress the variable name SITE= so that only the value Paris remains.
To do this, use a LABEL statement and assign a null value to the variable name, for
example,
label site=’00’x;
Because the AXIS statement cannot be used by the PIE, PIE3D, and DONUT
statements, you should use the FTEXT= and HTEXT= graphics options to control the
font and height of text on the chart. Increasing the value of the HTEXT= graphics
option decreases the size of the pie if any slice labels are positioned outside.
STAR Statement
Creates star charts in which the length of the spines represents the value of the chart statistic for
each category of data or midpoint.
Requirements: At least one chart variable is required.
Global statements: FOOTNOTE, PATTERN, TITLE,
Supports: Drill-down functionality (slices only)
Not supported by: Java, ActiveX
Description
The STAR statement specifies the variable or variables that define the categories of
data to chart. This statement automatically
3 determines the midpoints.
3 calculates the chart statistic for each midpoint (the default is FREQ).
3 scales each spine or slice to represent the chart statistic. Slices or spines are
drawn for all midpoints where the value of the chart statistic is greater than the
value that is specified in the STARMIN= option.
3 arranges the spines or slice counterclockwise around the star in ascending order of
midpoint value, starting at the three o’clock position.
3 prints the midpoint value and chart statistic beside each spine or slice.
3 assigns patterns to the slices.
If all the data to be charted with the STAR statement are positive, the center of the
star represents 0 and the outside circle represents the maximum value. If negative
values are calculated for the chart statistic, the center represents the minimum value
in the data. You can specify other values for the center and outside of the circle with
the STARMIN= and STARMAX= options.
You can also use statement options to select or order the midpoints, to change the
type of chart statistic, and to modify the appearance of the chart, including the content
and position of the spine or slice labels, and patterns that fill the slice. You can specify
additional variables by which to group or sum the data.
Star charts allow grouping, which creates two or more separate charts that display in
rows or columns on one graph.
In addition, you can use global statements to modify patterns as well as add titles,
footnotes, and notes to the chart. You can also use an Annotate data set to enhance the
chart.
834 STAR Statement Chapter 29
Syntax
STAR chart-variable(s) </ option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options
ANGLE=degrees
ANNOTATE=Annotate-data-set
CFILL=fill-color
COUTLINE=star-outline-color | SAME
FILL=SOLID | X
NOCONNECT
STARMAX=max-value
STARMIN=min-value
WOUTLINE=slice-outline-width
3 statistic options
FREQ=numeric-variable
SUMVAR=summary-variable
TYPE=statistic
3 midpoint options
DISCRETE
LEVELS=number-of-midpoints
MIDPOINTS=value-list
MIDPOINTS=OLD
MISSING
3 grouping options
ACROSS=number-of-columns
DOWN=number-of-rows
GROUP=group-variable
3 labeling options
CTEXT=text-color
MATCHCOLOR
NOGROUPHEADING
NOHEADING
PERCENT=ARROW | INSIDE | NONE | OUTSIDE
SLICE=ARROW | INSIDE | NONE | OUTSIDE
VALUE=ARROW | INSIDE | NONE | OUTSIDE
3 catalog entry description options
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
The GCHART Procedure STAR Statement 835
Required Arguments
chart-variable(s)
specifies one or more variables that define the categories of data to chart. Each chart
variable draws a separate chart. All variables must be in the input data set.
Separate multiple chart variables with blanks.
See also: “About Chart Variables” on page 779
Options
Options in a STAR statement affect all of the graphs that are produced by that
statement. You can specify as many options as you want and list them in any order.
For details on specifying colors, see Chapter 6, “SAS/GRAPH Colors and Images,” on
page 91.
ACROSS=number-of-columns
draws number-of-columns stars across the procedure output area. ACROSS= is
ignored unless you also use the GROUP= option. If number-of-columns calls for more
stars than fit horizontally in the graphics area of the output device, no stars are
drawn and an error message is written to the SAS log.
If you also use the DOWN= option, the star charts are drawn in left-to-right and
top-to-bottom order.
ANGLE=degrees
starts the first slice at the specified angle. A value of 0 for degrees corresponds to the
3 o’clock position. Degrees can be either positive or negative. Positive values move
the starting position counterclockwise; negative values move the starting position
clockwise.
If the star chart uses spines instead of slices, degrees specifies the angle of the
position halfway between the first spine and the last spine.
By default, ANGLE=0, which places the first spine or the center of the first slice of
the star at the 0 degree position. Successive star spines or slices are drawn
counterclockwise from the starting position.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts that are produced by the STAR statement.
Note: Annotate coordinate systems 1, 2, 7, and 8 (data system coordinates) are
not valid with star charts. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
CFILL=fill-color
specifies one color for all slices in the chart, regardless of whether the fill is solid or
hatch. If no pattern is specified on the PATTERN statement or with the FILL=
option, the procedure starts with the default solid fill and then, beginning with
P2N0, uses each default star hatch pattern with the specified color. For the outline
color, the procedure uses the foreground color, which is the first color in the colors
lists. Use COUTLINE= to specify a different outline color. CFILL= overrides any
other pattern color specification and controls the color of all slices.
COUTLINE=star-outline-color | SAME
specifies the color for the circle that surrounds the star chart and for the slice
outlines or spines.
SAME specifies that the outline color of a slice is the same as the interior pattern
color. Specifying COUTLINE=SAME affects only slice outlines and has no effect on
the color of the circle.
836 STAR Statement Chapter 29
The default circle color is the first color in the colors list (the foreground color).
The default slice outline color depends on the PATTERN statement:
3 If you do not specify the PATTERN statement, the default outline color is the
foreground color (the first color in the colors list).
3 If you do not specify the PATTERN statement or the V6COMP graphics options,
the default is COUTLINE=SAME.
DOWN=number-of-rows
draws number-of-rows stars vertically in the procedure output area. The DOWN=
option is ignored unless you also use the GROUP= option. If number-of-rows calls for
more stars than fit vertically in the graphics area of the output device, no stars are
drawn and an error message is written to the SAS log.
If you also use the ACROSS= option, the stars are drawn in left-to-right and
top-to-bottom order.
FILL=SOLID | X
specifies the fill pattern for all slices in the star chart:
SOLID
S
rotates a solid fill through the colors list as many times as necessary. This is the
default.
X
rotates a single hatch pattern through the colors list as many times as necessary.
If you use default device colors (the COLORS= option is omitted), the fill skips the
first color in the colors list.
FILL= overrides any patterns that are specified in PATTERN statements.
By default, the fill patterns take the colors from the current colors list in rotation.
If any PATTERN statements have been defined, the colors in the PATTERN
definitions are used, in order, before the default color rotation.
Featured in: Example 14 on page 880
FREQ=numeric-variable
specifies a variable whose values weight the contribution of each observation in the
computation of the chart statistic. Each observation is counted the number of times
that are specified by the value of numeric-variable for that observation. If the value of
numeric-variable is missing, 0, or negative, the observation is not used in the statistic
calculation. Non-integer values of numeric-variable are truncated to integers.
FREQ= is valid with all chart statistics.
Because you cannot use TYPE=PERCENT or TYPE=FREQ with the SUMVAR=
option, you must use FREQ= to calculate percentages and frequencies based on a
sum.
The statistics will not be affected by applying a format to numeric-variable.
See also: “Calculating Weighted Statistics” on page 783
GROUP=variable
organizes the data according to values of group-variable and produces a separate star
chart for each unique value of group-variable. Group-variable can be either character
or numeric and is always treated as a discrete variable. Missing values for
group-variable are treated as a valid group.
By default, the charts are produced in ascending order of group variable value and
each is drawn on a separate page or display. Therefore, the effect of GROUP= is
essentially the same as using a BY statement except that GROUP= causes the
midpoints with the same value to use the same color and fill pattern. To place more
than one star chart on a page or display, use the ACROSS= or DOWN= options, or
both.
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file that is created by the ODS statement. These links are associated with an area of
the chart and point to the data or graph that you wish to display when the user drills
down on the area. Only star charts with slices support drill-down functionality. The
values of variable can be up to 1024 characters long. Characters after the
1024-character limit (including any closing quotes) are truncated.
838 STAR Statement Chapter 29
LEVELS=number-of-midpoints
specifies number of midpoints for a numeric chart variable. The range for each
midpoint is calculated automatically using the algorithm described by Terrell and
Scott (1985). LEVELS= is ignored if
3 the chart variable is character type
3 the DISCRETE option is used
3 the MIDPOINTS= option is used.
MATCHCOLOR
uses the slice pattern color for all slice labels. MATCHCOLOR overrides the color
that is specified in the CTEXT= option. If the chart uses spines instead of slices, the
spine color is used for the slice label and value text.
MIDPOINTS=value-list
specifies the midpoint values for the slices. The way you specify value-list depends on
the type of variable:
3 For numeric chart variables, value-list is either an explicit list of values, or a
starting and an ending value with an interval increment, or a combination of
both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment> <n <...n>>
If a numeric variable has an associated format, the specified values must be
the unformatted values.
By default, numeric variable values are treated as continuous (if you omit the
DISCRETE option), and
3 the lowest midpoint consolidates all data points from negative infinity to
the median of the first two midpoints
3 the highest midpoint consolidates all data points from the median of the
last two midpoints up to infinity
3 all other values in value-list specify the median of a range of values, and
the GCHART procedure calculates the midpoint values.
If you include the DISCRETE option, each value in value-list specifies a
unique numeric value.
3 For character chart variables, value-list is a list of unique character values
enclosed in quotation marks and separated by blanks:
’value-1’ <...’value-n’>
If a character variable has an associated format, the specified values must be
the formatted values.
For a complete description of value-list, see the ORDER= option on page 130 in the
AXIS statement.
See also: “About Midpoints” on page 780
MIDPOINTS=OLD
generates default midpoints using the Nelder algorithm (Applied Statistics 25:94–7,
1976). The MIDPOINTS=OLD option is ignored unless the chart variable is numeric
MISSING
accepts a missing value as a valid midpoint for the chart variable. By default,
observations with a missing value are ignored. Missing values are always valid for
the group variable.
NAME=’entry-name’
The GCHART Procedure STAR Statement 839
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GCHART. If the name duplicates
an existing entry name, thenSAS/GRAPH software adds a number to the duplicate
name to create a unique name—for example, GCHART1.
NOCONNECT
draws only star spines without connecting lines. By default, the spines are connected
to form slices.
Featured in: Example 14 on page 880
NOGROUPHEADING
suppresses the headings normally printed above each star when you use the
GROUP= option.
NOHEADING
suppresses the heading normally printed at the top of each page or display of star
chart output.
Featured in: Example 14 on page 880
PERCENT=ARROW | INSIDE | NONE | OUTSIDE
prints the percentage represented by each slice using the specified labeling method.
For a description of the option values see “Selecting and Positioning Spine and Slice
Labels” on page 840. By default, PERCENT=NONE (percentage is not displayed).
SLICE=ARROW | INSIDE | NONE | OUTSIDE
controls the position and style of the slice name (midpoint value) for each slice. For a
description of the option values, see “Selecting and Positioning Spine and Slice
Labels” on page 840. By default, SLICE=OUTSIDE (the name is outside the slice).
STARMAX=max-value
scales the chart so that the outside (or edge) of the circle represents the value that is
specified by max-value. By default, the value for STARMAX= is the maximum chart
statistic value.
STARMIN=min-value
scales the chart so that the center of the circle represents the value that is specified
by min-value. By default, STARMIN=0. If the chart statistic has negative values, by
default the value for STARMIN= is the minimum chart statistic value.
SUMVAR=summary-variable
specifies a numeric variable for sum or mean calculations. The GCHART procedure
calculates the sum or, if requested, the mean of the value of numeric-variable for
each midpoint. The resulting statistics are represented by the size of the slice and
displayed beside each slice.
When you use SUMVAR=, the TYPE= option must be either SUM or MEAN. With
SUMVAR=, the default is TYPE=SUM.
Featured in: Example 13 on page 879
TYPE=statistic
specifies the chart statistic.
3 If the SUMVAR= option is not used, statistic can be one of the following:
FREQ
frequency (the default)
PERCENT PCT
percentage
If SUMVAR= is used, statistic can be one of the following:
SUM
840 STAR Statement Chapter 29
through the colors list. It continues in this fashion until all the required patterns
have been assigned.
If you use the device’s default colors and the first color in the list is either black
or white, the procedure does not create a pattern in that color. If you specify a
colors list with the COLORS= graphics option, the procedure uses all of the colors
in the list to generate the patterns.
3 outlines slices using the first color in the colors list. To change the outline color,
use the COUTLINE= option.
See “About Patterns” on page 784 for more information on how the GCHART
procedure assigns default patterns and outlines.
Controlling patterns
You can control slice patterns and their outlines in several ways.
3 To select a different fill for the slices, such as empty or hatched, you can
3 request a single hatched fill pattern for all slices by specifying the FILL=X
option on the STAR statement. The pattern that is specified by FILL=X
rotates through the colors list as many times as needed to generate all the
patterns required by the chart. If you specify a single color with either
CFILL= or the graphics option, CPATTERN=, all slices use the same color as
well as the same pattern.
3 specify a pattern with the VALUE= option in the PATTERN statement. Only
star patterns are valid; all other pattern specifications are ignored. For a
complete description of all star patterns, see VALUE= on page 174 in
“PATTERN Statement” on page 169.
If no color options are specified, the procedure rotates each specified fill
once through the colors list. Otherwise the PATTERN statement generates
one pattern definition for the specified pattern and color. When all of the
specified patterns are exhausted, the procedure starts rotating through the
default star patterns, beginning with PSOLID.
3 To select colors for the slices, you can
3 specify a single pattern color with the CFILL= option, or with the
CPATTERN= graphics option, or with a colors list of one color. If you use
CFILL=, the procedure starts with the default solid color and uses the
foreground color for outlines. If you use CPATTERN= or a colors list of one
color, the procedure skips the default solid fill and, beginning with P2N0,
uses each default star hatch pattern with the specified color, and uses the fill
color for the outline color.
3 specify only COLOR= in one or more PATTERN statements. In this case, the
procedure creates a solid pattern for each specified color. When it runs out of
PATTERN statements, it returns to the default patterns, beginning with
PSOLID, and rotates them each through the colors list. Whenever you specify
a PATTERN statement, the default outline color is SAME.
3 To define specific patterns and colors for the slices, use PATTERN statements and
specify both the VALUE= and COLOR= options. If you provide fewer PATTERN
definitions than the chart requires, the GCHART procedure uses the default
pattern rotation for the slices that are drawn after all defined patterns are
exhausted.
Whenever you use PATTERN statements, the default outline color changes to
SAME. That is, the outline color is the same as the fill color. To change the outline
color, use the COUTLINE= option on page 821.
842 Examples Chapter 29
See “About Patterns” on page 784 for more information on how the GCHART
procedure uses patterns and outlines. See “PATTERN Statement” on page 169 for a
description of default star patterns.
Because the AXIS statement cannot be used by the STAR statement, you should use
the FTEXT= and HTEXT= graphics options to control the font and height of text on the
chart. Increasing the value of HTEXT= decreases the size of the star if any slice labels
are positioned outside. For a description of these graphics options, see Chapter 8,
“Graphics Options and Device Parameters Dictionary,” on page 261.
Examples
This example produces a block chart of total sales for three sites by charting the
values of the character variable SITE and calculating the sum of the variable SALES
for each site. It prints formatted values of the sales statistics below the blocks.
The chart uses default patterns and colors. The block faces use the default pattern
fill, which is solid. Because a colors list is specified in the GOPTIONS statement, the
default fill color is the first color in the list, blue. The midpoint grid and the block
outlines also use the first color in the list.
All the blocks use the same pattern because by default patterns change for subgroups
and in this chart subgroups are not specified.
Set the graphics environment. CTEXT= specifies the color for all text on the output.
COLORS= specifies the colors list, which is used by the default patterns and outlines.
Create data set TOTALS. TOTALS contains quarterly sales data for three manufacturing
sites for one year. Sales figures are broken down by department.
data totals;
length dept $ 7 site $ 8;
input dept site quarter sales;
datalines;
Parts Sydney 1 7043.97
Parts Atlanta 1 8225.26
Parts Paris 1 5543.97
...more data lines...
Tools Sydney 4 1775.74
Tools Atlanta 4 3424.19
Tools Paris 4 6914.25
;
Produce the block chart. The BLOCK statement produces a block chart. SUMVAR=
calculates the sum of SALES for each value of the chart variable SITE. With SUMVAR= the
default statistic is SUM. The summary variable SALES is assigned a dollar format.
proc gchart data=reflib.totals;
format sales dollar8.;
block site / sumvar=sales;
run;
quit;
This example shows average quarterly sales for each department at two of the three
manufacturing sites in the TOTALS data set; it excludes the Paris site from the chart.
The GCHART Procedure Example 2: Grouping and Subgrouping a Block Chart 845
The program groups the chart data (sites) by department, and subgroups department
sales data by quarter. Each site is a midpoint. Because the sites are grouped by
department, each midpoint has a separate square for each department and the height
of the block represents total sales for that department.
The blocks are subgrouped to show how quarterly sales contribute to total sales; each
segment represents sales for a quarter. A legend explaining the subgroup patterns
appears below the midpoint grid.
The subgroups use four default patterns, The first three patterns are created by
rotating the first default fill, solid, through the three colors in the colors list defined in
the GOPTIONS statement. The fourth default pattern is created by using the second
default pattern fill, X1, with the first color in the colors list, blue.
Because the first color in the colors list is also the default color for several other
elements, the program includes several options that override the default: CTEXT=
colors all text, CAXIS= colors the midpoint grid, COUTLINE= colors the pattern
outline. For more information on patterns and colors, see “Controlling Block Chart
Patterns and Colors” on page 794.
Assign the libref and set the graphics environment. COLORS= specifies a colors list that
is used by the default patterns. CTEXT= specifies black for all text.
libname reflib ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(blue green red) ctext=black
ftitle=swissb ftext=swiss htitle=4 htext=3;
Define legend characteristics. LABEL= assigns new text to the legend label. CBORDER=
draws a black frame around the legend.
legend1 cborder=black
label=(’Quarter:’)
position=(middle left outside)
mode=protect
across=1;
Produce the block chart. The LABEL statement suppresses the midpoint and group labels by
assigning a null hexadecimal string to each variable name.
proc gchart data=reflib.totals;
format quarter roman.;
format sales dollar8.;
label site=’00’x dept=’00’x;
846 Example 3: Specifying the Sum Statistic in Bar Charts Chapter 29
TYPE= specifies the chart statistic as the mean value of the summary variable SALES for each
site. MIDPOINTS= selects the two sites and the order in which they appear. GROUP= creates a
separate row of blocks for each different value of DEPT. SUBGROUP= divides each block into
separate segments for the four quarters. LEGEND= assigns the LEGEND1 statement to the
graph. NOHEADING suppresses the default heading that would otherwise appear above the
chart. CAXIS= colors the grid black. COUTLINE= specifies the outline color for the blocks.
This example produces two bar charts that show total sales for three sites by
charting the values of the character variable SITE and calculating the sum of the
variable SALES for each site.
In the horizontal bar chart shown above, the summary statistics are printed by
default to the right of the bars and display the formatted values of SALES.
The bars use the default pattern fill, which is solid. Because a colors list is specified
in the GOPTIONS statement, the first default pattern color is the first color in the list.
To avoid having black bars, the program uses a PATTERN statement to specify the
pattern color. Using a PATTERN statement causes the default bar outline color to
match the fill color. All the bars display the same pattern because by default patterns
change for subgroups and in this chart subgroups are not specified.
The output also shows the frame that is drawn by default around the axis area.
The second bar chart is a 3D vertical bar chart, shown in the following output.
Vertical bar charts do not generate a table of statistics and by default do not print any
chart statistics. This chart uses the same pattern as the horizontal bar chart, but the
VBAR3D statement specifies a black outline for the bars.
Assign the libref and set the graphics environment. COLORS= specifies the colors list,
which is used by the default patterns and outlines.
libname reflib ’SAS-data-library’;
goptions reset=global gunit=pct border
colors=(black red blue green)
cback=white ftitle=swissb ftext=swiss
htitle=6 htext=3.5;
Specify a color for the pattern. The PATTERN statement explicitly defines RED as the color
for the first solid pattern.
pattern1 color=red;
848 Example 4: Subgrouping a 3D Vertical Bar Chart Chapter 29
Produce the horizontal bar chart. The HBAR statement produces a two-dimensional bar
chart. SUMVAR= calculates the sum of SALES for each value of the chart variable SITE. The
default statistic for SUMVAR= is SUM. The summary variable SALES is assigned a dollar
format.
Produce the vertical bar chart. Because the procedure supports RUN-group processing, you
do not have to repeat the PROC GCHART statement to generate the second chart. The VBAR3D
statement produces a three-dimensional vertical bar chart. The FOOTNOTE1 statement
replaces the previous footnote. COUTLINE= assigns a black outline to the bars.
This example subgroups by department the 3D vertical bar chart of total sales for
each site that is shown in Example 3 on page 846. In addition to subdividing the bars
to show the amount of sales for each department for each site, the chart displays
statistics both inside and outside of the bars. OUTSIDE=SUM prints the total sales for
the site above each bar. INSIDE=SUBPCT prints the percent each department
contributed to the total sales for its site inside of each subgroup segment.
The legend has a block-effect shadow whose color matches the backplane. The
graphics option OFFSHADOW= defines the size and position of the block shadow. Both
the LEGEND statement and the AXIS statement use the ORIGIN= option to line up
the legend and the chart by explicitly positioning their lower left corners.
Assign the libref and set the graphics environment. OFFSHADOW= defines the depth of
the block around the legend box. The positive values position the shadow above and to the right
of the legend.
libname reflib ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(black red green blue) ftitle=swissb
ftext=swiss htitle=6 htext=4
offshadow=(1.5,1.5);
Modify the midpoint axis. LABEL= suppresses the axis label. ORIGIN= positions the left end
of the horizontal axis at a point that is 25% of the width of the graphics output area.
axis1 label=none
origin=(24,);
Modify the response axis. ORDER= specifies the major tick values for the response axis.
OFFSET= moves the top tick mark to the end of the axis line.
axis2 label=none
order=(0 to 100000 by 20000)
minor=(number=1)
850 Example 5: Controlling Midpoints and Statistics in a Horizontal Bar Chart Chapter 29
offset=(,0);
Modify the legend. LABEL= suppresses the legend label. SHAPE= defines the size of the
legend values. CBORDER= draws a black frame around the legend. CBLOCK= specifies a gray
block that matches the 3D planes. ORIGIN= specifies the same position as in the AXIS1
statement.
legend1 label=none
shape=bar(3,3)
cborder=black
cblock=gray
origin=(24,);
Define pattern characteristics. PATTERN statements define the colors that are assigned to
subgroups. Light colors allow the black labels to show up. Default pattern fill is solid.
pattern1 color=lipk;
pattern2 color=cyan;
pattern3 color=lime;
Produce the vertical bar chart. SUBGROUP= creates a separate bar segment for each
department. INSIDE= prints the subgroup percent statistic inside each bar segment.
OUTSIDE= prints the sum statistic above each bar. WIDTH= makes the bars wide enough to
display the statistics. SPACE= controls the space between the bars. MAXIS= assigns the AXIS1
statement to the midpoint axis. RAXIS= assigns the AXIS2 statement to the response axis.
LEGEND= assigns the LEGEND1 statement to the subgroup legend. CFRAME= specifies the
color for the 3D planes.
proc gchart data=reflib.totals;
format quarter roman.;
format sales dollar8.;
vbar3d site / sumvar=sales
subgroup=dept
inside=subpct
outside=sum
width=9
space=4
maxis=axis1
raxis=axis2
cframe=gray
coutline=black
legend=legend1;
run;
quit;
This example uses the FITNESS data set to produce a horizontal bar chart that
shows the number of people in each age group in a fitness program.
It charts the numeric variable AGE, with the frequency statistic. Because the values
of AGE are continuous, the procedure automatically divides the ages into ranges and
displays the midpoint of each age range. The frequency statistic calculates the number
of observations in each range. The chart statistic defaults to FREQ because the
SUMVAR= and TYPE= options are omitted. The table of statistics displays all the
statistic values.
The program also subgroups each age group bar to show the number of men and
women in the group. Because the default value for the PATTERNID= option is
SUBGROUP, the procedure automatically assigns a different pattern to each subgroup
and the PATTERNID= option is unnecessary.
PATTERN statements specify the colors for the subgroups. Whenever the GCHART
procedure uses PATTERN statements, the default outline color of the bars changes from
black to the color of the bar. Because this program uses PATTERN statements, it also
uses COUTLINE= to specify a black outline for the bars.
The second part of this example modifies the midpoint axis and the table of statistics,
and uses RUN-group processing to produce the following chart. This part of the
program specifies the midpoint value for each bar and requests only the FREQ statistic
for the table.
852 Example 5: Controlling Midpoints and Statistics in a Horizontal Bar Chart Chapter 29
Assign the libref and set the graphics environment. Black is the first color in the colors list
and, by default, is used for all text and for the axis lines and frame. Therefore, it is not necessary
to use CTEXT= (GOPTIONS statement) and CAXIS= (HBAR statement) to specify a color.
libname reflib ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(black blue green red) ftext=swiss
ftitle=swissb htitle=6 htext=3.5;
Create the data set FITNESS. FITNESS contains age and sex of participants, as well as the
number of times they exercise each week and their resting heart rate and aerobic power.
data reflib.fitness;
input age sex $ heart exer aero;
datalines;
28 M 86 2 36.6
41 M 76 3 26.7
30 M 78 2 33.8
...more data lines...
29 M 54 3 44.8
48 F 66 2 28.9
36 F 66 2 33.2
;
Modify the response axis. OFFSET= moves the first and last tick marks to the ends of the
axis line.
axis1 label=(’Number of People’)
minor=(number=1)
offset=(0,0);
The GCHART Procedure Example 5: Controlling Midpoints and Statistics in a Horizontal Bar Chart 853
Modify the legend. VALUE= specifies the text that describes the values.
legend1 label=none
value=(’Women’ ’Men’);
Define pattern colors for the subgroups. The procedure automatically assigns a pattern to
each subgroup, using the default fill, SOLID, with the specified color.
pattern1 color=cyan;
pattern2 color=blue;
Produce the first horizontal bar chart. Because neither MIDPOINTS= nor DISCRETE is
used, the procedure automatically selects the midpoints. SUBGROUP= divides the bars
according to the values of SEX and automatically generates a legend. AUTOREF adds reference
lines to the chart at each major tick mark. CLIPREF positions the reference lines behind the
bars. COUTLINE= specifies the outline color for the bars.
Modify the response axis for the second chart. ORDER= places major tick marks on the
response axis at intervals of 2.
axis1 order=(0 to 20 by 2)
label=(’Number of People’)
minor=(number=1)
offset=(0,0);
Produce the second horizontal bar chart with modified midpoints. MIDPOINTS=
specifies the middle value of the range of values represented by each bar. FREQ requests that
only the frequency statistic appears in the table. FREQLABEL= specifies the text for the
column header in the table of statistics.
854 Example 6: Generating Error Bars in a Horizontal Bar Chart Chapter 29
This example uses the FITNESS data set to chart the mean heart rate for each age
group with error bars showing the confidence limits for the average. The response axis
label describes the confidence limit for the error bars. To make the error bars easier to
read, the program suppresses the frame that the procedure draws around the axis area.
The GCHART Procedure Example 6: Generating Error Bars in a Horizontal Bar Chart 855
Descriptive column head labels in the table of statistics replace the statistic names that
appear by default.
Modify the axis labels. AXIS1 is assigned to the response axis and AXIS2 is assigned to the
midpoint axis.
axis1 label=(’Heart Rate’ j=c
’Error Bar Confidence Limits: 95%’)
minor=(number=1);
axis2 label=(’Age’ j=r ’Group’);
Define a color for the bars. The PATTERN statement uses the default fill, SOLID, with the
specified color to create a pattern for the bars. Using a PATTERN statement causes the default
bar outline color to be the same as the fill color. COUTLINE= in the HBAR statement assigns a
black outline.
pattern1 color=cyan;
Produce the horizontal bar chart. SUMVAR= calculates the mean of the variable HEART
for all the observations in each midpoint group. TYPE= specifies the mean statistic for the
summary variable, HEART. FREQLABEL= and MEANLABEL= specify new column labels for
the frequency and mean statistics. ERRORBAR= draws the error bars as empty bars and CLM=
specifies the confidence level. COUTLINE= outlines the bars in black. NOFRAME suppresses
the axis area frame.
proc gchart data=reflib.fitness;
hbar age / type=mean
sumvar=heart
freqlabel=’Number in Group’
meanlabel=’Mean Heart Rate’
errorbar=bars
clm=95
midpoints=(20 30 40 50)
raxis=axis1
maxis=axis2
noframe
coutline=black;
run;
856 Example 7: Creating Bar Charts with Drill-down for the Web Chapter 29
quit;
This example shows how to create 3D bar charts with drill-down functionality for the
Web. In addition to showing how to use the ODS HTML statement and the HTML
options to create the drill-down, the example also illustrates other VBAR3D statement
options.
For creating output with drill-down for the Web, the example shows how to
3 explicitly name the HTML files and open and close them throughout the program
3 specify names and destination for the GIF files created by the ODS HTML
statement and the GIF device driver
3 assign anchor names to the graphics output
3 use the HTML= and HTML_LEGEND= procedure options to assign link targets
3 use BY-group processing to store multiple graphs in one file or in individual files
3 use incremented anchor names and incremented file names.
For more information, see “ODS HTML Statement” on page 164 in Chapter 7, “SAS/
GRAPH Statements,” on page 121.
For creating 3D bar charts, the example shows how to
3 group the midpoints, including patterning bars by group, modifying the group axis,
adjusting the space between groups of bars
3 identify midpoint values with a legend instead of labeling each bar
The GCHART Procedure Example 7: Creating Bar Charts with Drill-down for the Web 857
3 subgroup bars
3 remove an axis and its axis plane
3 add reference lines.
The introduction to each part lists the VBAR3D options that it features.
The program generates twelve linked bar charts that display data about the world’s
leading grain producers. The data contain the amount of grain produced by five
countries in 1995 and 1996. Each of these countries is one of the three leading
producers of wheat, rice, or corn, worldwide.
The first chart, shown in Figure 29.15 on page 857 as it appears in a browser, is an
overview of the data that shows the total grain production for the five countries for both
years.
The next two charts break down grain production by year. These charts are linked to
the legend values in Figure 29.15 on page 857. For example, when you select the legend
value for 1995, the graph in Figure 29.16 on page 858 appears.
858 Example 7: Creating Bar Charts with Drill-down for the Web Chapter 29
Another group of charts breaks down the data by country. These charts are linked to
the bars. For example, when you drill down on the bar for China in either Figure 29.15
on page 857 or Figure 29.16 on page 858, the graph in Figure 29.17 on page 858 appears.
Finally the data is charted by grain type. These graphs are linked to the bars in
Figure 29.17 on page 858. If you select the legend value or bar for Rice, Figure 29.18
on page 859 appears.
The GCHART Procedure Example 7, Part A 859
Example 7, Part A
Features: VBAR3D options:
DES=
DISCRETE
GROUP=
GSPACE=
HTML=
HTML_LEGEND=
NAME=
SUBGROUP=
ODS HTML options:
BODY=
CONTENTS=
FRAME=
GPATH=
NOGTITLE
860 Example 7, Part A Chapter 29
The first part of the program, which includes setting the graphics environment and
creating the data set, does the following:
3 Adds three HTML variables to the data set. The variables contain the link targets
for all of the graphs that support drill-down functionality. The HREF values for
the HTML variables in the data set contain this information about the link targets:
3 the name of the body file that is the target. BODY= in the ODS HTML
statement names the body file.
3 the anchor name of the output if the target file contains more than one
graph. By default, all output is assigned a unique anchor name unless you
specify a name with ANCHOR= in the ODS HTML statement.
3 Opens the HTML destination for the frame and contents files and the first body file.
3 Creates one grouped 3D vertical bar chart (shown in Figure 29.15 on page 857)
with drill-down on the bars and legend values. The bars, which represent total
production for each year for each country, are grouped and labeled by COUNTRY.
Instead of displaying the year below each bar, the program suppresses the
midpoint values with an AXIS statement and creates a legend that associates bar
color and year. To create the legend, the chart variable YEAR is assigned to the
SUBGROUP= option. Because the chart variable and the subgroup variable are
the same, each bar contains only one "subgroup." As a result, the subgroup legend
has an entry for each value of YEAR, thereby creating a legend for the midpoints.
The values of COUNTRY label each group of bars.
3 Assigns the HTML variables that contain link information for the bars and for the
legend values to the HTML= and HTML_LEGEND= options, respectively.
Assign the Web-server path. FILENAME assigns the fileref ODSOUT, which specifies a
destination for the HTML and GIF files produced by the example program. To assign that
location as the HTML destination for program output, ODSOUT is specified later in the
program on the ODS HTML statement’s PATH= option. ODSOUT must point to a Web-server
location if procedure output is to be viewed on the Web.
filename odsout ’path-to-Web-server-space’;
Close the ODS listing destination for procedure output, and set the graphics
environment.To conserve system resources, the graphics output is not displayed in the GRAPH
window, although it is written to the graphics catalog and to the GIF files.
ods listing close;
goptions reset=global gunit=pct
htitle=6 htext=4 ftitle=zapfb ftext=swiss;
Create the data set GRAINLDR. GRAINLDR contains data about grain production in five
countries for 1995 and 1996. The quantities in AMOUNT are in thousands of metric tons.
MEGTONS converts these quantities to millions of metric tons.
data grainldr;
length country $ 3 type $ 5;
input year country $ type $ amount;
megtons=amount/1000;
The GCHART Procedure Example 7, Part A 861
datalines;
1995 BRZ Wheat 1516
1995 BRZ Rice 11236
1995 BRZ Corn 36276
1995 CHN Wheat 102207
1995 CHN Rice 185226
1995 CHN Corn 112331
1995 IND Wheat 63007
1995 IND Rice 122372
1995 IND Corn 9800
1995 INS Wheat .
1995 INS Rice 49860
1995 INS Corn 8223
1995 USA Wheat 59494
1995 USA Rice 7888
1995 USA Corn 187300
1996 BRZ Wheat 3302
1996 BRZ Rice 10035
1996 BRZ Corn 31975
1996 CHN Wheat 109000
1996 CHN Rice 190100
1996 CHN Corn 119350
1996 IND Wheat 62620
1996 IND Rice 120012
1996 IND Corn 8660
1996 INS Wheat .
1996 INS Rice 51165
1996 INS Corn 8925
1996 USA Wheat 62099
1996 USA Rice 7771
1996 USA Corn 236064
;
Add three HTML variables to GRAINLDR to create the NEWGRAIN data set. Each
HTML variable is assigned the targets for a certain variable value. These targets are specified
by the HREF attribute within an AREA element in the HTML file. Each HREF value specifies
the HTML body file and, optionally, the name of the anchor within the body file that identifies
the target graph. The HTML variable YEARDRILL contains the targets for the values of the
variable YEAR.
data newgrain;
set grainldr;
length yeardrill typedrill countrydrill $ 40;
if year=1995 then
yeardrill=’HREF="year95_body.html"’;
else if year=1996 then
yeardrill=’HREF="year96_body.html"’;
The HTML variable COUNTRYDRILL contains the targets for the values of the variable
COUNTRY. Because the graphs of COUNTRY are in one file, the targets must include the
anchor name.
862 Example 7, Part A Chapter 29
if country=’BRZ’ then
countrydrill=’HREF="country_body.html#country"’;
else if country=’CHN’ then
countrydrill=’HREF="country_body.html#country1"’;
else if country=’IND’ then
countrydrill=’HREF="country_body.html#country2"’;
else if country=’INS’ then
countrydrill=’HREF="country_body.html#country3"’;
else if country=’USA’ then
countrydrill=’HREF="country_body.html#country4"’;
The HTML variable TYPEDRILL contains the names of the files that are the targets for the
values of the variable TYPE.
if type=’Corn’ then
typedrill=’HREF="type1_body.html"’;
else if type=’Rice’ then
typedrill=’HREF="type2_body.html"’;
else if type=’Wheat’ then
typedrill=’HREF="type3_body.html"’;
run;
Define pattern colors for all graphs. To avoid solid black patterns (BLACK is the first color
in the colors list), explicitly assign the pattern colors.
pattern1 color=blue;
pattern2 color=green;
pattern3 color=cyan;
Define legend characteristics for all legends. OFFSET= moves the legend down.
legend1 label=none
shape=bar(4,4)
position=(bottom center)
offset=(-3);
Assign the GOPTIONS for ODS HTML destination. DEVICE= generates the SAS/GRAPH
output as GIF files. TRANSPARENCY makes the background of the graphs the same as the
Web-page background. NOBORDER turns off the border around the graphics output area.
The GCHART Procedure Example 7, Part A 863
Open the ODS HTML destination for the ODS graphics output. BODY= names the file for
storing the HTML output. CONTENTS= names the HTML file that contains the table of
contents to the HTML procedure output. The contents file links to each of the body files written
to the HTML destination. FRAME= names the HTML file that integrates the contents and body
files. PATH= specifies the ODSOUT fileref as the HTML destination for all the HTML and GIF
files. NOGTITLE suppress the graph titles from the SAS/GRAPH output and displays them
through the HTML page.
Suppress the label and values for the midpoint axis. The midpoint values 1995 and 1996
do not appear below each bar.
Modify the response axis. ANGLE=90 prints the axis label vertically.
Suppress the label and order the values for the group axis. Because the values of
COUNTRY are formatted, ORDER= must specify their formatted value.
axis3 label=none
order=(’China’ ’United States’ ’India’
’Indonesia’ ’Brazil’)
split=’ ’;
Define titles and footnote. The footnote uses the catalog entry name to identify the graph.
Generate the vertical bar chart that summarizes all grain production for all countries
for both years. DISCRETE creates a separate bar for each unique value of YEAR. GROUP=
groups the bars by country. To create a legend for midpoint values, SUBGROUP= is assigned
the chart variable. GSPACE= controls the space between the groups of bars.
864 Example 7, Part B Chapter 29
HTML= specifies COUNTRYDRILL as the variable that contains the targets for the bars.
HTML_LEGEND= specifies YEARDRILL as the variable that contains the targets for the
legend values. Specifying HTML variables causes SAS/GRAPH to add an image map to the
HTML body file. NAME= specifies the name of the catalog entry. Because the PATH=
destination is a file storage location and not a specific file name, the catalog entry name
GRAINALL is automatically assigned to the GIF file. DES= specifies the description that is
stored in the graphics catalog and used in the Table of Contents.
html=countrydrill
html_legend=yeardrill
name=’grainall’
des=’Overview of leading grain producers’;
run;
Example 7, Part B
Features: VBAR3D options:
AUTOREF
HTML=
HTML_LEGEND=
SUBGROUP=
SPACE=
NAME=
ODS HTML options:
BODY=
In the second part, the PROC GCHART step continues, using RUN-group processing
and WHERE statements to produce two graphs of grain production for each year, one of
which is shown in Figure 29.16 on page 858. Each bar represents a country and is
subgrouped by grain type. As before, both the bars and the legend values are links to
other graphs. The bars link to targets stored in COUNTRYDRILL and the legend
values link to targets in TYPEDRILL. These two graphs not only contain links, they are
the link targets for the legend values in Figure 29.15 on page 857. Before each graph is
generated, the ODS HTML statement opens a new body file in which to store the
output. Because each of these graphs is stored in a separate file, the HREF attributes
that are stored in the variable YEARDRILL point only to the file. The name of the file
The GCHART Procedure Example 7, Part B 865
is specified by the BODY= option in the ODS HTML statement. For example, this is the
HREF attribute that points to the graph of 1995 and is stored in the variable
YEARDRILL:
HREF=year95_body.html
Open a new body file for the graph of 1995 production.Assigning a new body file closes
GRAIN_BODY.HTML. The contents and frame files, which remain open, will provide links to all
body files.
ods html body=’year95_body.html’ path=odsout;
Subset the data for 1995 and generate the vertical bar chart for 1995. AUTOREF draws
a reference line on the backplane for every major tick mark value. SUBGROUP= creates a
separate bar segment for each department. SPACE= controls the space between the bars.
HTML= names the variable that contains the targets for the bars. HTML_LEGEND= names the
variable that contains the targets for the legend values. The GIF files use the catalog entry
name specified by NAME=.
where year=1995;
vbar3d country / sumvar=megtons
subgroup=type
autoref
html=countrydrill
html_legend=typedrill
legend=legend1
cframe=grayaa
space=3
coutline=black
maxis=axis3
raxis=axis2
name=’year95’
des=’Production Breakdown for 1995’;
run;
Open a new body file for the graph of 1996 production.Assigning a new body file closes
YEAR95_BODY.HTML.
ods html body=’year96_body.html’ path=odsout;
Subset the data for 1996 and generate the vertical bar chart for 1996.
where year=1996;
vbar3d country / sumvar=megtons
subgroup=type
866 Example 7, Part C Chapter 29
autoref
html=countrydrill
html_legend=typedrill
legend=legend1
cframe=grayaa
space=3
coutline=black
maxis=axis3
raxis=axis2
name=’year96’
des=’Production Breakdown for 1996’;
run;
quit;
Example 7, Part C
Features: VBAR3D options:
DES=
GAXIS=
GROUP=
HTML=
NAME=
OUTSIDE=
PATTERNID=
RAXIS=
SHAPE=
ODS HTML options:
BODY=
ANCHOR=
The third part produces the five graphs that show the breakdowns by country. These
graphs are generated with BY-group processing and are all stored in one body file.
When the file is displayed in the browser, all the graphs appear in one frame that can
be scrolled. Because the graphs are stored in one file, the links to them must explicitly
point to the location of each graph in the file, not just to the file. This location is defined
by an anchor. ODS HTML assigns anchor names by default, but you can specify anchor
names with the ANCHOR= option. When the procedure uses BY-group processing to
generate multiple pieces of output, ODS automatically increments the anchor name to
produce a unique name for each graph. This example assigns the base name {mono
country} to ANCHOR=. The graphs created by this part are referenced by the
COUNTRYDRILL variable. With BY-group processing the catalog entry name also
increments automatically. NAME= specifies COUNTRY as the base name for the
graphics output. Because you cannot specify a different description for each graph,
DES= specifies a generic description for the HTML Table of Contents.
Sort the data set for the graphs of production by country.The data must be sorted in
order of the BY variable before running PROC GCHART with BY-group processing.
proc sort data=newgrain out=country;
by country;
run;
The GCHART Procedure Example 7, Part C 867
Open a new body file and specify the base anchor name for the graphs of individual
countries.Assigning a new body file closes YEAR96_BODY.HTML. Because all the graphs
generated by the BY-group processing are stored in one file, each one is automatically assigned
an anchor name. ANCHOR= specifies a base name for these anchors.
Redefine AXIS2 to change the range of values and suppress all axis elements. Setting
all the label and tick mark options to NONE and assigning a line style of 0 removes the
response axis. NOPLANE removes the 3D axis plane. Specifying ORDER= makes all the graphs
use the same range of values.
axis4 label=none;
Suppress the default BY-line and define a title that includes the BY-value. #BYVAL
inserts the value of the BY variable COUNTRY into the title of each report.
options nobyline;
title1 ’Breakdown for #byval(country)’;
footnote1 j=l h=3 ’click on bars’;
footnote2 j=c ’(Millions of Metric Tons)’;
Generate the vertical bar chart of production for each country.GROUP= groups the bars
by country. PATTERNID= assigns patterns by group value. SHAPE= assigns the bar shape.
OUTSIDE= displays the SUM statistic above the bars. RAXIS= assigns the AXIS statement
that removes all exis elements. GAXIS= assigns the AXIS statement that removes the label.
HTML= specifies TYPEDRILL as the variable that contains the targets for the bars. NAME=
specifies the name of the catalog entry. The graphics catalog entry name increments so the GIF
files are named sequentially from COUNTRY to COUNTRY4. The DES= option specifies a
general description that appears in the table of contents for all five graphs.
group=type
shape=hexagon
outside=sum
html=typedrill
width=9
gspace=3
space=0
cframe=grayaa
raxis=axis2
gaxis=axis4
maxis=axis4
name=’country’
des=’Grain and Year Breakdown’;
run;
Example 7, Part D
Features: VBAR3D options:
INSIDE=
NOZERO
ODS HTML options:
BODY=
NEWFILE=TABLE
Like Part C, this part uses BY-group processing to generate three graphs that show
the three leading producers for each type of grain. The program subsets the data and
suppresses midpoints with no observations. Instead of storing all of the output in one
body file, it stores each graph in a separate file. To do this, the program uses the ODS
HTML option NEWFILE=TABLE. When NEWFILE=TABLE is used with BY-group
processing, each new piece of output automatically generates a new body file and simply
increments the name of the file that is specified by BODY=. Because each graph is
stored in a separate file, the links to these graphs reference only the file name and do
not require an anchor name. The graphs created by this part are referenced by the
TYPEDRILL variable.
Sort the data set for the graphs of leading producers of each grain type.
proc sort data=grainldr out=type;
by type;
run;
Modify the group axis.Because SPLIT= assigns a blank as the split character, the value
United States automatically prints on two lines.
The GCHART Procedure Example 8: Specifying the Sum Statistic for a Pie Chart 869
axis5 label=none
split=’ ’;
Define title and footnote. #BYVAL inserts the value of the BY variable TYPE into the title of
each report.
Generate the vertical bar chart of leading producers for each grain type.BY-group
processing generates a separate graph for each value TYPE. Each new graph generates a new
body file. NOZERO suppresses the midpoints that do not have any observations. INSIDE=
displays the SUM statistic inside the bars.
Close the ODS HTML destination, and open the ODS Listing destination. You must close
the HTML destination before you can view the output with a browser.
SUMVAR=
PIE3D statement options:
COUTLINE=
EXPLODE=
SUMVAR=
Other features:
FORMAT statement
RUN-group processing
Data set: TOTALS
Sample library member: GCHPISUM
This example produces two pie charts that show total sales for three sites by charting
the values of the character variable SITE and calculating the sum of the variable
SALES for each site. It represents the statistics as slices of the pie. By default, the
midpoint value and the summary statistic are printed beside each slice.
The pie slices use the default pattern fill, which is solid. Because a colors list is
specified in the GOPTIONS statement, the default solid patterns rotate through the
colors in the list, beginning with the first color, blue. Each slice displays a different
color because, by default, pie charts are patterned by midpoint. Because the default
outline color is also the first color in the list, the example uses the COUTLINE= option
to assign black to the outlines.
The second pie chart is a 3D pie chart with an exploded slice, as shown in the
following output.
The GCHART Procedure Example 8: Specifying the Sum Statistic for a Pie Chart 871
Assign the libref and set the graphics environment. CTEXT= specifies the color for all text
on the output. COLORS= specifies the colors list, which is used by the default patterns and
outlines.
libname reflib ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(blue green red) ctext=black
ftitle=swissb ftext=swiss htitle=6 htext=4;
Produce the first pie chart. The PIE statement produces a two-dimensional pie chart.
SUMVAR= calculates the sum of SALES for each value of the chart variable SITE. The default
statistic for SUMVAR= is SUM. The summary variable SALES is assigned a dollar format.
COUTLINE= specifies the outline color for the slices.
proc gchart data=reflib.totals;
format sales dollar8.;
pie site / sumvar=sales
coutline=black;
run;
Produce the second pie chart. The PIE3D statement produces a three-dimensional pie chart.
EXPLODE= separates the slice for Paris from the rest of the pie.
872 Example 9: Subgrouping a Donut or Pie Chart Chapter 29
This example produces a donut chart that is similar to the pie chart in Example 8 on
page 869 in that each slice represents total sales for a site and each slice is a different
color. However, in this donut chart the sites are subgrouped by department, so that
each department is represented as a concentric ring with slices.
Subgrouping suppresses the chart statistic and the midpoint labels. Instead it
automatically labels the rings with the subgroup values and generates a legend that
shows how the patterns are associated with the midpoint values. Subgrouping a pie
chart produces the same results but without the hole in the center.
To allow the donut chart to be as large as possible, the program suppresses the
default heading and moves the legend into the space at the left of the chart.
Modify the subgroup legend. LABEL= suppresses the legend label. SHAPE= defines the
shape of the legend values. POSITION=, OFFSET=, and ACROSS= arrange the legend entries
in a column to the left of the pie chart. MODE= allows the legend to occupy the procedure
output area.
legend1 label=none
shape=bar(4,4)
position=(middle left)
offset=(5,)
across=1
mode=share;
Produce the donut chart. SUBGROUP= divides the donut into rings. Each ring represents a
value of the subgroup variable, DEPT. The DONUTPCT= option controls the size of the donut
hole, which contains the text specified by LABEL=. The NOHEADING option suppresses the
default heading that contains the name of the chart variable and the type of statistic.
LEGEND= assigns the LEGEND1 statement to the chart COUTLINE= specifies the outline
color for the slices and subgroup rings. CTEXT= specifies the color used by the donut label and
by the subgroup arrows.
proc gchart data=reflib.totals;
format sales dollar8.;
donut site / sumvar=sales
subgroup=dept
donutpct=30
label=(’All’ justify=center ’Quarters’)
noheading
legend=legend1
coutline=black
ctext=black;
run;
quit;
MIDPOINTS=
PERCENT=ARROW
SLICE=ARROW
SUBGROUP=
VALUE=NONE
Sample library member: GCHLABEL
This example produces a pie chart of sources of energy production for 1995. The
labeled slices represent the percent of total production for each source. Instead of the
sum statistic, each slice displays the percent each midpoint contributes to the whole
pie. Arrows connect the midpoint labels to the slices, which are arranged by the
MIDPOINTS= option so that the small slices are not next to each other and their labels
do not overlap.
data reflib.enprod;
input @1 year 4. @6 engytype $8. @16 produced 5.2;
datalines;
1985 Coal 19.33
1985 Gas 19.22
1985 Petro 18.99
...more data lines...
1995 Hydro 3.21
1995 Geotherm .31
1995 Biofuels 2.95
;
The GCHART Procedure Example 11: Assigning Patterns and Identifying Midpoints with a Legend 875
Produce the pie chart. The WHERE data set option subsets the data for 1995. OTHER=0
specifies that all midpoints, no matter how small, display a slice. MIDPOINTS= assigns the
order of the slices. Each slice displays the percent contribution to total production and the slice
name. VALUE=NONE suppresses the chart statistic. Both SLICE= and PERCENT= are
assigned the ARROW labeling method to point to the slice, but only one arrow line is displayed.
CFILL= specifies a color for the fill used by all slices.
This example shows the actual amount of energy that is produced by each source for
1985. It displays the chart statistic inside each slice and uses a legend instead of slice
labels to identify the slices. Pattern colors are assigned explicitly to each energy source.
All of the variables with midpoint values less than or equal to 5 percent of the total
(in this case, biofuels, geotherm, and hydro) are grouped into one slice labeled "Other."
The slices are ordered from largest to smallest based on the statistic value. Although
the "Other" slice is always last, it is in this case also the smallest.
Define pattern colors. Each value of the chart variable ENGYTYPE is assigned a pattern
whether or not it is displayed as a separate slice. Patterns are assigned to midpoints in the
order the values appear in the data set. Because ENGYTYPE is character, the patterns are
assigned alphabetically. The eighth pattern is for the "other" slice, which is always last.
Modify the legend. LABEL= removes the legend label. VALUE= defines the color for the value
labels; by default legend value color is determined by the CTEXT= option in the procedure
statement. In this case, CTEXT=WHITE, so the legend statement uses the VALUE= option to
override that color specification. ORDER= orders the legend values to match the slice order in
the pie chart.
legend1 label=none
position=(left middle)
offset=(4,)
across=1
order=(’Coal’ ’Gas’ ’Petro’
’Nuclear’ ’Renewable’)
value=(color=black)
shape=bar(4,4);
Create the pie chart. OTHER= collects all the midpoints with statistic values less than or
equal to 5 percent of the total into one slice. OTHERLABEL= specifies the label for the "other"
slice. DESCENDING arranges the slices in descending order of the statistic value. LEGEND=
displays the customized legend created in the LEGEND statement and suppresses the slice
labels. VALUE= places the chart statistics inside the slices. CTEXT= specifies white for the
statistic text. Because CTEXT= also affects the color of the legend text, the LEGEND statement
specifies black text so that the values can be seen. Because the PATTERN statement is used,
the default slice outline matches the fill color; COUTLINE= changes the outline color to black.
proc gchart data=reflib.enprod(where=(year=1985));
pie engytype / sumvar=produced
other=5
otherlabel=’Renewable’
descending
legend=legend1
value=inside
ctext=white
coutline=black
noheading;
run;
quit;
This example produces two pie charts that shows energy sources by year. Both charts
are displayed on one page and are arranged two across. The program uses the
CLOCKWISE option to arrange the slices, which begin at the 12 o’clock position and
proceed clockwise in alphabetic order of the midpoint.
The chart statistic is suppressed and the midpoint label and the percent of the chart
statistic are displayed outside of the slice.
A different color is defined for each energy type. The patterns are assigned in order
of midpoint value. Some colors do not appear because the slices they represent are
grouped into the OTHER slice, which is assigned the eighth color, red.
Define patterns for the pie slices. PATTERN statements define a different solid color for
each midpoint value.
pattern1 color=black; /* biofuels */
pattern2 color=blue; /* coal */
pattern3 color=green; /* gas */
pattern4 color=gray; /* geothermal */
pattern5 color=lipk; /* hydroelectric */
pattern6 color=lime; /* nuclear */
pattern7 color=cyan; /* petro */
pattern8 color=red; /* other */
The GCHART Procedure Example 13: Specifying the Sum Statistic in a Star Chart 879
Produce the pie charts. The WHERE= data set option selects the data for only two years. The
LABEL statement suppresses the variable name, so only the YEAR value is displayed.
GROUP= creates a separate pie for each year. In combination with GROUP=, ACROSS= draws
two charts across one page. OTHER= collects all the midpoints with statistic values less than or
equal to 5 percent of the total into one slice. CLOCKWISE begins drawing the slices at the 12
o’clock position in alphabetic order of the midpoint. PERCENT=OUTSIDE and
SLICE=OUTSIDE display the labels outside the slices.
pie engytype / sumvar=produced
group=year
across=2
other=5
otherlabel=’Renewable’
clockwise
value=none
slice=outside
percent=outside
coutline=black
noheading;
run;
quit;
This example produces a star chart of total sales for three sites by charting the
values of the character variable SITE and calculating the sum of the variable SALES
for each site. It represents the statistics as slices of the star. The center of the circle
represents 0 and the edge of the circle represents the largest value, in this case Paris
sales. By default, the spines are joined and filled with a solid pattern to form slices, and
the midpoint value and the formatted values of the sales statistics are printed beside
each slice.
By default, the circle and the slice outlines use the first color in the colors list, in this
case, BLUE.
Produce the star chart. SUMVAR= calculates the sum of SALES for each value of the chart
variable SITE. Because the TYPE= option is omitted, the default statistic is sum. The FORMAT
statement assigns a format to the summary variable SALES.
proc gchart data=reflib.totals;
format sales dollar8.;
star site / sumvar=sales;
run;
quit;
This example produces two star charts that show the total number of parts that were
rejected each month for a year. The STAR statement uses the DISCRETE option so
that each unique value of the numeric variable DATE is a separate midpoint and has a
separate spine. Each slice displays the formatted midpoint value and the chart
statistic. Specifying FILL=S rotates the solid pattern through all the colors in the colors
list as many times as necessary to provide patterns for all the slices.
The second chart uses the NOCONNECT option so that the chart uses spines instead
of slices.
Set the graphics environment. COLORS= specifies the colors list, which is used by the
default patterns and outlines.
882 Example 14: Charting a Discrete Numeric Variable in a Star Chart Chapter 29
Create the data set REJECTS. REJECTS contains data on the number of defective parts
produced at each of three sites for 12 months. BADPARTS is the number of parts that were
rejected at each site for each month.
data rejects;
informat date date9.;
input site $ date badparts;
datalines;
Sydney 01JAN1997 22
Sydney 01FEB1997 26
...more data lines...
Paris 01NOV1997 12
Paris 01DEC1997 19
;
Produce the first star chart. DISCRETE must be specified because the numeric chart
variable, DATE is assigned the WORDDATE3. Using FILL=S fills all the slices with solid
patterns.
Produce the second star chart with slices and a solid fill. NOHEADING suppresses the
default heading for the star chart. NOCONNECT suppresses the lines that by default join the
ends of the spines. COUTLINE= colors the spines and the circle.
coutline=red;
run;
quit;
This example produces a normal pie chart with a detail pie overlay. The pie chart
shows percentages of sales for three sites by charting the values of the character
variable SITE and calculating the percentage of the variable SALES for each site. The
detail pie overlay shows the percentages of sales for each DEPT at each SITE. The pie
slices use the colors in the default color list and the default fill, which is solid.
Set the graphics environment. The CBACK= option sets the background color. The FTITLE=
and HTITLE= options set the font and size of the title text. The FTEXT and HTEXT= options
set the font and size of other text, such as slice labels.
Create the data set TOTALS. TOTALS contains quarterly sales data for three manufacturing
sites for one year. Sales figures are broken down by department.
884 References Chapter 29
data totals;
length Dept $ 7 Site $ 8;
input Dept Site Quarter Sales;
datalines;
Parts Sydney 1 4043.97
Parts Atlanta 1 6225.26
Parts Paris 1 3543.97
...more data lines
Tools Sydney 4 3817.36
Tools Atlanta 4 4354.18
Tools Paris 4 6511.70
;
Produce the detail pie chart. SUMVAR= calculates the sum of SALES for each value of the
chart variable SITE. DETAIL= produces a inner pie overlay showing the percentage that each
DEPT contributes toward each site’s sales. DETAIL_PERCENT= and DETAIL_SLICE= control
the positioning of the detail slice labels. DETAIL_VALUE= turns off the display of the sales
values for each detail slice.
proc gchart data=totals;
pie site / sumvar=sales
detail=dept
detail_percent=best
detail_value=none
detail_slice=best
legend;
run;
quit;
References
Nelder, J. A. (1976), "A Simple Algorithm for Scaling Graphs," Applied Statistics,
Volume 25, Number 1, London: The Royal Statistical Society.
CHAPTER
30
The GCONTOUR Procedure
Overview 885
Concepts 885
About Contour Plots 885
Parts of a Contour Plot 886
About the Input Data Set 887
Interpolating Additional Values 887
Procedure Syntax 888
PROC GCONTOUR Statement 888
PLOT Statement 889
Examples 904
Example 1: Generating a Simple Contour Plot 904
Example 2: Labeling Contour Lines 906
Example 3: Specifying Contour Levels 908
Example 4: Using Patterns and Joins 910
References 913
Overview
The GCONTOUR procedure produces plots that represent three-dimensional
relationships. The colors, contours, or surface areas of a contour plot represent the
values of a contour variable at each point in a plane that is formed by a dependent and
an independent variable. The contour variable is applied to the Z axis of the plot, the
dependent variable is applied to the X axis of the plot, and the independent variable is
applied to the Y axis of the plot.
Concepts
within the plot represent the locations on the plane that have the clay percentages
specified in the legend. The program for this plot is in Example 1 on page 904.
By default, the GCONTOUR procedure automatically scales the axes to include the
maximum and minimum data values, labels each axis with the name of its variable or
an associated label, and draws a frame around the plot. In addition, it plots values
using seven contour levels of the contour variable, representing those levels with
default colors and line types. Finally, it generates a legend that is labeled with the
contour variable’s name.
Procedure Syntax
Requirements: At least one PLOT statement is required.
Global statements: AXIS, FOOTNOTE, GOPTIONS, LEGEND, PATTERN, SYMBOL,
TITLE
Reminder: The procedure can include the BY, FORMAT, LABEL, NOTE, and WHERE
statements.
Supports: Output Delivery System (ODS)
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all graphs produced by the GCONTOUR procedure.
To annotate individual graphs, use ANNOTATE= in the action statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
DATA=input-data-set
identifies the SAS data set that contains the variables to plot. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29 and “About the Input Data Set” on page 887.
GOUT=< libref. >output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GCONTOUR procedure. If you omit the libref, the SAS/GRAPH software looks for
the catalog in the temporary library called WORK and creates the WORK catalog if
it does not exist.
See also: “Creating and Specifying Catalogs” on page 54
Not supported by: Java, ActiveX
The GCONTOUR Procedure PLOT Statement 889
INCOMPLETE
allows plotting of data when values are missing for more than half of the variables in
the data set.
Not supported by: Java, ActiveX
PLOT Statement
Creates contour plots using values of three numeric variables from the input data set as the
source of the contour coordinates.
Description
The PLOT statement specifies the three variables to plot. Optionally, it controls the
contour levels, labels the plot lines, and modifies axes as well as the general appearance
of the graph. Only one plot request can be specified in a PLOT statement. To specify
multiple plots for a single PROC GCONTOUR statement, use multiple PLOT
statements.
The PLOT statement automatically
3 plots the values using seven contour levels of the z variable
3 scales the axes to include the maximum and minimum data values
3 labels the x and y axes and displays the contour levels in the plot’s legend
3 draws a frame around the plot.
You can use global statements to modify the axes, the legend, the contour lines and
contour line labels, and the fill patterns and pattern colors for contour areas. You can
also add titles, footnotes, and notes to the chart, and you can use an Annotate data set
to enhance the appearance of the chart.
Required Arguments
y*x=z
specifies three numeric variables from the input data set:
Options by Category
option(s) can be one or more options in the following categories:
3 appearance options:
ANNOTATE=Annotate-data-set
CAXIS=axis-color
CFRAME=background-color
COUTLINE=outline-color
CTEXT=text-color
GRID
NOAXIS | NOAXES
NOFRAME
3 horizontal axis options:
AUTOHREF
CAUTOHREF=reference-line-color
LAUTOHREF=reference-line-type
CHREF=reference-line-color | (reference-line-color) | reference-line-color-list
HAXIS=AXIS<1...99>
HMINOR=number-of-minor-ticks
HREF=value-list
HREVERSE
LHREF=reference-line-type | (reference-line-type) | reference-line-type-list
XTICKNUM=number-of-ticks
3 vertical axis options:
AUTOVREF
CAUTOVREF=reference-line-color
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
LAUTOVREF=reference-line-type
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
VAXIS=AXIS<1...99>
VMINOR=number-of-minor-ticks
VREF=value-list
VREVERSE
YTICKNUM=number-of-ticks
3 contour options:
CLEVELS=color(s)
JOIN
LEGEND=LEGEND<1...99>
LEVELS=value-list
LLEVELS=line-type-list
NLEVELS=number-of-levels
NOLEGEND
PATTERN
3 labeling options:
AUTOLABEL | AUTOLABEL=(autolabel-suboptions)
The GCONTOUR Procedure PLOT Statement 891
Options
You can specify any of the following options in your PLOT statement, in any order. If
you use a BY statement on the procedure, the options in each PLOT statement affect all
graphs produced by that BY statement.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies an Annotate data set to enhance the charts produced by the PLOT
statement.
See also: Chapter 26, “The GANNO Procedure,” on page 707 and Chapter 25,
“Annotate Dictionary,” on page 613.
AUTOHREF
displays reference lines at major tick marks on the horizontal axis. The positions of
the major tick marks are determined by the HAXIS= or XTICKNUM= option. To
specify colors and line types for these reference lines, use the CAUTOHREF= and
LAUTOHREF= options. To specify labels for these reference lines, use the HAXIS=
option.
Not supported by: Java
AUTOLABEL | AUTOLABEL=(autolabel_suboptions)
automatically labels the contour lines. Autolabel-suboptions“Autolabel Suboptions”
on page 898 allow you to control the appearance of these labels.
The label for each contour line is the value of the z variable for that contour level.
By default, labels are displayed in BEST format. To change the format, use a
FORMAT statement.
When AUTOLABEL is used, the LLEVELS= and CLEVELS= options are ignored
and the SYMBOL“SYMBOL Statement” on page 183 statement controls label text
and contour-line attributes.
Even though AUTOLABEL labels the contour lines, a default legend is still
generated. To suppress the legend, use the NOLEGEND option.
Featured in: Example 2 on page 906
Not supported by: Java, ActiveX
AUTOVREF
displays reference lines at major tick marks on the vertical axis. The number of major
tick marks is determined by the VAXIS= or YTICKNUM= option. To specify colors
and line types for these reference lines, use the CAUTOVREF= and LAUTOVREF=
options. To specify labels for these reference lines, use the VAXIS= option.
Not supported by: Java.
CAUTOHREF=reference-line-color
specifies a color for reference lines drawn at major tick marks on the horizontal axis,
as specified by the AUTOHREF option. The default color for reference lines is
892 PLOT Statement Chapter 30
determined by the CAXIS= option or by the first color in the color list. To specify line
types for these reference lines, use the LAUTOHREF= option. To specify labels for
these reference lines, use the HAXIS= option.
CAUTOVREF=reference-line-color
specifies a color for reference lines drawn at major tick marks on the vertical axis, as
specified by the AUTOVREF option. The default color for reference lines is
determined by the CAXIS= option or by the first color in the color list. To specify line
types for these reference lines, use the LAUTOVREF= option. To specify labels for
these reference lines, use the VAXIS= option.
Not supported by: Java
CAXIS=axis-color
specifies a color for axis lines, tick marks, and reference lines. By default, axes are
displayed in the second color in the colors list.
If you use the CAXIS= option, it may be overridden by the COLOR= suboption of
the MAJOR= or MINOR= option in an AXIS definition.
CFRAME=background-color
CFR=background-color
fills the axis area with the specified color and draws a frame around the axis area.
CHREF=reference-line-color | (reference-line-color) | reference-line-color-list
CH=reference-line-color | (reference-line-color) | reference-line-color-list
specifies the color of reference lines drawn perpendicular to the horizontal axis.
Specifying a single color without parentheses applies that color to all reference lines
drawn with the AUTOHREF and HREF= options. Note that the CAUTOHREF=
option overrides the CHREF= option for lines drawn with the AUTOHREF option.
Specifying a single color in parentheses applies that color only to the first reference
line drawn with the HREF= option. Specifying a color list applies colors sequentially
to successive reference lines drawn with the HREF= option. The syntax of the color
list is of the form (color1 color2... colorN) or (color1, color2..., colorN). Default colors
for reference lines are determined by the CAXIS= option or by the first color in the
color list. To specify line types for these reference lines, use the LHREF= option. To
specify labels for these reference lines, use the HAXIS= option.
Not supported by: Java
CLEVELS=color(s)
specifies a list of colors for plot contour levels. The number of specified colors should
correspond to the number of contour levels since one color represents each level of
contour. If fewer colors are specified than the number of levels in the plot, the
procedure provides default colors from the current colors list. The procedure default
is to rotate through the current colors list for each line type.
This option is ignored if AUTOLABEL is used.
COUTLINE=outline-color
specifies a color for outlining filled areas. This option is ignored unless the PATTERN
option is also used. By default, the outline color is the same as the color of the filled
area.
The default outline color depends on the PATTERN statement. If you do not
specify a PATTERN statement, the default outline color is black for the Java or
ActiveX devices. Otherwise, the default outline color is the foreground color (the first
color in the colors list). If you specify the PATTERN statement or the V6COMP
graphics option, the default is COUTLINE=SAME.
Note: The outline color is the only distinction between empty patterns. Use of
this option makes the patterns look the same when VALUE=EMPTY in PATTERN
definitions. 4
The GCONTOUR Procedure PLOT Statement 893
For Web output that is generated with a Java or ActiveX device driver, certain
options of the AXIS statement are not supported. For details, see “AXIS Statement”
on page 124.
See also: “AXIS Statement” on page 124
Featured in: Example 2 on page 906
Not supported by: Java (partial), ActiveX (partial)
HMINOR=number-of-minor-ticks
HM=number-of-minor-ticks
specifies the number of minor tick marks to draw between each major tick mark on
the horizontal (X) axis. The HMINOR= option overrides the MINOR= option in an
AXIS definition assigned to the horizontal axis.
HREF=value-list
draws one or more reference lines perpendicular to the horizontal axis at points
specified by value-list. See the LEVELS= option for a description of value-list. To
specify colors for these reference lines, use the CHREF= option. To specify line types
for these reference lines, use the LHREF= option. To specify labels for these
reference lines, use the HAXIS= option.
Not supported by: Java
HREVERSE
specifies that the order of the values on the horizontal (X) axis be reversed.
Not supported by: Java
JOIN
combines adjacent grid cells with the same pattern to form a single pattern area.
This option is ignored unless the PATTERN option is also used.
Featured in: Example 4 on page 910
LAUTOHREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the horizontal
axis, as specified by the AUTOHREF option. The reference-line-type value can be a
whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46
specify dashed lines. The default value 1 draws a solid line. To specify colors for
these reference lines, use the CAUTOHREF= option. To specify labels for these
reference lines, use the HAXIS= option.
Not supported by: Java
LAUTOVREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the vertical
axis, as specified by the AUTOVREF option. The reference-line-type value can be a
whole number in the range of 1 to 46. A value of 1 specifies a solid line; values 2
through 46 specify dashed lines. The default value 1 draws a solid line. To specify
colors for these reference lines, use the CAUTOVREF= option. To specify labels for
these reference lines, use the VAXIS= option.
Not supported by: Java
LEGEND=LEGEND<1...99>
assigns a legend definition that specifies the location, text, and appearance of axes on
the plots. To suppress the legend, use the NOLEGEND option. The LEGEND=
option is ignored if the specified LEGEND definition is not currently in effect.
If you use the SHAPE= option in a LEGEND statement, the value LINE is valid.
If you use the PATTERN option, SHAPE=BAR is also valid.
In Web output that uses a Java or ActiveX device driver, the legend will always
appear on the right side of the plot.
The GCONTOUR Procedure PLOT Statement 895
levels. Thus, for a contour plot that uses the default seven levels, specify seven line
types.
If fewer line types are specified than the number of levels in the plot, the
procedure provides default line types. With the default, contour levels rotate through
line types 1 through 46, displaying each line type in all of the colors in the colors list
before moving to the next line type. Line type 1 is a solid line and the others are
dashed line. See “Specifying Line Types” on page 207 for available line types.
For colors and lines specified with both the CLEVELS= and LLEVELS= options,
the first contour level is displayed in the first color in the CLEVELS= color list and
in the first line type specified with the LLEVELS= option. The second level is
displayed in the second color and the second line type, and so on.
This option is ignored if AUTOLABEL is used.
Featured in: Example 3 on page 908
Not supported by: Java
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
LV=reference-line-type | (reference-line-type) | reference-line-type-list
specifies line types for reference lines drawn perpendicular to the vertical axis. The
reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a
solid line; values 2 through 46 specify dashed lines. Specifying a single line type
without parentheses applies that line type to all reference lines drawn with the
AUTOVREF and VREF= options. Note that the CAUTOVREF= option overrides
LVREF=reference-line-type for lines drawn with the AUTOVREF option. Specifying a
single line type in parentheses applies that line type only to the first reference line
drawn by the VREF= option. Specifying a line-type list applies line types in sequence
to successive reference lines drawn with the VREF= option. The syntax of the line
type list is of the form (type1 type2... type3). The default value 1 draws a solid line.
To specify colors for these references lines, use the CVREF= option. To specify labels
for these reference lines, use the VAXIS= option.
Not supported by: Java (partial), ActiveX (partial)
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is 8 characters. The default name is GCONTOUR. If you specify
DEVICE=ACTIXIMG or DEVICE=JAVAIMG, then the name that you specify will be
used for the client image output even in the file exists. For all other devices, if the
name duplicates an existing entry name, SAS/GRAPH adds a number to the
duplicate name to create a unique entry, for example, GCONTOU1.
NLEVELS=number-of-levels
specifies the number of contour levels to plot. Values can be integers from 1 to 100.
The default is NLEVELS=7. The contour levels are computed as follows, where L
represents an array of levels:
3 If the value of NLEVELS= is less than 7, then
D = (Zmax - Zmin) / NLEVELS
d = 0.5 * D
L[0] = Zmin + d, L[i] = L[i-1] + D
In this case, each level is the midpoint of a number of ranges equal to the
value of the NLEVELS= option. These ranges exactly cover the range of the z
variable.
3 If the value of NLEVELS= is greater than or equal to 7, then
e = 0.05 * (100 - NLEVELS) / 93
d = (Zmax - Zmin) * e
D = ((Zmax - Zmin - 2*d) / (NLEVELS - 1)
The GCONTOUR Procedure PLOT Statement 897
In this case, the first and last midpoints are set closer to the minimum and
maximum values of the z variable as the values of NLEVELS= gets closer to
100, and the remaining midpoints are equally spaced between them.
NOAXIS
NOAXES
specifies that a plot have no axes, axis values, or axis labels. The frame is displayed
around the plot unless you use the NOFRAME option.
NOFRAME
suppresses the frame that is drawn by default around the plot area.
NOLEGEND
suppresses the plot legend that describes contour levels and their line types or fill
patterns and colors.
PATTERN
specifies the fill pattern and pattern colors for contour areas. The plot contour levels
are represented by rectangles filled with patterns. The pattern for each rectangle is
determined by calculating the mean of the values of the z variable for the four
corners of the rectangle and assigning the pattern for the level closest to the mean.
By default, the procedure uses a solid pattern for the levels and rotates the
pattern through the colors list. If the V6COMP option is in effect for the GOPTIONS
statement, cross-hatch patterns are used instead of solid patterns. To explicitly
define patterns, use PATTERN definitions for map/plot patterns.
For information on PATTERN statement that are enabled for Web output, see
“PATTERN Statement” on page 169.
See also: “Selecting Contour Levels” on page 899
Featured in: Example 4 on page 910
Featured in: Example 3 on page 908
Not supported by: Java (partial), ActiveX (partial)
VAXIS=AXIS<1...99>
assigns axis characteristics from the corresponding axis definition to the vertical (Y)
axis. If the AXIS statement specifies the REFLABEL= option, labels will be applied
in sequence to all reference lines generated with the AUTOVREF and VREF= options.
For Web output that is generated with a Java or ActiveX device driver, certain
options of the AXIS statement are not supported. For details, see “AXIS Statement”
on page 124.
See also: “AXIS Statement” on page 124
Featured in: Example 2 on page 906
Not supported by: Java (partial), ActiveX (partial)
VMINOR=number-of-minor-ticks
VM=number-of-minor-ticks
specifies the number of minor tick marks located between each major tick mark on
the vertical (Y) axis. No values are displayed for minor tick marks. The VMINOR=
option overrides the MINOR= option in an AXIS definition that is assigned to the
vertical axis.
VREF=value-list
draws one or more reference lines perpendicular to the vertical axis at points
specified by value-list. See the LEVELS= option for a description of value-list. To
specify colors for these reference lines, use the CVREF= option. To specify line types
for these reference lines, use the LVREF= option. To specify labels for these reference
lines, use the VAXIS= option.
898 PLOT Statement Chapter 30
Autolabel Suboptions
The AUTOLABEL= option accepts the following autolabel suboptions.
CHECK=checking-factor | NONE
specifies a collision checking factor that controls collisions between contour label
text and other contour lines or other labels. Values can be integers from 0 to 100,
inclusive, where 0 provides minimal collision checking and 100 provides maximal
collision checking. Fractional values are permitted. The default is CHECK=75.
CHECK=NONE suppresses contour label collision checking and may lessen the
time needed to compute the contour graph.
MAXHIDE=amount <units>
specifies the maximum amount of contour line that can be hidden by contour
labels. The value of amount must be greater than zero.
Valid units are CELLS (horizontal character cell positions), CM (centimeters),
IN (inches), or PCT (percentage of the width of the graphics output area). The
default is MAXHIDE=100PCT. If you omit units, a unit specification is searched
for in this order:
1 the GUNIT= option in a GOPTIONS statement
2 the default unit, CELLS.
If you specify units of PCT or CELLS, the MAXHIDE= suboption calculates the
amount of contour line that can be hidden based on the width of the graphics
output area. For example, if you specify MAXHIDE=50PCT and if the graphics
output area is 9 inches wide, the maximum amount of the contour line that can be
hidden by labels is 4.5 inches.
This option maintains data integrity. It provides a check for overly small
increments in the STEP= option in the SYMBOL statement. Additionally, it can
prevent small contours from being significantly hidden even when the value of
STEP= is sufficiently large.
REVEAL
specifies that the contour lines are visible through the label text as dashed lines.
Line style 33 is used. This option provides a simple way to see all portions of
labeled contours and can be used to inspect the label positions with respect to the
contour lines. It is primarily used for debugging. Occasionally, single-character
contour labels can be placed off center from the clipped portion of the contour line
when the contour line is irregular or jagged.
The GCONTOUR Procedure PLOT Statement 899
TOLANGLE=angle
specifies the maximum angle (the tolerance angle) between any two adjacent
characters of a contour label. The value of angle must be between 1 and 85
degrees. The default is TOLANGLE=30. To force contour labels to fall on very
smooth sections, specify a small tolerance angle.
The contour lines in Figure 30.3 on page 900 represent the intersection of the surface
in Figure 30.2 on page 899 with planes parallel to the plane formed by the variables x
and y and located at z values of –7.5, –5.0, –2.5, and so on.
When you use the PATTERN option, contour levels are represented by rectangles
filled with patterns. The rectangles are formed by points in the x-y grid. The contour
pattern of a rectangle, or grid cell, is determined by the mean or average value of the z
variable for the four corners of the rectangle. The grid cell is assigned the pattern for
the level closest to the calculated mean. For example, if you have specified contour
levels of 0, 5, and 10, and the plot contains a grid cell with a mean of 100, it is assigned
the pattern for the nearest level: 10. A grid cell with a mean of 7.6 will also be assigned
the pattern for the 10 level.
Figure 30.4 on page 900 shows a contour plot with the PATTERN option that uses
the same data and contour levels as Figure 30.3 on page 900. The pattern for the
rectangle is assigned depending on the mean of the grid values at the four corners. As a
result, two contour plots using the same contour levels can present your data differently
if one plot uses a pattern and the other does not. The contour pattern boundaries do not
correspond to the contour lines shown in Figure 30.3 on page 900.
Suppose also that the horizontal axis variable has these values: –5, –4, –3, –2, –1, 0,
1, 2, 3, 4, 5. Depending on the data, contours could extend through the full range of the
ORDER= list rather than from –2 to 2, which are the actual values of the variable
assigned to the horizontal (x) axis. In this case, values are interpolated for the x
variable at any point where the y variable intersects the minimum axis value (–2.5) or
the maximum axis value (2.5). Data values that are outside of the axis range (in this
case, –5, –4, –3, 3, 4, and 5) are clipped from the plot.
When ORDER= lists cause data clipping, internal plotting grids are modified
according to these rules:
3 If an ORDER= list causes data clipping on a single axis, linear interpolation
generates the z values of the starting and/or ending column of the plotting grid.
For example, in the previous example, the value of z is interpolated for –2.5 and
2.5 on the horizontal (x) axis.
3 If ORDER= lists cause data clipping on both axes, the response variable values of
the new corners are derived by fitting the new x, y location on a plane formed by
three of the original four points of the corresponding grid square.
In addition, if you assign the following AXIS definition to a plot of the same data, the
contour levels on the plot will not extend beyond the range of the data:
axis1 order=-10 to 10 by 1;
Figure 30.5 AXIS Statement’s ORDER= Option, where Option Values Match
Variable Values
Figure 30.6 ORDER= Option, where the Option Range is Smaller than the Variable
Range
The GCONTOUR Procedure PLOT Statement 903
Figure 30.7 ORDER= Option, where the Option Range is Larger than Variable
Range
Table 30.1 The Effect of SYMBOL Statement Options on Contour Lines and Labels
The STEP= option specifies the minimum distance between contour labels. The lower
the value, the more labels the procedure uses. A STEP= value of less than 10 percent is
ignored by the GCONTOUR procedure and a value of 10 percent is substituted.
For more information, see “SYMBOL Statement” on page 183.
You must specify both FONT= and VALUE= or the text is not used. For an example,
see Example 2 on page 906.
Examples
This example shows a simple contour plot that describes the percentage of clay found
in soil samples at various locations of a testing site. By default, the axes are scaled to
The GCONTOUR Procedure Example 1: Generating a Simple Contour Plot 905
include all data values and are labeled with the names of the axes variables. Values are
plotted with seven contour levels, which are represented by contour lines with default
colors and line types. The default contour levels occur at every 15th percent of the range
between the contour variable’s 5th and 95th percentile. The legend is labeled with the
contour variable’s name and identifies the contour levels that are included in the plot.
This example uses the G3GRID procedure to interpolate clay percentages for grid
cells that do not have percentages in the data. Without the G3GRID procedure, there
are too many missing values for the percentages, and the GCONTOUR procedure
cannot produce a satisfactory contour plot.
Create the data set. REFLIB.CLAY contains the percent of clay at various locations of a test
site.
data reflib.clay;
input x y pct_clay;
datalines;
-10 -10 2.316
-10 -9 1.816
-10 -8 2.427
...more data lines...
10 8 .
10 9 .
10 10 .
;
Interpolate values for the contour plot. The interpolated data set is stored in
REFLIB.CLAY2.
Generate a simple contour plot. The procedure uses REFLIB.CLAY2, the output data set
from PROC G3GRID. To simplify the legend labels, clay percentages are formatted with no
decimal positions.
906 Example 2: Labeling Contour Lines Chapter 30
This example modifies Example 1 on page 904 to label contour levels with the
AUTOLABEL option. When AUTOLABEL is used, the SYMBOL statement controls the
labels and attributes of contour lines. In this example, SYMBOL1 defines a text label
for the lowest contour level. Each remaining contour line gets the default label, which
is the contour variable’s value at that contour level. All the contour lines are solid,
which is the default line type for the SYMBOL statement.
The GCONTOUR Procedure Example 2: Labeling Contour Lines 907
This example also uses AXIS statements to limit the plot to one of the contour areas
from the output of Example 1 on page 904, and it uses a LEGEND statement to move
the legend so the procedure has more room for displaying the y axis.
Define axes characteristics. AXIS1 uses ORDER= to set major tick marks at 2-unit intervals
from -10 to -4. AXIS2 uses ORDER= to specify 2-unit intervals from -10 to 2. These axes ranges
effectively zoom in on one of the contour areas from Example 1 on page 904.
Define legend characteristics. POSITION= centers the legend to the right of the graphics
area, and LABEL= positions the legend label above the legend entries. ACROSS= places legend
entries in rows 1 entry wide.
Define symbol characteristics. SYMBOL1 specifies a font and text string to label the
lowest-level contour lines. COLOR= ensures that each SYMBOL definition is used only once. In
SYMBOL2, STEP= increases the number of contour labels by placing the labels closer together
than the default distance of 65 percent.
symbol1 height=2.5
font=swissb
value=’lowest’
color=red;
symbol2 height=2.5
step=25pct
color=black;
symbol3 height=2.5
color=blue;
symbol4 height=2.5
color=green;
908 Example 3: Specifying Contour Levels Chapter 30
Generate the contour plot. LEVELS= specifies contour levels from 10 to 90 at 20-unit
intervals. AUTOLABEL= turns on labeling, and CHECK=NONE turns off collision checking so
the maximum number of contour labels can be displayed. HAXIS= and VAXIS= assign AXIS
definitions to the plot. LEGEND= assigns the LEGEND1 definition to the plot.
proc gcontour data=reflib.clay2;
plot y*x=pct_clay / levels=10 to 90 by 20
autolabel=(check=none)
haxis=axis1
vaxis=axis2
legend=legend1;
run;
quit;
This example generates a contour plot that shows the height or depth of a pond and
its surrounding land. In the example, the PLOT statement uses the LEVELS= and
LLEVELS= options to specify explicit contour levels and line types for the contour plot.
It also uses a LEGEND statement to modify the plot’s default legend.
This example uses the G3GRID procedure to interpolate points for grid cells that do
not have a needed dimension in the data. Without the G3GRID procedure, there are too
many missing values for the point locations, and the GCONTOUR procedure cannot
produce a satisfactory contour plot.
The GCONTOUR Procedure Example 3: Specifying Contour Levels 909
Create the data set. REFLIB.POND contains the raw data for a pond floor and surrounding
land.
data reflib.pond;
input vdist hdist height;
datalines;
10 88 0
18 55 -1
24 22.5 -1.67
...more data lines...
64 272.5 -6.25
60 277.5 -6.5
62 277.5 -6.5
;
Generate the contour plot. LEVELS= specifies the values of the contour levels. LLEVELS=
sets the line types for the contour lines. Solid lines identify negative contour levels, and dashed
lines identify positive contour levels.
910 Example 4: Using Patterns and Joins Chapter 30
This example demonstrates the differences between using lines and patterns to
represent contour levels. It first uses a simple PLOT statement to generate the default
output, which uses lines to represent contour levels.
As shown in the following output, the example then modifies the PLOT statement by
specifying the PATTERN option, which uses patterns to distinguish between contour
levels. Additional PLOT statement options outline filled areas in gray and specify green
text for all text on the axes and in the legend.
The GCONTOUR Procedure Example 4: Using Patterns and Joins 911
Finally, as shown by the following output, the example uses the JOIN option to
combine the patterns in grid cells for the same contour level. Additional options
enhance the plot by modifying the axes and framing the legend.
Create the data set. REFLIB.SWIRL is generated data that produces a symmetric contour
pattern, which is useful for illustrating the PATTERN option.
912 Example 4: Using Patterns and Joins Chapter 30
data reflib.swirl;
do x= -5 to 5 by 0.25;
do y= -5 to 5 by 0.25;
if x+y=0 then z=0;
else z=(x*y)*((x*x-y*y)/(x*x+y*y));
output;
end;
end;
run;
Generate the contour plot. PATTERN fills the contour levels with solid patterns.
COUTLINE= names the color that outlines the grid cells. CTEXT= names a color for axes and
legend text.
proc gcontour data=reflib.swirl;
plot y*x=z / pattern
coutline=gray
ctext=green;
run;
Define axis and legend characteristics for last plot. Blanks are used to suppress tick
labels at positions -2.5 and 2.5.
axis1 label=none value=(’’ ’ ’ ’0’ ’ ’ ’5’)
color=red width=3;
axis2 label=none value=(’’ ’ ’ ’0’ ’ ’ ’5’)
The GCONTOUR Procedure References 913
color=red width=3;
legend frame;
Generate the last contour plot. JOIN combines grid cells for the same contour levels.
References
Snyder, W.V. (1978), "Contour Plotting [J6] ," ACM Transactions on Mathematical
Software, 4, 290–294.
914
915
CHAPTER
31
The GDEVICE Procedure
Overview 916
Concepts 916
About Device Catalogs 916
About the Current Catalog 916
Search Order of Device Catalogs 917
Ways to Use the GDEVICE Procedure 917
Windowing Mode 918
Program Mode 918
Procedure Syntax 920
PROC GDEVICE Statement 920
ADD Statement 921
COPY Statement 924
DELETE Statement 925
FS Statement 925
LIST Statement 925
MODIFY Statement 926
QUIT Statement 927
RENAME Statement 927
Using the GDEVICE Procedure 928
Using the GDEVICE Windows 928
GDEVICE Window Commands 929
GDEVICE Window Descriptions 929
DIRECTORY Window 929
Detail window 930
Parameters window 930
Gcolors window 931
Chartype window 931
Colormap window 931
Metagraphics window 932
Gprolog window 932
Gepilog window 933
Gstart window 933
Gend window 933
Host File Options window 933
Host Commands window 934
Creating or Modifying Device Entries 934
Creating a New Device Entry 935
Modifying an Existing Device Entry 935
Changing Device Parameters Temporarily 935
Examples 936
Example 1: Creating a Custom Device Entry with Program Statements 936
916 Overview Chapter 31
Overview
The GDEVICE procedure is a tool for examining and changing the parameters of the
graphics device driver catalog entries used with SAS/GRAPH software. With the
GDEVICE procedure, you can use either the GDEVICE windows or GDEVICE
procedure statements to
3 list the device entries stored in any DEVICES catalog
3 view the parameters for any device entry
3 create and modify new device entries
3 copy, modify, rename, or delete existing device entries.
See Chapter 3, “Device Drivers,” on page 41 for a discussion of device drivers and
device entries, as well directions for selecting device drivers and changing the settings
of device parameters.
For a complete list of Institute-supplied device entries supported by your operating
environment, see the SASHELP.DEVICES catalog that is supplied with SAS/GRAPH
software.
Concepts
You can then redefine the libref with another LIBNAME statement. To cancel a
libref, use a null LIBNAME statement.
Windowing Mode
In a windowing environment, open the GDEVICE windows by submitting the PROC
GDEVICE statement without the NOFS option:
proc gdevice;
This opens the DIRECTORY window in browse mode. This window lists all of the
device entries in the current catalog. (See “About the Current Catalog” on page 916.)
To open the DIRECTORY window in edit mode, or to specify a different catalog,
include the CATALOG= option in the PROC GDEVICE statement.
From the DIRECTORY window you can select the device entry you want to work
with and open other GDEVICE windows in which you can view or modify device
parameters. For more information, see “Using the GDEVICE Windows” on page 928.
In a windowing environment, you can switch between the GDEVICE windows and
program statements while you are running the procedure. See the “FS Statement” on
page 925 and the NOFS window command in the SAS Help facility for SAS/GRAPH.
To exit the GDEVICE windows, submit the End command or close the window.
Program Mode
If you are in a non-windowing or batch environment, the GDEVICE procedure
automatically starts in program mode. If you are in a windowing environment, specify
the NOFS option to start the GDEVICE procedure in program mode:
proc gdevice nofs;
By default, the GDEVICE procedure accesses the current catalog in browse mode and
prompts you in the LOG to enter additional program statements. (See “About the
Current Catalog” on page 916.) To specify the current catalog, include the CATALOG=
option in the PROC GDEVICE statement.
Once you start the GDEVICE procedure, you can enter and run additional
statements without re-entering the PROC GDEVICE statement. For example, the
following statement generates a listing of the device parameters for the PSCOLOR
device entry that is stored in the Institute-supplied catalog, SASHELP.DEVICES:
list pscolor;
PROC GDEVICE procedure output is displayed in the Output window. Output 31.1
shows the listing generated by the LIST statement.
The GDEVICE Procedure Ways to Use the GDEVICE Procedure 919
GDEVICE procedure
Listing from SASHELP.DEVICES - Entry PSCOLOR
OPTIONS
Cback: WHITE
Color list:
CHARTYPE RECORDS
FILE INFORMATION
Gaccess: sasgastd>sasgraph.ps
Gsfname: Gsfmode: PORT Gsflen: 0
Trantab: Devmap:
Devtype: DISK
Gprotocol:
Fileclose: DRIVERTERM
Hostspec:
HOST INFORMATION
Procedure Syntax
Requirements: Statements other than the PROC GDEVICE statement can be used only
in a non-windowing or batch environment. In these environments, at least one
statement is required to give GDEVICE an action to perform. In a windowing
environment, only the PROC GDEVICE statement is required. In program mode, at
least one additional statement is required, and you can submit as many of each
statement as you want.
Note: You must have write access to the device catalog in order to modify, add, or
delete entries.
Supports: Output Delivery System (ODS LISTING).
ADDnew-device-entry
required-parameters
<optional-parameters>;
COPYdevice-entry
<FROM=<libref.>SAS-catalog>
<NEWNAME=new-device-entry>;
DELETE device-entry;
FS;
LIST device-entry | _ALL_ | _NEXT_ | _PREV_ | DUMP>;
MODIFY device-entry
parameter(s)
QUIT | END | STOP;
RENAME device-entry NEWNAME=new-entry-name;
Options
Options used in the PROC GDEVICE statement affect the way you use the procedure.
BROWSE
opens a catalog in browse mode. You cannot modify a catalog when you open it with
the BROWSE option. If you are running in program mode when you use BROWSE,
you can use only the FS, LIST, QUIT, END, or STOP statements.
The GDEVICE Procedure ADD Statement 921
CATALOG=<libref.>SAS-catalog
CAT=<libref.>SAS-catalog
C=<libref.>SAS-catalog
specifies the catalog containing device information. If you do not specify a catalog,
the procedure opens the first catalog found in the search order of catalogs in browse
mode. (See “About the Current Catalog” on page 916. for information on how the
GDEVICE procedure determines which catalog to use.)
To edit the device entries in a catalog, you must use the CATALOG= option.
NOFS
specifies that you are using program mode. In windowing environments, the
GDEVICE windows are the default and you must specify NOFS to start GDEVICE in
program mode.
ADD Statement
Adds a new device entry to the catalog selected by the CATALOG= option in the PROC GDEVICE
statement. The device entry is initialized with NULL values for most parameters.
You must have write access to the device catalog in order to add entries,
Requirements:
and use CATALOG= in the PROC GDEVICE statement.
Restriction: Not valid in browse mode.
ADD new-device-entry
required-parameters
<optional-parameters>;
CHARACTERS=Y | N
CHARREC=(charrec-list(s))
CHARTYPE=hardware-font-chartype
CIRCLEARC=Y | N
CMAP=(’from-color : to-color’ <...,’from-color-n : to-color-n’>)
COLORS=(<colors-list>)
COLORTYPE=NAME | RGB | HLS | GRAY | CMY | CMYK | HSV | HSB
DASH=Y | N
DASHLINE=’dashed-line-hex-string’X
DESCRIPTION=’text-string’
DEVMAP=device-map-name | NONE
DEVOPTS=’hardware-capabilities-hex-string’X
DEVTYPE=device-type
DRVINIT1=’system-command(s)’
DRVINIT2=’system-command(s)’
DRVQRY | NODRVQRY
DRVTERM1=’system-command(s)’
DRVTERM2=’system-command(s)’
ERASE=Y | N
FILECLOSE=DRIVERTERM | GRAPHEND
FILL=Y | N
FILLINC=0...9999
FORMAT=CHARACTER | BINARY
GACCESS=output-format | ’output-format > destination’
GCOPIES=current-copies
GEND=’string’ <...’string-n’>
GEPILOG=’string’ <...’string-n’>
GPROLOG=’string’ <...’string-n’>
GPROTOCOL=module-name
GSFLEN=record-length
GSFMODE=APPEND | REPLACE | PORT
SFNAME=fileref
GSIZE=lines
GSTART=’string’ <...’string-n’>
HANDSHAKE=HARDWARE | NONE | SOFTWARE | XONXOFF
HEADER=’command’
HEADERFILE=fileref
ORIGIN=horizontal-offset <IN | CM>
HOSTSPEC=’text string’
HSIZE=horizontal-size <IN | CM>
ID=’description’
INTERACTIVE=USER | GRAPH | PROC
LFACTOR=line-thickness-factor
MAXCOLORS=number-of-colors
MAXPOLY=number-of-vertices
The GDEVICE Procedure ADD Statement 923
MODEL=model-number
NAK=’negative-handshake-response’X
PAPERFEED=feed-increment <IN | CM>
PATH=angle-increment
PENSORT=Y | N
PIEFILL=Y | N
POLYGONFILL=Y | N
POSTGRAPH1=’system-command(s)’
POSTGRAPH2=’system-command(s)’
PREGRAPH1=’system-command(s)’
PREGRAPH2=’system-command(s)’
PROCESS=’command’
PROCESSINPUT=fileref
PROCESSOUTPUT=fileref
PROMPT=0...7
PROMPTCHARS=’prompt-chars-hex-string’X
QMSG | NOQMSG
RECTFILL=’rectangle-fill-hex-string’X
REPAINT=redraw-factor
ROTATE=LANDSCAPE | PORTRAIT
ROTATION=angle-increment
SPEED=pen-speed
SWAP=Y | N
SYMBOL=Y | N
SYMBOLS=’hardware-symbols-hex-string’X
TRAILER=’command’
TRAILERFILE=fileref
TRANTAB=table | user-defined-table
TYPE= CAMERA | CRT | EXPORT | PLOTTER | PRINTER
UCC=’control-characters-hex-string’X
VORIGIN=vertical-offset <IN | CM>
VSIZE=vertical-size <IN | CM>
Required Arguments
new-device-entry
specifies the one-level name of the new device entry. New-device-entry must be a
valid name for a SAS catalog entry for your operating environment and cannot
already exist in the current catalog.
required-parameters
all required parameters for the ADD statement correspond to device parameters of
the same name. Refer to Chapter 8, “Graphics Options and Device Parameters
Dictionary,” on page 261 for a description of each parameter.
924 COPY Statement Chapter 31
Options
All optional parameters for the ADD statement correspond to device parameters of
the same name. Refer to Chapter 8, “Graphics Options and Device Parameters
Dictionary,” on page 261 for a description of each parameter.
Note: The COLORS= device parameter is not required; the device entry will be
created if you do not use it. However, the GDEVICE procedure issues an error message
if you do not specify at least one color for COLORS=. 4
Details
The ADD statement is rarely used because it initializes parameter values to NULL
and you have to set values for all the parameters. The best way to add a new driver is
to copy an existing driver and modify it.
COPY Statement
Copies a device entry and places the copy in the current catalog. The original device entry can be
either in the current catalog or in a different catalog.
Requirements: You must have write access to the catalog to which the device entry is
being copied.
Restriction: Not valid in browse mode.
See also: “Creating or Modifying Device Entries” on page 934
Featured in: Example 1 on page 936
Required Arguments
device-entry
specifies the one-level name of the device entry to copy. The entry must exist in
either the current catalog (the default) or the catalog specified by FROM=.
FROM=<libref.>SAS-catalog
names the catalog from which to copy device-entry.
NEWNAME=new-device-entry
specifies a name for the copy of the device entry that is placed in the current catalog.
New-device-entry must be a valid name for a SAS catalog entry and cannot already
exist in the current catalog.
If you copy device entries across catalogs and you do not specify a new name, the
GDEVICE procedure uses the original name for the new device entry.
The GDEVICE Procedure LIST Statement 925
DELETE Statement
Deletes the device entry from the current catalog.
Requirements: You must have write access to the current catalog to delete a device entry
from it, and use CATALOG= in the PROC GDEVICE statement.
Restriction: Not valid in browse mode.
Caution: A device entry cannot be restored once it has been deleted. Depending on the
environment in which you are using the GDEVICE procedure, you may be asked to
verify that you really want to delete the entry.
DELETE device-entry;
Required Arguments
device-entry
specifies the one-level name of device entry to delete. The entry must exist in the
current catalog.
FS Statement
Switches from program mode to the GDEVICE windows.
Requirements: You must be running SAS software in a windowing environment.
FS;
Options
No options.
LIST Statement
Lists all of the parameters of the specified device entry in the Output window.
Default: _ALL_
See also: “Program Mode” on page 918
LIST <device-entry>
<_ALL_>
<_NEXT_>
926 MODIFY Statement Chapter 31
<_PREV_>
<DUMP>;
Options
device-entry
specifies the one-level name of the device entry whose contents you want to list. The
entry must exist in the current catalog.
_ALL_
lists only the name, description, and creation date of all device entries in the current
catalog. This is the default. If no entries exist in the catalog, the GDEVICE
procedure issues a message.
_NEXT_
lists the contents of the next device entry. The GDEVICE procedure lists the first
entry in the catalog if no entries have been previously listed.
_PREV_
lists the contents of the previous device entry. If you have not previously listed the
contents of a device entry, the GDEVICE procedure issues the following message:
No objects preceding current object.
DUMP
lists detailed information on all device entries in the current catalog. Depending on
the number of device entries in the catalog, the DUMP option can create a large
amount of output.
MODIFY Statement
Changes the values in a device entry.
Requirements: You must have write access to the current catalog to modify a device
entry, and use CATALOG= in the PROC GDEVICE statement.
Restriction: Not valid in browse mode.
See also: “Creating or Modifying Device Entries” on page 934
Featured in: Example 1 on page 936
MODIFY device-entry
parameter(s);
Required Arguments
device-entry
specifies the one-level name of the device entry that you want to modify. The entry
must exist in the current catalog.
The GDEVICE Procedure RENAME Statement 927
parameter(s)
are the parameters you want to modify. These can be any of the parameters listed in
the ADD statement, whether listed as required or optional for ADD. See “ADD
Statement” on page 921 for a complete list. Refer to Chapter 8, “Graphics Options
and Device Parameters Dictionary,” on page 261 for a description of each parameter.
Details
To modify a device entry, create your own catalog and then copy the device entries
you need into it. You can then change your personal copies of the device entries without
affecting the original drivers in SASHELP.DEVICES. (To copy device entries, use the
COPY statement, the COPY command available after you choose Import Device Entry
from the DIRECTORY window’s File menu, or the CATALOG procedure, which is part
of base SAS.
CAUTION:
Be careful when modifying device entries in program mode. In program mode, you
cannot cancel any modifications you have just made. To change a value you have
modified, you must use another MODIFY statement to replace the original value or
reset it to its default. (In the GDEVICE windows, you can type the CANCEL
command in the command line to cancel changes you have made to the fields.) 4
QUIT Statement
Saves all modifications made to device entries during the procedure and exits the GDEVICE
procedure.
Options
No options.
RENAME Statement
Changes the name of the device entry to the name specified in the statement.
Requirements: You must have write access to the current catalog to rename a device
entry, and use CATALOG= in the PROC GDEVICE statement.
Restriction: Not valid in browse mode.
RENAME device-entry
NEWNAME=new-entry-name;
928 Using the GDEVICE Procedure Chapter 31
Required Arguments
device-entry
specifies the one-level name of the device entry that you want to rename. The entry
must exist in the current catalog.
NEWNAME=new-entry-name
specifies the new entry name. New-entry-name must be a valid name for a SAS
catalog entry and cannot already exist in the current catalog. If the name already
exists, the GDEVICE procedure issues an error message.
DIRECTORY Window
This window appears when you start the GDEVICE procedure in window mode. It
lists all the device entries in the default catalog or the catalog you specified in the
PROC GDEVICE statement. You can use it to
3 copy, rename, or delete device entries in the catalog
3 select a device entry whose parameters you want to browse or edit.
You can enter these commands in the Directory window selection field:
B|S
open the Detail window and browse (B) or, if you are in edit mode, edit (S) the
selected device entry.
D
delete the selected device entry. You cannot restore a device entry once it has been
deleted.
E
open the Detail window and edit the selected device entry.
R
rename the device entry and/or description.
You cannot edit the TYPE and UPDATED fields in the Directory Window.
Detail window
This window contains device parameters that control basic characteristics of the
device, for example, the size of the graphics output area.
From this window you can access any of the subsidiary GDEVICE windows by
3 entering the name of the window on the command line
3 selecting the window from the Tools pulldown
3 opening the subsidiary windows in order of appearance by using the View pulldown
and choosing Next Screen, or using the NEXTSCR command on the command line.
Parameters window
This window includes additional device parameters that affect the way graphs are
drawn. For example, you choose whether certain graphics primitives are drawn by your
hardware or by SAS/GRAPH software, whether to feed paper to printers or plotters
automatically, and whether to have SAS/GRAPH software prompt you with messages
under certain conditions.
Note: If the device does not support a hardware characteristic, the catalog entry
cannot enable the support. 4
Gcolors window
This window lists the colors that the device driver uses by default. When you do not
explicitly specify the color of a graphics feature in your program or in a GOPTIONS
statement, SAS/GRAPH software uses this list to determine what color to use.
Chartype window
This window lists the hardware fonts that the device can use, along with information
about the size of the characters. The Chartype value is the value you can use to
reference a font in another window. For example, you would enter a Chartype number
in the Parameters window’s Chartype field.
Colormap window
This window allows you to specify a color map for the device. The FROM field
specifies the name to assign to the color designated by the color value, and the TO field
specifies a SAS/GRAPH color name up to eight characters long. Once you have defined
the color mapping, you can use the new color name in any color option. For example, if
your device entry maps the color name DAFFODIL to the SAS color value PAOY, you
can specify COLOR=DAFFODIL on any statement that supports a COLOR= option, and
the driver will map this to the color value PAOY.
932 Using the GDEVICE Windows Chapter 31
Metagraphics window
This window is used by all drivers that support multiple color spaces, for example,
RGB or CMYK. It is also used if the device entry is a Metagraphics (user-written)
driver. Metagraphics drivers are created when an Institute-supplied device entry
cannot be adapted to support your graphics device. For information about Metagraphics
drivers, contact Technical Support.
Do not alter the fields in the Metagraphics window unless you are changing the color
scheme (colortype), or building a Metagraphics driver.
Gprolog window
This window enables you to specify one or more hexadecimal strings that are sent to
the device just before graphics commands are sent. Additional commands can be sent
with the PREGPROLOG= and POSTGPROLOG= graphics options. See Chapter 8,
“Graphics Options and Device Parameters Dictionary,” on page 261 for details.
Gepilog window
This window enables you to specify one or more hexadecimal strings that are sent to
the device just after graphics commands are sent. Additional commands can be sent
with the PREGEPILOG= and POSTGEPILOG= graphics options. See Chapter 8,
“Graphics Options and Device Parameters Dictionary,” on page 261 for details.
Gstart window
This window enables you to specify one or more hexadecimal strings that are placed
at the beginning of each record of graphics data.
Gend window
This window enables you to specify one or more hexadecimal strings that are placed
at the end of each record of graphics data.
statement and with the FILENAME statement. See also “Exporting SAS/GRAPH
Output with Program Statements” on page 62.)
It is a good idea to give a new or modified device entry a name that is different from
the original. Then, if you want to use the original device, SAS/GRAPH can find that
device when it searches the device catalogs. Remember that SAS/GRAPH searches the
GDEVICEn libraries before it searches SASHELP.DEVICES and uses the first device it
finds whose name matches the one you have specified. (See “Search Order of Device
Catalogs” on page 917.)
For example, suppose there is a customized copy of PSCOLOR in your
GDEVICE0.DEVICES catalog as well as the original in SASHELP.DEVICES. If you
specify DEV=PSCOLOR and if the libref GDEVICE0 is assigned, SAS/GRAPH will
search GDEVICE0.DEVICES first and use the copy of PSCOLOR stored there. Unless
you cancel the GDEVICE0 libref, SAS/GRAPH will never find the original in
SASHELP.DEVICES.
Examples
The following examples illustrate major features of the GDEVICE procedure.
This example shows how to use GDEVICE procedure statements to modify a device
entry by copying the original entry into a personal catalog and changing the device
parameters. You can submit these statements one at a time or together.
This example permanently changes the default colors list for the PSCOLOR device
entry. The contents of the original PSCOLOR entry are shown in Output 31.1. The new
device entry is illustrated in the PROC GTESTIT output above.
Assign the libref GDEVICE0. The LIBNAME statement assigns the libref to the aggregate
file storage location that contains (or will contain) the DEVICES catalog.
libname gdevice0 ’SAS-data-library’;
Start the GDEVICE procedure. NOFS causes GDEVICE to use program mode. CATALOG=
assigns GDEVICE0.DEVICES as the current catalog. If the DEVICES catalog does not already
exist in the library, it is automatically created.
The GDEVICE Procedure Example 1: Creating a Custom Device Entry with Program Statements 937
Copy the original device entry from SASHELP.DEVICES to the current catalog.
NEWNAME= specifies a name for the copy of PSCOLOR that is placed in
GDEVICE0.DEVICES. The name of a catalog entry cannot exceed eight characters.
Modify the new entry. DESCRIPTION= specifies a new device description that appears in the
catalog listing. COLORS= defines a new colors list.
modify mypscol
description=’PSCOLOR with new colors list’
colors=(black blue green red gray cyan
lime lipk);
quit;
Test the new device entry. The TARGET= graphics option specifies the new device. Since
GDEVICE0 is already defined, SAS/GRAPH looks first in that catalog for the specified device
entry. The GTESTIT procedure produces a test picture that show the new colors list and a
listing in the LOG.
goptions target=mypscol;
proc gtestit pic=1;
run;
938
939
CHAPTER
32
The GFONT Procedure
Overview 939
About Displaying Fonts 940
About Creating Fonts 940
Concepts 940
About Fonts 940
About the Libref GFONT0 941
Procedure Syntax 942
PROC GFONT Statement 942
Creating a Font 951
The Font Data Set 951
Font Data Set Variables 952
Creating a Font Data Set 958
The Kern Data Set 958
Kern Data Set Variables 959
Creating a Kern Data Set 959
The Space Data Set 960
Space Data Set Variables 960
Creating a Space Data Set 961
Examples 962
Example 1: Displaying Fonts and Character Codes 962
Example 2: Creating Figures for a Symbol Font 964
Overview
The GFONT procedure displays new or existing fonts and creates user-generated
fonts for use in SAS/GRAPH programs. These fonts can contain standard Roman
alphabet characters, foreign language characters, symbols, logos, or figures.
The GFONT procedure
3 displays SAS/GRAPH software fonts
3 displays fonts that were previously generated with the GFONT procedure
(user-generated fonts)
3 displays hardware font that are available on your device and have a corresponding
Chartype value
3 displays the character codes or hexadecimal values that are associated with the
characters in a font
3 creates stroked fonts or polygon fonts.
Each of these activities has its own requirements, its own process, and its own
options (although some options are valid for either process). In this chapter, each topic
940 About Displaying Fonts Chapter 32
to which this distinction applies is divided into two sections: "Displaying Fonts" and
"Creating Fonts."
Concepts
About Fonts
Some specialized terms are associated with font characteristics. The capline of a font
is the highest point of a normal uppercase letter. The baseline is the line upon which
the characters rest. The font maximum is the highest vertical coordinate in a font. The
font minimum is the lowest vertical coordinate in a font. Figure 32.1 on page 940
illustrates these GFONT procedure terms:
Specialized terms also exist for types of fonts. The term uniform font refers to a font
in which all of the characters occupy exactly the same amount of space, even though the
The GFONT Procedure About the Libref GFONT0 941
characters themselves are different sizes. Each character in a uniform font is placed in
the center of its space, and a fixed amount of space is added between characters. A
proportional font is a font in which each character occupies a space that is proportional
to its actual width (for example, m occupies more space than i). The characters in a
stroked font are drawn with discrete line segments or circular arcs. Figure 32.2 on page
941 illustrates a stroked font with several characters from the Simplex font.
Figure 32.3 on page 941 illustrates two types of polygon fonts: filled (CENTBI) and
outline (CENTBIE). A filled font is a polygon font in which the areas between the lines
are solid. An outline font is a polygon font in which the areas are empty.
All font characters, regardless of whether they are stroked or polygon, are drawn
with line segments. In the GFONT procedure, the term line segment means a
continuous line that can change direction. For example, the letter C in Figure 32.2 on
page 941 is drawn with one line segment, while the letter A can be drawn with two.
Polygon characters can also be drawn with one or more line segments. In a polygon
font, one character can be made up of a single polygon, multiple polygons, or polygons
with holes. For example, the letter C in Figure 32.3 on page 941 is a single polygon
with one line segment. The question mark (?) is made up of two polygons, each drawn
with a separate line segment. The letter A is one polygon with a hole in it. It is drawn
with one line segment that is broken to form the outer boundary of the figure and the
boundary of the hole.
Since the GFONT0 library is the first place that SAS/GRAPH software looks for fonts,
you should always assign that libref to the library that contains your personal fonts. If
for some reason you have personal fonts in more than one SAS data library, assign
them librefs in the sequence GFONT0, GFONT1, GFONT2, and so forth. The search for
entries terminates if there is a break in the sequence; the catalog GFONT1.FONTS is
not checked if the libref GFONT0 is undefined. If the libref GFONT0 is not defined, by
default SAS/GRAPH software begins searching for fonts in SASHELP.FONTS.
To cancel or redefine the libref GFONTn, submit the following statement:
goptions reset=all fcache=0;
Note that when you specify RESET=ALL, all graphics options are reset to their
default values. Once you have cleared the font cache, you can redefine the libref with
another LIBNAME statement.
Procedure Syntax
Requirements: A font name is required. To display a font, include NOBUILD. To create a
font, include DATA=.
Global statements: FOOTNOTE, TITLE
Reminder: The procedure can include the SAS/GRAPH NOTE statement.
Supports: Output Delivery System (ODS)
Syntax
PROC GFONT NAME=font-namehardware-font-name
mode
<display-option(s)>
<creation-option(s)>;
NAME=font-name | hardware-font-name
N=font-name | hardware-font-name
specifies the font to be displayed. Font-name can be the name of a SAS software font
or a font you previously created. Any hardware font that is available on your device
and has a corresponding Chartype value may be used. The hardware-font-name must
be enclosed in quotes.
944 Displaying Fonts: Required Arguments, Options Chapter 32
Options that can be used for either font display or font creation are described here
and in “Options for Creating Fonts” on page 947.
Options that display a font can be used when you create a font if you also display it
(that is, the NODISPLAY option is not used in the PROC GFONT statement). However,
none of the display options affect the design and appearance of the stored font except
the NOKEYMAP, SHOWROMAN, and ROMHEX options.
When the syntax of an option includes units, use one of these:
CELLS character cells
CM centimeters
IN inches
PCT percentage of the graphics output area
PT points
If you omit units, a unit specification is searched for in this order:
1 the value of GUNIT= in a GOPTIONS statement
2 the default unit, CELLS.
CTEXT=text-color
CT=text-color
specifies a color for the body of the characters. If you do not use the CTEXT= option,
a color specification is searched for in the following order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
The CTEXT= value is not stored as part of the font.
H=character-height<units>
specifies the height of the font characters in number of units, n. Height is measured
from the minimum font measurement to the capline. By default, HEIGHT=2.
Featured in: Example 1 on page 962.
NOKEYMAP
specifies that the current key map is ignored when displaying the font and its
character codes or hexadecimal values. If you do not use the NOKEYMAP option
when you display a font, the current key map remains in effect. If any characters in
the font are not available through the current key map, they are not displayed and a
warning is issued in the SAS log. This happens when the key map is asymmetrical,
that is, not all characters in the font are mapped into the current key map.
Displaying a font using the NOKEYMAP option enables you to see all of the
characters in the font, including those that are not mapped into your current key
map. Note that only those characters that are mapped into your current key map are
available (that is, those that are displayed when you display the font without the
NOKEYMAP option).
See also: Chapter 5, “SAS/GRAPH Fonts,” on page 75, Chapter 34, “The GKEYMAP
Procedure,” on page 983, and theNOKEYMAP option on page 949 for Creating
Fonts.
NOROMAN
NR
turns off the automatic display of character codes that are produced when you use
the SHOWROMAN option during font creation.
NOROMHEX
NOHEX
turns off the automatic display of hexadecimal values that are produced when you
use the ROMHEX option during font creation.
REFCOL=reference-line-color
specifies a color for reference lines. By default, the first color in the colors list is used.
REFLINES
draws reference lines around each displayed character. Vertical reference lines show
the width of the character. Horizontal reference lines show the font maximum and
the font minimum, as well as the baseline and the capline. See Figure 32.1 on page
940 for an illustration of the placement of reference lines.
ROMCOL=code-color
RC=code-color
specifies the color of the character codes or hexadecimal values that are displayed
with the SHOWROMAN and ROMHEX options. If you do not use the ROMCOL=
option, a color specification is searched for in the following order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
The ROMCOL= value is not stored as part of the font.
Featured in: Example 1 on page 962.
ROMFONT=font
RF=font
specifies the font for character codes and hexadecimal values that are displayed by
the SHOWROMAN and ROMHEX options. If you do not use the ROMFONT= option,
a font specification is searched for in the following order:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font, NONE.
946 Creating Fonts: Required Arguments, Options Chapter 32
Details
To display a font, you must specify the name of the font with the NAME= argument
and include the NOBUILD argument. For example, to display the Weather font with
character codes that are displayed in the Swiss font, use the following statement:
proc gfont name=weather nobuild romfont=swiss;
NAME=font-name
N=font-name
The GFONT Procedure Creating Fonts: Required Arguments, Options 947
assigns a name to the font that you create. Font-name is the name of a catalog entry
and must be a valid SAS name of no more than eight characters. Do not use the
name of an Institute-supplied font or NONE for the name of a font.
Featured in: Example 2 on page 964.
DATA=font-data-set
specifies the SAS data set that the GFONT procedure uses to build the font. The
data set must be sorted by the variables CHAR and SEGMENT. By default, the
procedure uses the most recently created data set as the font data set.
See also: “SAS Data Sets” on page 29.
Featured in: Example 2 on page 964.
When you create a font, you must define the libref GFONT0. See “About the Libref
GFONT0” on page 941 for details.
Note: If a user-generated font has the same name as an Institute-supplied font and
if the libref GFONT0 has been defined, the user-generated font is used because
GFONT0 is searched first. 4
Options that can be used for either font display or font creation are described here
and in “Options for Displaying Fonts” on page 944.
Options that display a font can be used when you create a font if you also display it
(that is, the NODISPLAY option is not used in the PROC GFONT statement). However,
none of the display options affect the design and appearance of the stored font except
the NOKEYMAP, SHOWROMAN, and ROMHEX options.
When the syntax of an option includes units, use one of these:
CELLS character cells
CM centimeters
IN inches
PCT percentage of the graphics output area
PT points
If you omit units, a unit specification is searched for in this order:
1 the value of GUNIT= in a GOPTIONS statement
2 the default unit, CELLS.
BASELINE=y
B=y
specifies the vertical coordinate in the font data set that is the baseline of the
characters. The baseline is the line upon which the letters rest. If you do not use the
BASELINE= option, the GFONT procedure uses the lowest vertical coordinate of the
first character in the font data set.
CAPLINE=y
C=y
specifies the vertical coordinate in the font data set that is the capline of the
characters. The capline is the highest point of normal Roman capitals. If you do not
use the CAPLINE= option, the GFONT procedure uses the highest vertical coordinate
in the font data set, in which case the capline and the font maximum are the same.
See Figure 32.1 on page 940 for an illustration of capline and font maximum.
948 Creating Fonts: Required Arguments, Options Chapter 32
If you use the CAPLINE= option, then when the GFONT procedure calculates the
height of a character, any parts of the character that project above the capline are
ignored in the calculation.
You can use this option to prevent an accented capital like A from being shortened
to accommodate the accent. For example, if you do not use the CAPLINE= option,
the capline and the font maximum are the same and the A is shortened to make
room for the accent below the capline. However, if CAPLINE= is used, the top of the
letter A is at the capline, and the accent is drawn above the capline and below the
font maximum.
CHARSPACETYPE=DATA | FIXED | NONE | UNIFORM
CSP=DATA | FIXED | NONE | UNIFORM
specifies the type of intercharacter spacing. The following are valid values:
DATA
specifies that the first observation for each character sets the width of that
character. When CHARSPACETYPE=DATA, the PTYPE variable is required, and
the observation that specifies the width of the character must have a PTYPE value
of W. See “The Font Data Set” on page 951 for details on the PTYPE variable.
Intercharacter spacing is included in the character’s width. For example, if the
first observation for the letter A specifies a character width of 10 units and the A
itself occupies only 8 units, the remaining 2 units serve as intercharacter spacing.
Note: The character can extend beyond the width that you specified in the first
observation if desired. 4
FIXED
adds a fixed amount of space between characters based on the font size. The width
of the individual character is determined by the data that generate the character.
NONE
specifies that no space is added between characters. The width of the individual
character is determined by the data that generate the character. This type of
spacing is useful for script fonts in which the characters should appear connected.
UNIFORM
specifies that the amount of space that is used for each character is uniform rather
than proportional. This means that each character occupies the same amount of
space. For example, in uniform spacing the letters m and i occupy the same
amount of space, whereas in proportional spacing m occupies more space than i.
In uniform spacing, the character is always centered in the space and a fixed space
is added between characters.
When UNIFORM is specified, the amount of space that is used for each
character is one of the following:
3 by default, the width of the widest character in the font.
3 the width specified by the MWIDTH= option. See the MIDWIDTH= option on
page 949 for details.
Specifying CHARSPACETYPE=UNIFORM is the same as using the UNIFORM
option.
FILLED
F
specifies that the characters in a user-generated polygon font are filled.
Featured in: Example 2 on page 964.
KERNDATA=kern-data-set
KERN=kern-data-set
specifies the SAS data set that contains kerning information. When the
KERNDATA= option is used during font creation, the data that are contained in the
kern data set are applied to the font and stored with it. You cannot specify kerning
for a double-byte character set that is created by using the option CODELEN=2.
See also: “The Kern Data Set” on page 958.
MWIDTH=character-width
specifies the width of a character in a uniform font, where character-width is the
number of font units. The MWIDTH= option is only valid when you specify uniform
spacing by using the UNIFORM option or when you specify
CHARSPACETYPE=UNIFORM. If you do not use MWIDTH=, the default is the
width of the widest character in the font (usually the letter m).
Typically, you use the MWIDTH= option to tighten the spacing between
characters. To do this, specify a smaller value (narrower width) for character-width.
Figure 32.4 on page 949 shows the effect of decreasing the space that is allowed for
uniformly spaced characters.
See also: the CHARSPACETYPE= option on page 948 and the UNIFORM option on
page 951.
NODISPLAY
ND
specifies that the GFONT procedure is not to display the font that it is creating.
NOKEYMAP
specifies that the current key map is ignored when you generate and use the font
that is being created, and that the character codes you enter are not mapped in any
way before being displayed. As a result, the generated font is never affected by any
setting of the KEYMAP= graphics option.
CAUTION:
Fonts generated with the NOKEYMAP option are never affected by any setting of the
KEYMAP= graphics option. 4
950 Creating Fonts: Required Arguments, Options Chapter 32
By default, the NOKEYMAP option is not used; in which case, when you build a
font, the current key map is applied to the values in the CHAR variable.
However, your current key map may not be symmetrical; that is, two or more
input character codes may be mapped to the same output character. For example, if
A is mapped to B, then both A and B map to B, but nothing maps to A. In this case,
more than one code in your input data set can map to the same character in the
resulting font. For example, if A and B are values of CHAR, both map to B. If this
happens, a message that indicates the problem characters is displayed in the SAS
log. To solve this problem, you can do one of the following:
3 change the character code of one of the characters
3 eliminate one of the characters
3 use the NOKEYMAP option.
When you use the NOKEYMAP option, your font works correctly only if the end
user’s host or controller encoding is the same as the encoding used to create the
input data set.
See also: the NOKEYMAP option on page 945 for Displaying Fonts and Chapter 34,
“The GKEYMAP Procedure,” on page 983.
RESOL=1...4
R=1...4
controls the resolution of the fonts by specifying the number of bytes (1 through 4)
for storing coordinates in the font. The GFONT procedure provides three resolution
levels (RESOL=3 produces the same resolution level as RESOL=4). By default,
RESOL=1.
The higher the number, the closer together the points that define the character
can be spaced. A high value specifies a denser set of points for each character so that
the characters approximate smooth curved lines at very large sizes. RESOL=2 works
well for most applications; RESOL=3 or 4 may be too dense to be practical.
The table below shows the resolution number and the maximum number of
distinct points that can be defined horizontally or vertically.
3 2,147,483,646
4 2,147,483,646
font you create, you can later use the NOROMAN option to suppress display of the
character codes.
See also: the ROMHEX option on page 946, the SHOWROMAN option for
Displaying Fonts, and the NOROMAN option on page 945.
SPACEDATA=space-data-set
SPACE=space-data-set
specifies the SAS data set that contains font spacing information. When you use the
SPACEDATA= option during font creation, the data contained in the space data set
are applied to the font and stored with it. You cannot specify space adjustment for a
double-byte character set that is created by using the option CODELEN=2.
See also: “The Space Data Set” on page 960.
UNIFORM
U
specifies that characters are spaced uniformly rather than proportionately. Using the
UNIFORM option is the same as specifying CHARSPACETYPE=UNIFORM.
See also: the CHARSPACETYPE= option on page 948 and the MWIDTH= option on
page 949.
Creating a Font
To create a font, you must create a data set that contains font information. Typically,
you use a DATA step to create a SAS data set from which the GFONT procedure
generates the font. The data set is referred to as the font data set and you can specify it
with the DATA= argument.
To produce the font, invoke the GFONT procedure and specify the data set that
contains the font information. In addition you can include options to modify the design
and appearance of the font. For example, the following statement uses the data set
FONTDATA to generate the font MYLOGO:
proc gfont data=fontdata name=mylogo;
For a demonstration of the font creation process, see Example 2 on page 964.
The GFONT procedure uses three types of data sets: the font data set, the kern data
set, and the space data set. Each type of data set must contain certain variables and
meet certain requirements. The following sections explain what each data set contains,
how it is built, and what the requirements of the variables are.
CHAR
provides a code for the character or figure that you are creating. CHAR is a
character variable with a length of 1 or 2 and is required for all fonts.
CAUTION:
Using reserved or undefined hexadecimal codes as CHAR values may require the use
of the NOKEYMAP option. 4
The CHAR variable takes any character as its value, including characters that
you can enter from your keyboard and hexadecimal values from ’00’x to ’FF’x. (If
you use hexadecimal values as CHAR values, your font may not work correctly
under a key map that is different from the one under which the font was created
because positions that are not defined in one key map may be defined in another.)
When you specify the code character in a text string, the associated font
character is drawn. For example, if you create a Roman alphabet font, typically
the characters you specify for CHAR are keyboard characters that match the
character in the font. All of the observations that build the letter A have a CHAR
value of A. When you specify ’A’ in a text string this produces A in the output.
However, if you build a symbol font, the symbols may not have corresponding
keyboard characters. In that case, you select a character or hexadecimal value to
The GFONT Procedure Creating a Font 953
represent each symbol in the font and assign it to CHAR. For example, in the
Special font, the letter G is assigned as the code for the fleur-de-lis symbol. When
you specify the code in a text string, the associated symbol displays.
If the CODELEN= option is set to 2, the values for CHAR represent two
characters, such as AA, or a four-digit hexadecimal value, such as ’00A5’x.
LP
tells the GFONT procedure whether the coordinates of each segment form a line or
a polygon. LP is a character variable with a length of 1. It is required for polygon
fonts but optional for stroked fonts. You can assign the LP variable either of the
following values:
L lines
P polygons.
Every group of line segments with an LP value of P is designated as a polygon;
if the observations do not draw a completely closed figure, the program closes the
figure automatically. For example, the following observations do not contain an LP
variable. They produce a shape like the one in Figure 32.5 on page 953.
1 b 1 1 1
2 b 1 1 3
3 b 1 3 3
4 b 1 3 1
LP (continued)
An LP variable with a value of P for all observations added to the data set
produces a complete box like the one in Figure 32.6 on page 954.
2 b 1 1 3 P
3 b 1 3 3 P
4 b 1 3 1 P
954 Creating a Font Chapter 32
LP (continued)
The LP variable allows you to mix lines and polygons when you create characters
in a font. For example, the following observations produce the single figure that is
composed of a polygon and a line segment, as shown in Figure 32.7 on page 954:
2 b 1 1 3 P
3 b 1 3 3 P
4 b 1 3 1 P
5 b 2 0 0 L
6 b 2 2 4 L
7 b 2 4 0 L
PTYPE
The GFONT Procedure Creating a Font 955
tells the GFONT procedure what type of data are in the observation. PTYPE is a
character variable of length 1 that is optional for both stroked and polygon fonts.
For each observation, the PTYPE variable assigns a characteristic to the point
that is determined by the X and Y values. You can assign the PTYPE variable any
of the following values:
V normal point in the line segment
C center of a circular arc joining two V points
W width value for CHARSPACETYPE=DATA.
If the GFONT procedure encounters the sequence V-C-V in consecutive
observations, it draws an arc that connects the two V points and has its center at
the C point. If a circle cannot be centered at C and pass through both V points,
the results are unpredictable. Arcs are limited to 106 degrees or less.
If you specify an observation with a PTYPE value of W, it must always be the
first observation for a character. Instead of providing digitizing data to the
procedure, the observation gives the minimum and maximum X values for the
character. Note that in this case, the Y variable observation actually contains the
maximum X value. Usually, these values include a little extra space for
intercharacter spacing. Use a PTYPE of W only if you have specified
CHARSPACETYPE=DATA; otherwise, the points are ignored. For more
information on intercharacter spacing, see the description of the
CHARSPACETYPE= option.
If you do not specify a PTYPE variable in the font data set, all points are
assumed to be V-type points.
The following observations illustrate how the PTYPE variable is used to draw
an arc similar to Figure 32.8 on page 956. (After the figure was generated, a grid
was overlaid on it to show the location of the points.) A comment following each
observation explains its function.
2 a 1 45 40 P V start line
segment at
position 45,40
3 a 1 45 50 P V draw a line to
position 45,50,
which is start
point of arc
956 Creating a Font Chapter 32
4 a 1 45 40 P C draw an arc
whose center is
at 45,40
5 a 1 55 40 P V finish drawing
the arc at 55,40
PTYPE (continued)
Note the following:
3 Three observations are required to draw the arc: observation 3 and
observation 5 denote the start point and endpoint of the arc, respectively, and
observation 4 locates the center of the arc.
3 The figure is closed because the line segments have an LP value of P
(polygon).
3 The font that contains the figure of the arc was generated with a PROC
GFONT statement like the following:
proc gfont data=arc name=arcfig charspacetype=data filled ;
Note that the GFONT procedure uses the CHARSPACETYPE= option with
a value of DATA to specify that the first observation sets the width of the
character. The FILLED option fills the area of the arc.
SEGMENT
numbers the line segments that compose a character or symbol. SEGMENT is a
numeric variable that is required for both polygon and stroked fonts. All the
observations for a given line segment have the same segment number. The
segment number changes when a new line segment starts.
When the GFONT procedure draws a stroked character with more than one line
segment (for example, the letter E), or a polygon character with a hole (for
example, the letter A), it needs to know when one line stops and where the next
line begins. There are two ways to do this, as follows:
1 Change the segment number when a new line segment starts. If the value of
LP is L (line), a change in segment numbers tells the GFONT procedure not
to connect the last point in line segment 1 and the first point in line segment
2. If the value of LP is P (polygon), a change in segment numbers causes both
of the following:
The GFONT Procedure Creating a Font 957
3 The last point in line segment 1 is joined to the first point in line
segment 1, thus closing the polygon.
3 The program starts a new polygon. If the value of CHAR has not
changed, the new polygon is part of the same character.
Use this method for characters that are composed of two polygons, such as
a question mark (?). If you draw a polygon with a hole in it, such as the letter
A, use the second method.
2 Keep the same segment number for all lines, but insert an observation with
missing values for X and Y between the observation that marks the end of
the first line and the observation that begins the next line. For example, if
you are drawing the letter O, insert an observation with a missing value
between the line that draws the outer circle and the beginning of the line
that draws the inner circle.
The first method is preferred, unless you are creating a polygon character with
a hole in it. In this case, you should separate the lines with a missing value and
keep the same segment numbers. (Note that if you use separate line segments
when you create a polygon with a hole, the results may be unpredictable.) For
example, observations such as the following from a data set called BOXES were
used to draw the hollow square in Figure 32.9 on page 958. The data points that
form the figure are laid out on a grid shown next to the square.
2 b 1 1 3 P
3 b 1 3 3 P
4 b 1 3 1 P
5 b 1 - - P
6 b 1 0 0 P
7 b 1 0 4 P
8 b 1 4 4 P
9 b 1 4 0 P
Note that observation 5, which has missing values for X and Y, separates the
observations that draw the inner box from those that draw the outer box and that
the segment number is the same for all the observations. Figure 32.9 on page 958
was generated with a GFONT statement like the following:
proc gfont data=boxes name=boxes filled;
Note that the FILLED option is included and that only the space between the
two squares is filled.
958 Creating a Font Chapter 32
X and Y
specify the horizontal and vertical coordinates of the points for each character.
These variables must be numeric, and they must be named X and Y for the
horizontal and vertical coordinates, respectively. Their values describe the position
of the points on the character. These values can be in any range that you choose,
but both variables must describe the character in the same scale or font units. In
other words, 10 horizontal units must be the same distance as 10 vertical units.
You should define vertical coordinates for all characters on the same baseline.
Note: When you specify PTYPE=W, both X and Y contain horizontal coordinate
values. 4
called kerning, increases or decreases space between the characters. Kerning usually is
applied to certain pairs of characters that, because of their shape, have too much space
between them. Reducing the space between characters may allow part of one character
to extend over the body of the next. Examples of some combinations that should be
kerned are AT, AV, AW, TA, VA, and WA.
You can apply kerning to the intercharacter spacing that you specify with the
CHARSPACETYPE= option (except for uniform fonts). You can refine the kerning of
your characters as little or as much as you like. You assign the kern data set with the
KERNDATA= option.
Figure 32.10 on page 960 illustrates how you can use the KERNDATA= option to
create a font in which the space between specified pairs of letters is reduced. The
characters A, D, and T are shown as the word DATA. The first line uses the unkerned
font, FONT1, and the second line uses the kerned font, FONT2. Note that the
characters in FONT2 are spaced more closely than the characters in FONT1.
The following title statements specify the kerned and unkerned fonts and are used
with the GSLIDE procedure to produce Figure 32.10 on page 960:
title2 lspace=6 f=font1 h=10 j=l ’DATA’;
title3 lspace=4 f=font2 h=10 j=l ’DATA’;
the ADJ variable increase the spacing between characters; negative values reduce
the space.
Figure 32.11 on page 962 illustrates how to use the SPACEDATA= option to generate
a font in which intercharacter spacing is adjusted according to the height of the
characters. The characters A, D, and T are shown as the word DATA. Each pair of lines
displays the word DATA and at the same size uses first the font with spacing
adjustment (FONT3) and then the original font (FONT1). Note that as the size of the
characters increases, the space between them decreases.
The following title statements are used with the GSLIDE procedure to produce
Figure 32.11 on page 962:
title2;
title3 f=font3 h=.25in j=l ’DATA’; /* 18 points */
title4 f=font1 h=.25in j=l ’DATA’;
title5;
title6 f=font3 h=.50in j=l ’DATA’; /* 36 points */
title7 f=font1 h=.50in j=l ’DATA’;
title8;
title9 f=font3 h=1.0in j=l ’DATA’; /* 72 points */
title10 f=font1 h=1.0in j=l ’DATA’;
962 Examples Chapter 32
Examples
The following examples illustrate major features of the GFONT procedure.
Figure 32.12 Display of the Greek Font with Character Codes (GFODISFO)
This example illustrates the SHOWROMAN option, which displays the character
codes that are associated with the font characters that are being displayed. A display
such as this one shows which keyboard character you enter to produce the Greek
character you want. In addition, this example shows how to modify the appearance of
both the font characters and the character codes when they are displayed.
Display the GREEK font with character codes. NOBUILD indicates that the font specified
in the NAME= argument is an existing font. HEIGHT= specifies the height of the Greek
characters. ROMCOL=, ROMFONT=, and ROMHT= assign the color, type style, and height of
the character codes. SHOWROMAN displays the character codes.
proc gfont name=greek
nobuild
height=3.7
romcol=red
romfont=swissl
romht=2.7
showroman;
run;
964 Example 2: Creating Figures for a Symbol Font Chapter 32
quit;
This example shows how to create three simple figures for a symbol font. Each figure
is laid out on a grid that is 64 font units square. The third figure is a circle with a slash
through it. Figure 32.14 on page 965 shows the figure and some of its coordinate points
laid out on a grid.
The GFONT Procedure Example 2: Creating Figures for a Symbol Font 965
Assign the librefs and set the graphics environment. The LIBNAME statement associates
the libref GFONT0 with the SAS data library in which the font catalog is stored.
Create the font data set FIGURES for a triangle, a heart, and a circle with slash. The
first figure, a right-pointing triangle that is assigned the character code A, is a polygon drawn
with three straight lines.
data figures;
input char $ ptype $ x y segment lp $;
datalines;
A W 0 64 0 P /* triangle pointing right */
A V 4 4 1 P
A V 60 32 1 P
A V 4 60 1 P
A V 4 4 1 P
The second figure, a heart that is assigned the character code B, uses the PTYPE variable
combination V-C-V to draw the arcs that make up the top of the heart. Each side requires two
arcs. Since the arcs are continuous, the observation that marks the end of one arc is also the
beginning of the next arc. The heart drawing begins at the bottom point and continues
counterclockwise.
B W 0 64 0 P /* heart */
B V 32 2 1 P
B V 44 17 1 P
B V 58 40 1 P
B C 46 47 1 P
B V 56 58 1 P
B C 46 47 1 P
966 Example 2: Creating Figures for a Symbol Font Chapter 32
B V 32 52 1 P
B C 18 47 1 P
B V 8 58 1 P
B C 18 47 1 P
B V 6 40 1 P
B V 20 17 1 P
B V 32 2 1 P
The third figure, a circle with a slash through it that is assigned the character code C, is
composed of three polygons: a circle and two empty arcs. An observation with missing values
separates the observations defining each of the three polygons. The outer circle is defined by the
first group of observations. The empty arcs are drawn with three continuous arcs using the
PTYPE variable pattern V-C-V-C-V-C-V. The straight line that closes the arc is drawn
automatically by the GFONT procedure in order to complete the polygon. Because all the
polygons are part of one character, the continuous space they define is filled.
C W 0 64 0 P /* circle with slash */
C V 32 64 1 P
C C 32 32 1 P
C V 64 32 1 P
C C 32 32 1 P
C V 32 0 1 P
C C 32 32 1 P
C V 0 32 1 P
C C 32 32 1 P
C V 32 64 1 P
C V . . 1 P
C V 12.4 18.1 1 P
C C 32 32 1 P
C V 8 32 1 P
C C 32 32 1 P
C V 32 56 1 P
C C 32 32 1 P
C V 45.9 51.6 1 P
C V . . 1 P
C V 51.6 45.9 1 P
C C 32 32 1 P
C V 56 32 1 P
C C 32 32 1 P
C V 32 8 1 P
C C 32 32 1 P
C V 18.1 12.4 1 P
;
Generate and display the font FIGURES. The DATA= argument names the input data set
that is used to generate the font. The NAME= argument names the font that the procedure
generates and automatically stores it in the GFONT0 catalog. (Note that you do not need to
specify GFONT0.) FILLED specifies a filled polygon font. CTEXT= specifies the color of the
figures in the font display. The color specification is not stored with the font. RESOL= is set to 2
to improve the resolution of the lines. By default, the newly generated font is displayed (the
NODISPLAY option is not used).
CHAPTER
33
The GIMPORT Procedure
Overview 969
Concepts 970
About Importing Graphics 970
Specifying a Fileref 970
Importing the File 970
CGM Elements Not Supported 971
About Color Mapping 971
About Pattern Mapping 971
About Font Mapping 972
Procedure Syntax 972
PROC GIMPORT Statement 973
MAP Statement 974
SCALE Statement 975
TRANSLATE Statement 976
Examples 976
Example 1: Creating and Importing a CGM 977
Example 2: Adjusting the Graphics Output 979
References 981
Overview
The GIMPORT procedure enables you to import into SAS/GRAPH software graphics
output that is produced with other software applications, graphics output that is
produced by SAS/GRAPH software, or graphics output that is produced on other
machines. The GIMPORT procedure takes as its input a computer graphics metafile
(CGM) and produces graphics output that can be displayed in your SAS/GRAPH session
and stored in a SAS catalog. This graphics output can be reviewed and played like any
other SAS/GRAPH output using the GREPLAY procedure. The GIMPORT procedure
may also write any of the following information to the log:
3 any elements used in the CGM that the procedure cannot process
3 color mapping information when a color in a CGM is not available on the
destination device
3 a list of fonts that are used by the application that produced the CGM.
Note: In addition to the GIMPORT procedure, you can use commands in the File
pull-down menu in the Image Editor, Graph Editor, and Graph window to import other
graphic formats such as GIF, TIFF, and WMF. 4
970 Concepts Chapter 33
Concepts
Specifying a Fileref
You must assign a fileref to the external file that contains the CGM that you want to
use as input so that the GIMPORT procedure can locate it. You can do this with a
FILENAME statement that has the following form:
FILENAMEcgm-fileref’external-file’;
Replace cgm-fileref with any fileref name that you want. Replace ’external-file’ with
the complete file name of the CGM. You can omit the FILENAME statement if you have
already defined the fileref. You can also specify a fileref with a host command in some
operating environments. See “FILENAME Statement” on page 28 for additional
information.
Note: Once you have determined the correct values for the SCALE and
TRANSLATE statements for the graphics output produced by a particular CGM, you
The GIMPORT Procedure About Pattern Mapping 971
can use the same values for all other graphics output that is generated by the same
software application. 4
Note: The color name from the CGM is converted to the RGB format for
SAS/GRAPH color names; that is, WHITE is converted to CXFFFFFF, and so on. See
Chapter 6, “SAS/GRAPH Colors and Images,” on page 91 for details. 4
If a PATTERN TABLE is not defined in the CGM, under certain conditions you may
be able to use SAS/GRAPH PATTERN definitions to control the patterns that are used.
If INTERIOR STYLE is set to PATTERN and if a PATTERN TABLE INDEX has been
specified, then the GIMPORT procedure uses the PATTERN TABLE INDEX to look up
SAS/GRAPH PATTERN definitions. If patterns are defined, the procedure uses the
first available pattern. For example, if the PATTERN TABLE INDEX n has been
defined, the procedure uses SAS/GRAPH PATTERN definition n. If the SAS/GRAPH
PATTERN definition is not the correct pattern type, the procedure modifies the pattern
as necessary. If no PATTERN definitions are currently in effect, an INVALID PATTERN
TABLE INDEX warning is issued and no pattern is used.
Procedure Syntax
Supports: Output Delivery System (ODS)
Syntax
PROC GIMPORT FILEREF=cgm-fileref | ’external-file’
FILETYPE=CGM
FORMAT=BINARY | CHARACTER | CLEARTEXT
<GOUT=<libref.>output-catalog>;
Required Arguments
FILEREF=cgm-fileref | ’external-file’
specifies the computer graphics metafile (CGM) that is input for PROC GIMPORT.
Following are the possible values for FILEREF=:
cgm-fileref
a fileref that is associated with the CGM and that has been previously defined
using a FILENAME statement or host command.
’external-file’
the complete file name of the CGM that you want to import. See the operating
system companion for your system for valid values for external-file.
Featured in: Example 2 on page 979.
FILETYPE=CGM
specifies the type of the input file, that is, the graphics standard to which the file
conforms. CGM is the only valid value for the FILETYPE= argument. If the
FILETYPE= argument is omitted, an error is issued and the procedure stops.
Featured in: Example 2 on page 979.
FORMAT=BINARY | CHARACTER | CLEARTEXT
specifies the format of the input file. CGMs can be encoded in one of the following
three formats:
BINARY
specifies binary encoding. It is not printable.
CHARACTER
specifies an encoding suitable for transfer through networks that cannot support
binary transfers. It is printable but not readable.
CLEARTEXT
specifies a text format that can be read using a standard text editor.
Most graphics packages use BINARY format. If you specify the wrong format, an
"ERROR: Unable to interpret the CGM file" message is issued and the procedure
stops. If this occurs, try a different format.
974 MAP Statement Chapter 33
Options
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GIMPORT procedure. If you omit the libref, SAS/GRAPH looks for the catalog in the
temporary library called WORK and creates the catalog if it does not exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53.
MAP Statement
Substitutes a SAS/GRAPH software font for a font in the CGM.
Requirements: Submit a separate MAP statement for each CGM font that you want to
map.
Tip: You can submit multiple MAP statements with the procedure.
Featured in: Example 2 on page 979.
Syntax
MAP ’cgm-font’ TO font;
Required Arguments
’cgm-font’
identifies a font in the CGM. The name of the font must be enclosed in single
quotation marks and written exactly as it appears in the font list; cgm-font is case
sensitive. Do not include the font list number in cgm-font.
font
specifies the SAS/GRAPH font to which the CGM font is mapped. You can specify
software fonts or hardware fonts for the destination device. You can also use fonts
that are created by the GFONT procedure.
Note: Remember to specify the libref GFONT0 with a LIBNAME statement if
font is a user-generated font. 4
By default, the GIMPORT procedure maps all of the CGM fonts to the font
specified by the FTEXT= graphics option or, if the FTEXT= graphics option is not
used, to the default hardware font, NONE.
Details
If the CGM includes the FONT LIST element, the GIMPORT procedure
automatically lists the CGM font names in the log. Use this list to select the fonts for
mapping. For example, suppose the font list includes the following entry:
3. Times Roman
The GIMPORT Procedure SCALE Statement 975
If the LOG window displays the message "WARNING: Invalid font index n," you can
map the Times Roman font to the SAS/GRAPH font CENTX with the following
statement:
map ’Times Roman’ to centx;
SCALE Statement
Enlarges or reduces the graphics output by increasing or decreasing the values of the x and y
coordinates.
Requirements: You can submit only one SCALE statement.
Tip: You can submit the SCALE statement alone or in conjunction with the
TRANSLATE statement, but the SCALE statement is always processed first.
Featured in: Example 2 on page 979.
Syntax
SCALE X=factor | Y=factor | X=factor Y=factor;
Required Arguments
At least one of the following arguments is required; both may be used and can be
listed in either order:
X=factor
specifies the enlargement or reduction of the values of the x coordinates. Factor is
the number by which these values are multiplied and cannot be less than or equal to
0. By default, X=1. Values less than 1 reduce the size of the graphics output while
values greater than 1 increase the size of the graphics output. There is no limit on
the size of factor.
Y=factor
specifies the enlargement or reduction of the values of the y coordinates. Factor is
the number by which these values are multiplied and cannot be less than or equal to
0. By default, Y=1. Values less than 1 reduce the size of the graphics output while
values greater than 1 increase the size of the graphics output. There is no limit on
the size of factor.
Details
If the shapes in the imported graphics output are too narrow, you can make them
wider by increasing the values of the x coordinate. To make the elements in the
graphics output twice as wide, specify X=2. To make them half as high, specify Y=.5.
For example, if the values of the x coordinates range from 5 to 50 and if in the SCALE
statement the factor for X= is specified as 2, then the values of all of the x coordinates
are multiplied by 2 and the range of these values increases. The new range is 10 to 100.
And if the values of the y coordinates range from 0 to 25 and if in the SCALE statement
the factor for Y= is specified as .5, then the values of all of the y coordinates are
multiplied by .5 and the range of these values decreases. The new range is 0 to 12.5.
If you specify a factor that causes the graphics output to exceed the size of the
graphics output area, the procedure draws as much of the graphics output as will fit in
the available space.
976 TRANSLATE Statement Chapter 33
TRANSLATE Statement
Adjusts the location on the display of the graphics output imported by the procedure. Graphics
output can be shifted left or right by offsetting the x values or shifted up or down by offsetting the
y values.
Requirements: You can submit only one TRANSLATE statement.
Tip: You can submit the TRANSLATE statement alone or in conjunction with the
SCALE statement but the SCALE statement is always processed first.
Featured in: Example 2 on page 979.
Syntax
TRANSLATE X=offset | Y=offset | X=offset Y=offset ;
Required Arguments
At least one of the following arguments is required; both may be used and can be
listed in either order:
X=offset
specifies the number of units in percent of the display area to move the graphics
output right (positive numbers) or left (negative numbers). The value of offset is
added to the value of the x coordinate. By default, X=0.
Y=offset
specifies the number of units in percent of the display area to move the graphics
output up (positive numbers) or down (negative numbers). The value of offset is
added to the value of the y coordinate. By default, Y=0.
Details
The TRANSLATE statement adjusts the position of the graphics output without
changing its size. The amount of the offset that is specified for X= or Y= in the
TRANSLATE statement is the amount that the graphics output is moved.
For example, suppose your imported graphics output is positioned in the upper-left
corner of the display. To move it right 10% and down 5%, use the following statement:
translate x=10 y=-5;
Examples
The following examples illustrate major features of the GIMPORT procedure. For
illustration purposes, these examples create a CGM using SAS/GRAPH software and
import the resulting CGM by using the GIMPORT procedure. Ordinarily, you would use
the GIMPORT procedure to import graphics output that is generated by another
software package.
Note: Because this example uses a CGM device driver to produce a graphics stream
file, you may need to respecify a device driver for your output device. In addition, these
examples use the HSIZE= and VSIZE= graphics options to set a specific size for the
graphics output area for the CGM so that the second example can illustrate the use of
The GIMPORT Procedure Example 1: Creating and Importing a CGM 977
the SCALE and TRANSLATE statements. Depending on the output device that you are
using, you may need to adjust the HSIZE= and VSIZE= values in this example and the
values in the SCALE and TRANSLATE statements in the second example. 4
Assign the fileref for a graphics stream file and set the graphics environment. Set
graphics stream file characteristics, and select the CGM device driver for binary CGM.
978 Example 1: Creating and Importing a CGM Chapter 33
Generate a slide. The graphics output is stored in the GSF file that was specified with the
fileref and in the GOPTIONS statement.
proc gslide;
run;
quit;
Import the GSF file created by the CGM device driver. FILEREF= specifies the fileref
where the CGM is located. FILETYPE= specifies the type of file to be imported. FORMAT=
specifies the format of the CGM being imported.
Output 33.1 shows the font list that is displayed in the log file. The font list contains
all of the fonts that are used by the CGM. The warning messages following the font list
indicate which fonts can be remapped using the MAP statement.
The GIMPORT Procedure Example 2: Adjusting the Graphics Output 979
.
.
.
NOTE: These fonts are used in this CGM file. You may use the MAP statement
to map these fonts to SAS/GRAPH
fonts.
1. SIMPLEX
2. BRUSH
3. CENTB
4. CENTBE
5. CENTBI
6. CENTBIE
7. CENTX
8. CENTXE
9. CENTXI
10. CENTXIE
11. GERMAN
12. GITALIC
13. DUPLEX
14. COMPLEX
15. TRIPLEX
16. TITALIC
17. ITALIC
18. OLDENG
19. SCRIPT
20. CSCRIPT
21. SWISS
22. SWISSE
23. SWISSB
24. SWISSBE
25. SWISSBI
26. SWISSBIE
27. SWISSX
28. SWISSXE
29. SWISSXB
30. SWISSXB
31. SWISSXBE
32. SWISSI
33. SWISSIE
34. SWISSL
35. SWISSLE
36. ZAPF
37. ZAPFE
38. ZAPFB
39. ZAPFBE
40. ZAPFBI
41. ZAPFBIE
42. ZAPFI
43. ZAPFIE
WARNING: Unspecified font index 19. Font has been mapped to the default font.
WARNING: Unspecified font index 3. Font has been mapped to the default font.
WARNING: Unspecified font index 36. Font has been mapped to the default font.
WARNING: Unspecified font index 21. Font has been mapped to the default font.
.
.
.
MAP statement
Sample library member: GIPGROUT
This example imports the CGM file that was created in the earlier example and
modifies the output. This example uses the SCALE and TRANSLATE statements to
correct the size and position of the imported CGM. The MAP statement is also used to
substitute a SAS/GRAPH software font for a font in the CGM.
Assign the fileref for a GSF file and set the graphics environment.
filename gsasfile ’external-file’;
goptions reset=goptions gunit=pct border cback=white
colors=(black) htitle=6 htext=3
vpos=60 hpos=150;
Import the GSF file created by the CGM device driver. The SCALE statement specifies
the scale factor for the values of the x and y coordinates. The TRANSLATE statement specifies
the amount that the imported graphics output should be moved horizontally and vertically. The
MAP statements remap the fonts shown in the first example.
proc gimport fileref=gsasfile filetype=cgm format=binary;
scale x=.7 y=.8;
translate x=3.5 y=10;
map ’SCRIPT’ to script;
map ’CENTB’ to centb;
map ’ZAPF’ to zapf;
map ’SWISS’ to swiss;
run;
Output 33.2 shows the font list that is displayed in the log file. Note that no warning
messages follow the font list because all of the fonts that are used in the CGM have
been remapped.
The GIMPORT Procedure References 981
.
.
.
NOTE: These fonts are used in this CGM file. You may use the MAP statement
to map these fonts to SAS/GRAPH
fonts.
1. SIMPLEX
2. BRUSH
3. CENTB
4. CENTBE
5. CENTBI
6. CENTBIE
7. CENTX
8. CENTXE
9. CENTXI
10. CENTXIE
11. GERMAN
12. GITALIC
13. DUPLEX
14. COMPLEX
15. TRIPLEX
16. TITALIC
17. ITALIC
18. OLDENG
19. SCRIPT
20. CSCRIPT
21. SWISS
22. SWISSE
23. SWISSB
24. SWISSBE
25. SWISSBI
26. SWISSBIE
27. SWISSX
28. SWISSXE
29. SWISSXB
30. SWISSXB
31. SWISSXBE
32. SWISSI
33. SWISSIE
34. SWISSL
35. SWISSLE
36. ZAPF
37. ZAPFE
38. ZAPFB
39. ZAPFBE
40. ZAPFBI
41. ZAPFBIE
42. ZAPFI
43. ZAPFIE
.
.
.
References
ANSI X3.122–1986, Computer Graphics Metafile for the Storage and Transfer of
Picture Description Information.
Arnold, D.B. and Bono, P.R. (1988), CGM and CGI: Metafile Interface Standards for
Computer Graphics, New York: Springer-Verlag.
982
983
CHAPTER
34
The GKEYMAP Procedure
Overview 983
Concepts 983
About Key Maps and Device Maps 983
What Key Maps Do 985
What Device Maps Do 986
Using Key Maps and Device Maps 986
Asymmetrical Maps 986
Seeing What Characters in a Font are Available 987
About the GKEYMAP Data Set 987
GKEYMAP Data Set Variables 987
Procedure Syntax 988
PROC GKEYMAP Statement 988
Examples 990
Example 1: Modifying a Key Map 990
Overview
The GKEYMAP procedure creates key maps and device maps that compensate for
differences between the way that characters are encoded internally by SAS/GRAPH
software and the way that they are encoded by different operating environments and
output devices. In addition, the GKEYMAP procedure can create SAS data sets from
existing key maps and device maps, either Institute-supplied or user-generated. This
capability is useful when you want to make minor alterations in a large key map or
device map and you do not want to or cannot re-create the original data set with a
DATA step.
The Institute supplies key maps for many keyboard configurations and
operating-environment character representations. Your SAS Software Consultant
should have selected the appropriate key map for your site. If the Institute-supplied
device maps and key maps do not meet your needs, you can use this procedure to
modify an existing map or create a new one.
Concepts
character may be represented by one code for the keyboard, another code for the
operating environment, and yet another for the output device. To resolve these
differences, SAS/GRAPH software stores all characters using its own internal encoding
scheme, which is a set of hexadecimal values that are associated with all supported
characters. Figure 34.1 on page 985 shows these internal character encoding (ICE)
codes. To view such a table for yourself, run the following code, which uses the Swiss
font:
goptions keymap=none;
proc gfont nb name=swiss hex;
run;
quit;
Note: Positions 00-1F are reserved. SAS Institute reserves the right to change, at
any time, the character displayed and the hexidecimal code returned for all undefined
codes. 4
available on your keyboard or when the same key on different keyboards sends a
different character to the operating environment. They are also useful for creating new
characters by combining existing characters with accent characters (called diacritics).
Note: In Figure 34.1 on page 985, the diacritic characters specified by the codes D2
through DB are backspaced before being drawn and can be used to create new
characters (characters resulting from codes B0 through B7, B9, and BA are not
backspaced before being drawn). See Example 1 on page 990 for an example of using a
diacritic character as an accent. Two commonly used characters have already been
created for you: the character located in position F0 of the ICE table could be created
by combining DA with an uppercase C, and the character located in position BC could
be created by combining DB with an uppercase G. 4
Once you specify MYKEYMAP as your current key map, you can press a key and the
code it generates is translated by MYKEYMAP into the ICE code that is specified by
the key map.
When you specify a device map with the DEVMAP= graphics option and you use a
hardware character set, mapped characters are converted from their SAS/GRAPH
internal encoding to the codes required to display the corresponding characters on your
device. See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page
261 for more information on the KEYMAP= and DEVMAP= graphics options.
Asymmetrical Maps
It is possible, and sometimes necessary, to define a key map or device map that is not
symmetrical (that is, two or more input character codes map to the same output
character code). For example, if you define a key map to map the keyed character A to
the internal encoding for B, the keyed characters A and B both map to the internal
encoding for B, but no code maps to A. This situation may make it impossible for you to
display certain characters defined in software fonts.
The GKEYMAP Procedure About the GKEYMAP Data Set 987
Procedure Syntax
Requirements: The NAME= argument is always required. To create a key map or device
map, the DATA= argument is required. To output a data set, the OUT= argument is
required.
Syntax
PROC GKEYMAP NAME=map-name
data-set-argument
<option(s)>;
Required Arguments
NAME=map-name
identifies the map that is to be created or converted to a SAS data set. Key maps are
stored as map-name. KEYMAP, and device maps are stored as map-name. DEVMAP.
The value of the KEYMAP or DEVMAP option determines the type of map and the
extension added to map-name. It is possible to use the same map-name value for
both a key map and a device map.
If you create a key map or device map, the map is stored as an entry in the catalog
GFONTn.FONTS where n is a number from 1 to 9, and you must use a LIBNAME
statement to specify a libref for GFONTn. See “About the Libref GFONT0” on page
941 for details.
If you specify an existing key map or device map, SAS/GRAPH software searches
for the map using the same search path that it uses to search for fonts. See “Font
Locations” on page 77 for details .
Featured in: Example 1 on page 990.
DATA=keymap-data-set
identifies the input data set for the GKEYMAP procedure. Used only when you are
creating a key map or device map.
See also: “SAS Data Sets” on page 29 and “About the GKEYMAP Data Set” on page
987.
Featured in: Example 1 on page 990.
OUT=output-data-set
identifies the output data set to which the data from a key map or device map are to
be written. Used only when you output an existing key map or device map as a SAS
data set.
Featured in: Example 1 on page 990.
Options
You can specify as many options as you want and list them in any order.
DEVICE=device-name
specifies the device driver that a device map is associated with, where device-name is
the name of an entry in a device catalog. DEVICE= is not required when creating a
device map, but it can be used if you want to limit the use of the device map to one
particular driver. If you do not use DEVICE=, the device map can be used with any
device. DEVICE= is valid only if you are creating a device map.
DEVMAP | KEYMAP
specifies whether you are working with a device map or a key map. The default is
KEYMAP unless you use an option that can be used only with DEVMAP. This option
also specifies the type of map you are outputting as a data set.
Featured in: Example 1 on page 990.
TYPE=MAP11 | MAP1N
specifies whether you are mapping characters in a device map one-to-one or
one-to-many. If you specify TYPE=MAP11 (the default), each character in a graphics
text string is mapped to only one character on the output device. If you specify
TYPE=MAP1N, a single character in a graphics text string can be mapped to
multiple characters on the output device. For example, if two characters have to be
sent to the graphics output device to display a single hardware character, specify
TYPE=MAP1N. Specify TYPE=MAP1N only when you create a device map.
990 Examples Chapter 34
MULTFONT
specifies that an alternate hardware character set is required to display one or more
characters in the device map. Specify the MULTFONT option only when you create a
device map.
Examples
KEYMAP
NAME=
OUT=
Other features:
DATA step
GOPTIONS procedure
GOPTIONS statement
LIBNAME statement
SORT procedure
Sample library member: GKYMODIF
This example shows how to change multiple characters in an existing key map. It
assumes that the national characters ß and ã are not on your keyboard, so you want to
create a key map that provides them.
To provide the ß character, this example’s key map converts the @ character into the
SAS/GRAPH internal encoding for (’B8’x). Whenever the @ character is typed in text
that is displayed with a software font, the character ß is drawn instead. In this case,
the replacement character uses the text position that would have been used by the
typed character.
Note: Once you have modified your key map so that @ is mapped to ß, you can no
longer generate @ in a software font from your keyboard when the key map is in effect. 4
To provide the ã character, which is not on the keyboard or in the ICE table, this
example’s key map converts the asterisk (*) into the SAS/GRAPH internal encoding for
the accent character ’D5’x (a tilde). In this case, when the character * is typed, the
resulting tilde does not take up a text position but is backspaced and used as an accent
over the character preceding it in the text. To create the ã character, therefore, the text
must contain the two characters a*.
Note: The example updates the current key map rather than creating a new key
map so that all of the other character mapping in the key map remains in effect. 4
Assign the libref and set the graphics environment. LIBNAME associates the libref
GFONT0 with the location of the SAS data library where your device maps and key maps are
stored.
992 Example 1: Modifying a Key Map Chapter 34
Determine the name of the current key map. The SAS log in Output 34.1 shows that the
keymap name is DEFAULT.
proc goptions
option=keymap;
run;
Copy the DEFAULT key map to a temporary SAS data set. NAME= specifies the
DEFAULT key map as input to the procedure. OUT= specifies the data set TEMP, which is
created from the specified key map.
proc gkeymap name=default
out=temp;
run;
Create data set NEW. NEW will be used to create the key map for the character conversions.
Values for the FROM variable are the keyboard characters to be converted. Values for the TO
variable are hexadecimal codes from the SAS ICE table. OUTPUT is required to write a
separate observation for each character to be mapped.
data new;
from=’@’;
to=’b8’x;
output;
from=’*’;
to=’d5’x;
output;
run;
Sort data set NEW and update data set TEMP with the mapping information. The data
set NEW must be sorted by the FROM variable before its observations can be used to update
data set TEMP.
proc sort data=new;
by from;
data temp;
update temp new;
by from;
run;
Create a new key map from the modified data set. NAME= assigns a name to the new key
map. DATA= specifies the data set TEMP as input to the procedure. KEYMAP specifies that the
map being generated is a key map (the default).
The GKEYMAP Procedure Example 1: Modifying a Key Map 993
Specify the new key map in a GOPTIONS statement. KEYMAP= specifies the name of the
new key map so that when the characters @ and a* are specified in TITLE statements, the
characters ß and ã are displayed in the output.
goptions keymap=mykeymap;
Print two titles with the special characters. The character @ is typed where the character
ß should print, and the character * is typed after the character it will accent.
title1 ’Kaiserstra@e’;
title2 ’Sa*o Paulo’;
footnote j=r ’GKYMODIF ’;
proc gslide;
run;
quit;.
’
CHAPTER
35
The GMAP Procedure
Overview 996
About Block Maps 996
About Choropleth Maps 997
About Prism Maps 998
About Surface Maps 998
Concepts 999
About Map Data Sets 999
About Traditional Data Sets 999
Required Variables 999
Segment Variable 1000
LONG and LAT Variables 1000
Traditional Map Data Sets Containing X, Y, LONG, and LAT 1000
Traditional Map Data Sets Containing Only X and Y 1001
About Feature Tables 1001
$GEOREF format 1001
Merging Feature Tables with Response Data Sets 1001
Viewing Map Data Sets 1001
Speciality Map Data Sets 1003
About Response Data Sets 1003
Using the Response Data Set with the Map Data Sets 1003
About Response Variables 1004
About Response Levels 1004
About Identification Variables 1005
Displaying Map Areas and Response Data 1005
Summary of Use 1006
Accessing SAS Maps Online 1006
Procedure Syntax 1007
PROC GMAP Statement 1007
ID Statement 1009
BLOCK Statement 1009
CHORO Statement 1017
PRISM Statement 1022
SURFACE Statement 1030
Using FIPS Codes and Province Codes 1033
Using Formats for Maps 1035
SAS/GRAPH Map Data Sets Reference Information 1038
Accessing Detailed Descriptions of Map Data Sets 1038
Customizing SAS/GRAPH Map Data Sets 1039
Subsetting Traditional Map Data Sets 1039
Reducing Traditional Map Data Sets 1040
Projecting Traditional Map Data Sets 1040
996 Overview Chapter 35
Overview
The GMAP procedure produces two-dimensional (choropleth) or three-dimensional
(block, prism, and surface) color maps that show variations of a variable value with
respect to an area. A wide assortment of map data sets are available with SAS/GRAPH
software.
Use the GMAP procedure to
3 produce maps
3 summarize data that vary by physical area
3 show trends and variations of data between geographic areas
3 highlight regional differences or extremes.
The program for this map is in Example 1 on page 1045. For more information on
producing block maps, see “BLOCK Statement” on page 1009.
information on the PATTERN statement, see “PATTERN Statement” on page 169. For
more information on producing choropleth maps, see “CHORO Statement” on page 1017.
The program for this map is in Example 7 on page 1063. For more information on
producing prism maps, see “PRISM Statement” on page 1022.
The program for this map is in Example 9 on page 1066. For more information on
producing surface maps, see “SURFACE Statement” on page 1030.
Concepts
Map data sets and response data sets are used in the GMAP procedure. These data
sets must contain the required variables or the procedure stops and you get an error
message. Depending on the type of map data set used, the map and response data sets
can be used individually in the GMAP procedure or merged into a single data set to be
used in the GMAP procedure. Each data set must contain the same identification
variable.
Required Variables
A traditional map data set must contain at least these variables:
3 a numeric variable named X that contains the horizontal coordinates of the
boundary points. The value of this variable could be either projected or
unprojected. If unprojected, X represents longitude.
3 a numeric variable named Y that contains the vertical coordinates of the boundary
points. The value of this variable could be either projected or unprojected. If
unprojected, Y represents latitude.
1000 About Traditional Data Sets Chapter 35
3 one or more variables that uniquely identify the areas in the map. Map area
identification variables can be either character or numeric and are indicated in the
ID statement.
The X and Y variable values in the traditional map data set do not have to be in any
specific units because they are rescaled by the GMAP procedure based on the minimum
and maximum values in the data set. The minimum X and Y values are in the lower-left
corner of the map, and the maximum X and Y values are in the upper-right corner.
Traditional map data sets in which the X and Y variables contain longitude and
latitude should be projected before you use them with PROC GMAP. See Chapter 39,
“The GPROJECT Procedure,” on page 1161 for details.
Segment Variable
Optionally, the traditional map data set also can contain a variable named
SEGMENT to identify map areas that comprise noncontagious polygons. Each unique
value of the SEGMENT variable within a single map area defines a distinct polygon. If
the SEGMENT variable is not present, each map area is drawn as a separate closed
polygon that indicates a single segment.
The observations for each segment of a map area in the map data set must occur in
the order in which the points are to be joined. The GMAP procedure forms map area
outlines by connecting the boundary points of each segment in the order in which they
appear in the data set, eventually joining the last point to the first point to complete
the polygon.
The MAP= value in the GMAP procedure automatically uses X and Y. See “Input Map
Data Sets that Contain Both Projected and Unprojected Values” on page 1164 for more
details.
The GMAP Procedure Viewing Map Data Sets 1001
An alternative to using the traditional map data set is the feature table. While the
traditional map data set stores the spatial information across multiple observations, the
feature table uses a data arrangement to store all of the spatial information in a single
variable value. The feature table’s data arrangement uses the $GEOREF SAS/GRAPH
format.
$GEOREF format
The $GEOREF format stores spatial information in binary data streams, making it
possible to store as a single variable value all the information needed to draw a map
area. Thus, the feature tables use only a single observation for each map area, and they
treat a field of spatial information just like any other information that can be added to
a data set. Each $GEOREF value points to a corresponding traditional map data set to
retrieve the coordinate values. The traditional map data set associated with the feature
table must be located in the SAS library with the feature table for GMAP to proceed
correctly.
To locate the variable that contains the spatial information, run PROC CONTENTS
on a feature table. In the Output window, the variable containing the spatial
information will have $GEOREF as the value in the column labelled Format.
Note: Some feature tables, like MAPS.NAMES, have more than one $GEOREF
format variable. 4
rows. The data sets that contain geometry objects describe a map by its spatial
features, so their data tables are referred to as feature tables. Because feature tables
store the spatial information in a single variable value, the spatial data and response
data is viewed as a 1:1 ratio. The traditional MAP data sets define map areas using
geometric coordinates, so their data tables are also referred to as geometry tables.
Traditional map data sets store the geometric coordinates across multiple observations.
In the MAPS library, there is a data set named METAMAPS, which contains meta
data about all of the data sets that are delivered in the library. Among the meta data in
MAPS.METAMAPS are the following four variables, which you can use to determine
which feature table corresponds to a particular geometry table:
Table 35.1
Variable Description
MEMNAME Identifies the names of all of the data sets that are delivered in the
MAPS library.
F_GEOCOL Indicates the variable, in the feature table, whose values encapsulate
the geometry object.
For example, consider the data sets MAPS.ASIA, MAPS.STATES, and MAPS.US.
Each of these represents a geometry table, and to locate the corresponding feature
tables, you would look in MAPS.METAMAPS to find the MEMNAME values ASIA,
STATES, and US. Here are the relevant values on those rows:
Table 35.2
US G US2 _MAP_GEOMETRY_
From these values, you can see that the data sets that are named ASIA, STATES,
and US all represent geometry tables because their MEMCODE values are G. The
feature table corresponding to the ASIA data set is the data set NAMES, which stores
The GMAP Procedure About Response Data Sets 1003
the spatial information in the variable CONT95_GEO. The feature tables corresponding
to STATES and US are both in the data set US2. The spatial information corresponding
to STATES is stored in the variable GEO_STATE, and the spatial information
corresponding to US is stored in the variable _MAP_GEOMETRY_.
Using the Response Data Set with the Map Data Sets
The traditional map data set and the response data set must be used independently
in the PROC GMAP statement, where the response data set is specified by the DATA=
option and the traditional map data set is specified by the MAP= option. The values of
the map area ID variables in the response data set determine the map areas to be
included on the map. Unless the ALL option is used in the PROC GMAP statement,
only the map areas with response values are shown on the map. As a result, you do not
1004 About Response Data Sets Chapter 35
need to subset your map data set if you are mapping only a small section of the map.
However, if you map the same small section frequently, then create a subset of the map
data set for efficiency.
If you have a response data set named WORK.SITES, then the syntax for using
GMAP might resemble the following:
A feature table and response data set are merged using a variable contained in both
data sets. The new combined data set becomes the DATA= value in the PROC GMAP
statement. When the response data set and the feature table are merged into one, do
not use MAP=map-data-set in the PROC GMAP statement. The $GEOREF formatted
variable is the ID variable for the combined data set. See Example 11 on page 1069 for
more details.
Note: Response data that does not correspond to a map feature will be included in
the legend. 4
contains the names of ten regions, each region will be a response level, resulting in ten
response levels.
When character response levels are determined by the MIDPOINTS= option, any
response variable values that do not match one of the specified response level values
are ignored.
When response levels are determined by a range of numeric values, each response
level has the same number of observations. These options are exceptions to this:
3 The LEVELS= option specifies the number of response levels to be used on the
map.
3 The DISCRETE option causes the numeric variable to be treated as a discrete
variable.
3 The MIDPOINTS= option chooses specific response level values as medians of the
value ranges.
If the response variable values are continuous, then the GMAP procedure assigns
response level intervals automatically unless you specify otherwise. The response levels
represent a range of values rather than a single value.
When response levels are determined by specific numeric values, and the DISCRETE
option is specified, one level is created for each value. If the response variable has an
associated format, then each formatted value is represented by a different response
level. Formatted values are truncated to 16 characters.
The BLOCK, CHORO, and PRISM statements assign patterns to response levels. In
CHORO and PRISM maps, response levels are shown as map areas. However, in
BLOCK maps, response levels are shown as blocks. The default fill pattern for the
response level is solid.
PATTERN statements can define the fill patterns and colors for both blocks and map
areas. PATTERN definitions that define valid block patterns are applied to the blocks
(response levels), and PATTERN definitions that define valid map patterns are applied
to map areas.
See “PATTERN Statement” on page 169 for more information on fill pattern values
and default pattern rotation.
and MISSING options. The following table describes the conditions under which the
procedure does or does not display map areas and response data.
includes the map area the map area has no response draws the map area and
value and the MISSING option displays a response level for
is used in the map statement the missing value
does not include the map area the ALL option is used in the draws the map area but leaves
PROC GMAP statement it empty
does not include the map area the ALL option is not used does not draw the map area
Summary of Use
To use the GMAP procedure, you must do the following:
1 If necessary, issue a LIBNAME statement for the SAS data library that contains
the map data set that you want to display.
2 If using a traditional map data set, determine what processing needs to be done to
the map data set before it is displayed. Use the GPROJECT, GREDUCE, and
GREMOVE procedures or a DATA step to perform the necessary processing.
3 Issue a LIBNAME statement for the SAS data set that contains the response data
set, or use a DATA step to create a response data set.
4 If using a traditional map data set, use the PROC GMAP statement to identify the
map data set as the MAP= value and response data set as the DATA= value.
5 If using a feature table, use PROC SORT to individually sort the feature table and
response data set by a variable common to both data sets. Next, use SQL or the
DATA step MERGE to merge the feature table with the response data set by using
a variable common to both data sets. Use the combined data set as the DATA=
value in the PROC GMAP statement (do not include MAP= in the PROC GMAP
statement).
6 Use the ID statement to name the id-variable(s) or the geo-variable.
7 Use a BLOCK, CHORO, PRISM, or SURFACE statement to identify the response
variable and generate the map.
Procedure Syntax
Requirements: One ID statement (see “ID Statement” on page 1009 )and at least one
CHORO (see “CHORO Statement” on page 1017), BLOCK (see “BLOCK Statement” on
page 1009 ), PRISM (see “PRISM Statement” on page 1022), or SURFACE (see
“SURFACE Statement” on page 1030 )statement is required.
Global statements: FOOTNOTE, LEGEND, PATTERN, TITLE
Reminder: The GMAP procedure can include the BY (see “BY Statement” on page 141 ),
FORMAT, LABEL, and WHERE statements as well as the “TITLE, FOOTNOTE, and
NOTE Statements” on page 210.
Supports: RUN-group processing, Output Delivery System (ODS)
Required Argument
DATA=response-data-set | feature-table
identifies the SAS data set that contains the response values or the response values
and the spatial information that are evaluated and represented on the map. If a
1008 PROC GMAP Statement Chapter 35
response data set is specified, it must contain the same identification variable or
variables as the map data set, along with the values of the response variable. If a
feature table is specified, it must contain response data information and spatial
geometry information. By default, the GMAP procedure uses the most recently
created SAS data set.
See Also: “Concepts” on page 999, “SAS Data Sets” on page 29, and “About
Feature Tables” on page 1001.
Options
PROC GMAP statement options affect all of the graphs that are produced by the
procedure.
ALL
specifies that all maps generated by the procedure should include every map area
from the map data set, even if the response data set does not include an observation
for the map area.
When you use the ALL option and a BY statement in a RUN group, the maps
generated for each BY group include every map area from the map data set.
See also: “Displaying Map Areas and Response Data” on page 1005, CEMPTY= and
the MISSING options.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all of the maps that are produced by the GMAP
procedure. To annotate individual maps, use the ANNOTATE= option in the action
statement.
Note: You can use the %MAPLABEL Macro to create the Annotate-data-set. See
“%MAPLABEL Macro” on page 686 for more information. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output that is produced by
the GMAP procedure for later replay. You can use the GREPLAY procedure to view
the graphs stored in the catalog. If you do not use the GOUT= option, catalog entries
are written to the default catalog WORK.GSEG, which is erased at the end of your
session.
Not supported by: Java, ActiveX
See also: “Storing Graphics Output in SAS Catalogs” on page 53.
IMAGEMAP=output-data-set
creates a temporary SAS data set that contains information about the graph that is
replayed from the graphics catalog. The information in the image map data set
includes the shape and coordinates of the elements in the graph, along with values
that were associated with those elements in variables that were identified for that
purpose in the HTML= and/or HTML_LEGEND= options. The image map data set
can be used to generate an HTML image map in an HTML output file using the
IMAGEMAP macro. The IMAGEMAP macro takes two arguments, the name of the
image map data set and the name or fileref of an HTML output file, as shown in the
following example:
%imagemap(imgmapds, myimgmap.html);
MAP=map-data-set
names a SAS traditional map data set that contains the Cartesian coordinates for
the boundary points of each map area. The traditional map data set must contain
the same identification variable or variables as the response data set being used.
This statement is required if a feature table is not being used.
See also: “About Traditional Data Sets” on page 999.
ID Statement
Identifies the variable or variables in the input data set(s) that define map areas.
Requirements: At least one id-variable or geo-variable is required.
ID id-variable(s) | geo-variable;
Required Arguments
id-variable(s)
identifies one or more variables in the map and response data sets that define map
area. This argument is used only when map and response data sets are specified. If
a feature table is specified, then specify the geo-variable argument.
Every variable that is listed in the ID statement must appear in both the map and
response data sets. The variable identified by the id-variable(s) argument can be of
type numeric or character and should have the same name, type, and length in both
the response and map data sets.
See also: “About Identification Variables” on page 1005.
Featured in: Example 1 on page 1045, Example 3 on page 1049, and Example 4 on
page 1052.
geo-variable
identifies the $GEOREF formatted variable in the feature table containing the
spatial geometry information for the map. The variable identified by the geo-variable
argument must be of character type.
See also: “About Identification Variables” on page 1005.
Featured in: Example 11 on page 1069.
BLOCK Statement
Creates three-dimensional block maps on which levels of magnitude of the specified response
variables are represented by blocks of varying height, pattern, and color.
Requirements: At least one response variable is required. The ID statement must be used
in conjunction with the BLOCK statement.
Global statements: FOOTNOTE, LEGEND, PATTERN, TITLE
1010 BLOCK Statement Chapter 35
Description
The BLOCK statement specifies the variable or variables that contain the data that
are represented on the map by blocks of varying height, pattern, and color. This
statement automatically
3 determines the midpoints ranges
3 scales the blocks
3 assigns patterns to the block faces and map areas. (See “About Block Maps and
Patterns” on page 1016 for more information.)
You can use statement options to enhance the appearance of the map. For example,
you can specify the width and shape of the blocks, the outline colors for the blocks and
the map areas, and the angle of view. Other statement options control the response
levels.
In addition, you can use global statements to modify the block patterns, the map
patterns, and the legend, as well as to add titles and footnotes to the map. You can also
use an Annotate data set to enhance the map.
HTML_LEGEND=variable
Required Arguments
response-variable(s)
specifies one or more variables in the response data set, or in the merged response
and feature table, that contain response values that are to be represented on the
map. Each response variable produces a separate map. All variables must be in the
input data set. Multiple response variables are separated with blanks. Blocks are
not drawn for missing values for the response variable unless you use the MISSING
option in the BLOCK statement.
See also: “About Response Variables” on page 1004.
Options
Options in a BLOCK statement affect all of the maps that are produced by that
statement. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate onto maps that are produced by the BLOCK
statement. Annotate coordinate systems 1, 2, 7, and 8 are not valid with block maps.
Note: You can use the %MAPLABEL Macro to create the Annotate-data-set. See
“%MAPLABEL Macro” on page 686 for more information. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
AREA=n | response-variable-name
specifies that a different map pattern be used for the surface of each map area or
group of map areas on the map.
The value of n indicates which variable in the ID statement determines the groups
that are distinguished by a surface pattern. By default, all map unit areas are drawn
using the same surface fill pattern. If your ID statement has only one map area
identification variable, then use AREA=1 to indicate that each map area surface uses
a different pattern. If you have more than one variable in your ID statement, then
use n to indicate the position of the variable that defines groups that will share a
pattern. When you use the AREA= option, the map data set should be sorted in order
of the variables in the ID statement.
A column name defined in either the MAP= or DATA= data sets may be indicated
with the column-name value. If the column name exists in both the MAP= and
DATA= data sets, the column in the map= data set will be used. When column-name
is used, the areas will be colored based on the AREA= value. Duplicate AREA=
values may have different patterns assigned
By default, using the AREA= option fills map areas by rotating the default hatch
patterns through the colors list, beginning with the M2N0 pattern. The default
outline color depends on the PATTERN statement:
3 If you do not specify a PATTERN statement, the default outline color is black
for the Java or ActiveX devices. Otherwise, the default outline color is the
foreground color (the first color in the colors list).
3 If you specify the PATTERN statement or the V6COMP graphics option, the
default is COUTLINE=SAME.
1012 BLOCK Statement Chapter 35
You can specify pattern fills or colors or both with PATTERN statements that
specify map/plot patterns. A separate PATTERN definition is needed for each
specified area.
See also: “PATTERN Statement” on page 169.
Featured in: Example 3 on page 1049.
BLOCKSIZE=size
specifies the width of the blocks. The unit of size is the character cell width for the
selected output device. By default, BLOCKSIZE=2.
Featured in: Example 5 on page 1054.
CBLKOUT=block-outline-color | SAME
outlines all blocks in the specified color. The SAME value specifies that the outline
color of a block, a block segment, or a legend is the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
3 If no PATTERN statements are specified, then the default outline color is the
foreground color (the first color in the colors list).
3 If a PATTERN statement or the V6COMP graphics option is specified, then the
default is CBLKOUT=SAME.
CBLKOUT= is not valid when SHAPE=CYLINDER.
Note: If you specify empty block patterns (VALUE=EMPTY in a PATTERN
statement), you should not change the outline color from the default value, SAME, to
a single color. Otherwise all the outlines will be one color and you will only be able to
distinguish between empty areas by their size. Empty block patterns
(VALUE=EMPTY in a PATTERN statement) are not supported by
DEVICE=ACTIVEX. 4
Featured in: Example 1 on page 1045 and Example 3 on page 1049.
CEMPTY=empty-area-outline-color
outlines empty map areas in the specified color. This option affects only map areas
that are empty. Empty map areas are generated in block maps only when a map
area is omitted from the response data set and the ALL option is included in the
PROC GMAP statement.
The default outline color is the same as the default COUTLINE= color.
Not supported by: Java
See also: ALL on page 1008 and “Displaying Map Areas and Response Data” on
page 1005.
COUTLINE=area-outline-color | SAME
outlines non-empty map areas in the specified color. When
COUTLINE=area-outline-color and DEVICE=JAVA or ACTIVEX, both empty and
non-empty map areas are outlined. The SAME value specifies that the outline color
of a map area is the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
3 If you do not specify a PATTERN statement, the default outline color is black
for the Java or ActiveX devices. Otherwise, the default outline color is the
foreground color (the first color in the colors list).
3 If you specify the PATTERN statement or the V6COMP graphics option, the
default is COUTLINE=SAME.
SAME. Otherwise all the outlines will be one color and you will not be able to
distinguish between the empty areas. Empty block patterns (VALUE=EMPTY in a
PATTERN statement) are not supported by DEVICE=ACTIVEX. 4
Featured in: Example 3 on page 1049.
CTEXT=text-color
specifies a color for the text in the legend. If you omit the CTEXT= option, a color
specification is searched for in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
The CTEXT= color specification is overridden if you also use the COLOR=
suboption of a LABEL= or VALUE= option in a LEGEND definition that is assigned
to the map legend. The COLOR= suboption determines the color of the legend label
or the color of the legend value descriptions, respectively.
For the Java and ActiveX devices, the default color is black.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies a descriptive string up to 256 characters long, that appears in the
description field of the catalog entry for the map. The description does not appear on
the map. By default, the GMAP procedure assigns a description of the form BLOCK
MAP OF variable, where variable is the name of the map variable.
Featured in: Example 5 on page 1054.
DISCRETE
treats a numeric, formatted response variable as though it has discrete values rather
than continuous values. When you use DISCRETE, the response variable values are
not grouped into ranges; instead, the GMAP procedure uses a separate response level
(block height, pattern, and color) for each value of the formatted response variable.
The LEVELS= option is ignored when you use the DISCRETE option.
Use this option only if your numeric response variable is assigned a user-written
format.
Note: If the data does not contain a value in a particular range of the format,
that formatted range is not displayed in the legend. 4
Featured in: Example 3 on page 1049 .
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with an area of
the map and point to the data or graph you wish to display when the user drills
down on the area.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with a legend
value and point to the data or graph you want to display in response to drill-down
input from the user.
Not supported by: Java, ActiveX
LEGEND=LEGEND<1...99>
specifies the LEGEND statement to associate with the map. The LEGEND= option is
ignored if the specified LEGEND definition is not currently in effect. In the GMAP
procedure, the BLOCK statement produces a legend unless you use the NOLEGEND
option. If you use the SHAPE= option in a LEGEND statement, only the value BAR
is valid. Most of the LEGEND options described in “LEGEND Statement” on page
1014 BLOCK Statement Chapter 35
151 are supported by both Java and ActiveX. If a LEGEND option is not supported
by Java or ActiveX, it is noted in the LEGEND option definition.
Not supported by: Java (partial), ActiveX (partial)
See also: “LEGEND Statement” on page 151.
Featured in: Example 2 on page 1047 and Example 5 on page 1054.
LEVELS=number-of-response-levels | ALL
number-of-response-levels specifies the number of response levels that are to be
graphed when the response variables are continuous. Each level is assigned a
different block height, pattern, and color combination.
If you specify DEVICE=ACTIVEX or DEVICE=ACTXIMG, and if you specify
LEVELS=ALL, then a color ramp is used to assign each response value a continuous
color scheme. The response values are assigned lighter and darker values of a color
scheme to express lower and higher response values. When used with all other
devices, the LEVELS=ALL and DISCRETE options behave exactly the same. For
more information, see the DISCRETE option on page 1013.
If you do not use the LEVELS= option or the DISCRETE option, the GMAP
procedure determines the number of response levels by using the formula FLOOR(1
+ 3.3 log(n)), where n is the number of unique identification variable values for map
areas.
The LEVELS= option is ignored when you use the DISCRETE or
MIDPOINTS=value-list option. When MIDPOINTS=OLD is used with the LEVELS=
option, default midpoints are generated using the Nelder algorithm (Applied
Statistics 25:94–7, 1976).
Note: LEVELS=ALL is a . 4
MIDPOINTS=value-list | OLD
specifies the response levels for the range of response values that are represented by
each level (block height, pattern, and color combination).
For numeric response variables, value-list is either an explicit list of values or a
starting and an ending value with an interval increment, or a combination of both
forms:
n <...n>
n TO n <BY increment>
n <...n > TO n <BY increment> <n<...n>>
By default, the increment value is 1. You can specify discrete numeric values in
any order. In all forms, n can be separated by blanks or commas. For example,
midpoints=(2 4 6)
midpoints=(2,4,6)
midpoints=(2 to 10 by 2)
If a numeric variable has an associated format, the specified values must be the
unformatted values. With numeric response values, DEVICE=JAVA only uses
midpoints that fall in the range of the data being used. Thus, if your data ranged
from 30-80, but midpoints were specified at 25, 50, 75,and 100, only 50 and 75 are
used.
For character response variables, value-list is a list of unique character values
enclosed in quotes and separated by blanks:
’value-1’ <...’value-n’>
midpoints=’Midwest’ ’Northeast’ ’Northwest’
Specify the values in any order. If a character variable has an associated format,
the specified values must be the formatted values. Character response values
specified with the MIDPOINTS= option are not supported by DEVICE=JAVA.
The GMAP Procedure BLOCK Statement 1015
You can selectively exclude some response variable values from the map, as shown
here:
midpoints=’Midwest’
Only those observations for which the response variable exactly matches one of the
values listed in the MIDPOINTS= option are shown on the map. As a result,
observations may be excluded inadvertently if values in the list are misspelled or if
the case does not match exactly.
Specifying MIDPOINTS=OLD generates default midpoints using the Nelder
algorithm (Applied Statistics 25:94–7, 1976). Specifying GOPTIONS V6COMP serves
the same purpose.
Not supported by: Java (partial)
Featured in: Example 5 on page 1054.
MISSING
accepts a missing value as a valid level for the response variable.
See also: “Displaying Map Areas and Response Data” on page 1005.
NAME=’entry-name’
If you specify DEVICE=ACTXIMG or DEVICE=JAVAIMG, then the name that you
specify will be used for the client image output even in the file exists. For all other
devices, if the name duplicates an existing entry name, SAS/GRAPH specifies the
name of the catalog entry for the map. The maximum length for entry-name is 8
characters. The default name is GMAP. If the specified name duplicates the name of
an existing entry, SAS/GRAPH appends a number to the duplicate name to create a
unique name, for example, GMAP1.
Featured in: Example 5 on page 1054.
NOLEGEND
suppresses the legend.
SHAPE=3D-block-shape
specifies the shape of the blocks. Use this option to enhance the look of the block
shape, or to specify a different shape. When using the SHAPE= option, only solid fill
patterns will be used. The value of 3D-block-shape can be one of the following:
3 BLOCK | B
3 CYLINDER | C
3 HEXAGON | H
3 PRISM | P
3 STAR | S
The CBLKOUT= option is not valid when SHAPE=CYLINDER.
WOUTLINE=block-outline-width
specifies the width, in pixels, of the outline for all outlined blocks and for the outline
of the map areas.
Not supported by: Java
XSIZE=map-width <units>
YSIZE=map-height <units>
specify the physical dimensions of the map to be drawn. By default, the map uses the
entire procedure output area.
Valid units are CELLS (character cells), CM (centimeters), IN (inches), or PCT
(percentage of the graphics output area). The default unit is CELLS.
If you specify values for map-width or map-height that are greater than the
dimensions of the procedure output area, the map is drawn using the default size.
1016 BLOCK Statement Chapter 35
3 COUTLINE=
In addition the AREA= option controls how the map areas are patterned.
When you use PATTERN statements to define the patterns for the map, you must be
sure to specify the correct type of pattern for the area. The blocks use bar/block
patterns and the map areas use map/plot patterns. See “PATTERN Statement” on page
169 for more information on specifying patterns.
Note: If you specify only one PATTERN statement and include only the COLOR=
option, that color will be used for both the blocks and the map areas. For example, this
statement makes the blocks solid blue and the map areas blue hatch. 4
pattern1 color=blue;
CHORO Statement
Creates two-dimensional maps in which values of the specified response variables are
represented by varying patterns and colors.
Requirements: At least one response variable is required. The ID statement must be used
in conjunction with the CHORO statement
FOOTNOTE, LEGEND, PATTERN, TITLE
Global statements:
Description
The CHORO statement specifies the variable or variables that contain the data
represented on the map by patterns that fill the map areas. This statement
automatically
3 determines the midpoints
3 assigns patterns to the map areas.
You can use statement options to enhance the appearance of the map, for example,
by selecting the colors and patterns that fill the map areas. Other statement options
control the selection of ranges for the response variable.
In addition, you can use global statements to modify the map area patterns and
legend, as well as add titles and footnotes to the map. You can also use an Annotate
data set to enhance the map.
YSIZE=map-height <units>
XVIEW=x
YVIEW=y
ZVIEW=z
3 mapping options:
DISCRETE
LEVELS=number-of-response-levels | ALL
MIDPOINTS=value-list | OLD
MISSING
3 legend options:
CTEXT=text-color
LEGEND=LEGEND<1...99>
NOLEGEND
3 description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
HTML_LEGEND=variable
Required Arguments
response-variable(s)
specifies one or more variables in the response data set, or in the merged response
and feature table, that contain response values that are to be represented on the
map. Each response variable produces a separate map. All variables must be in the
input data set. Multiple response variables are separated with blanks.
Missing values for the response variable are not considered valid response values
unless you use the MISSING option on the CHORO statement.
Response variables can be either numeric or character in type. Numeric response
variables are normally grouped into ranges, or response levels, as determined by the
MIDPOINTS= or LEVELS= options. Each response level is assigned a different
combination of pattern and color. Character response variables are assigned unique
response levels, as are numeric variables when the DISCRETE option is specified.
See also: “About Response Variables” on page 1004.
Options
Options in a CHORO statement affect all graphs that are produced by that
statement. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate onto maps that are produced by the CHORO
statement.
Note: You can use the %MAPLABEL Macro to create the Annotate-data-set. See
“%MAPLABEL Macro” on page 686 for more information. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
The GMAP Procedure CHORO Statement 1019
The LEVELS= option is ignored when you use the DISCRETE option.
Be sure to use this option if your numeric response variable is assigned a
user-written format.
Note: If the data does not contain a value in a particular range of the format,
that formatted range is not displayed in the legend. 4
Featured in: Example 5 on page 1054 and Example 11 on page 1069.
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with an area of
the map and point to the data or graph you wish to display when you drill down on
the area.
Featured in: Example 5 on page 1054.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with a legend
value and point to the data or graph you wish to display when you drill down on the
value.
Not supported by: Java, ActiveX
Featured in: Example 5 on page 1054.
LEGEND=LEGEND<1...99>
assigns the specified LEGEND statement that is to be applied to the map. The
LEGEND= option is ignored if the specified LEGEND definition is not currently in
effect. In the GMAP procedure, the CHORO statement produces a legend by default
unless you specify the NOLEGEND option. If you use the SHAPE= option in a
LEGEND statement, then only the value BAR is valid. Most of the LEGEND options
described in “LEGEND Statement” on page 151 are supported by both Java and
ActiveX. If a LEGEND option is not supported by Java or ActiveX, it is noted in the
LEGEND option definition.
Not supported by: Java (partial), ActiveX (partial)
See also: “LEGEND Statement” on page 151.
Featured in: Example 2 on page 1047.
LEVELS=number-of-response-levels | ALL
specifies the number of response levels to be graphed for numeric response variables,
when the DISCRETE or MIDPOINTS= options are not specified. Each response level
is assigned a different combination of color and fill pattern.
If you specify DEVICE=ACTIVEX or DEVICE=ACTXIMG, and if you specify
LEVELS=ALL, then a color ramp is used to assign each response value a continuous
color scheme. The response values are assigned lighter and darker values of a color
scheme to express lower and higher response values. When used with all other
devices, the LEVELS=ALL and DISCRETE options behave exactly the same. For
more information, see the DISCRETE option on page 1019.
If the LEVELS= option is not used, the GMAP procedure determines the number
of response levels by using the formula FLOOR(1+3.3 log(n)), where n is the number
of unique map area identification variable values.
The LEVELS= option is ignored when you use the DISCRETE or
MIDPOINTS=value-list option. When MIDPOINTS=OLD is used with the LEVELS=
option, default midpoints are generated using the Nelder algorithm (Applied
Statistics 25:94–7, 1976).
Note: LEVELS=ALL is a . 4
Featured in: Example 2 on page 1047.
The GMAP Procedure CHORO Statement 1021
MIDPOINTS=value-list | OLD
specifies the response levels for the range of response values that are represented by
each level (pattern and color combination).
For numeric response variables, the value-list argument is either an explicit list of
values, a starting and an ending value with an interval increment, or a combination
of both forms:
n <...n>
n TO n <BY increment >
n <...n> TO n <BY increment > n <...n>
By default the increment value is 1. You can specify discrete numeric values in
any order. In all forms, n can be separated by blanks or commas. For example,
midpoints=(2 4 6)
midpoints=(2,4,6)
midpoints=(2 to 10 by 2)
If a numeric variable has an associated format, the specified values must be the
unformatted values. With numeric response values, DEVICE=JAVA only uses
midpoints that fall in the range of the data being used. Thus, if your data ranged
from 30-80, but midpoints were specified at 25, 50, 75,and 100, only 50 and 75 are
used.
For character response variables, value-list is a list of unique character values
enclosed in quotation marks and separated by blanks:
’value-1’ <...’value-n’>
The values are character strings enclosed in single quotation marks and separated
by blanks. For example,
midpoints=’Midwest’ ’Northeast’ ’Northwest’
Specify the values in any order. If a character variable has an associated format,
the specified values must be the formatted values. Character response values
specified with the MIDPOINTS= option are not supported by DEVICE=JAVA.
You can selectively exclude some response variable values from the map, as shown
here:
midpoints=’Midwest’
The only observations that are shown on the map are those observations for which
the response variable exactly matches one of the values that are listed in the
MIDPOINTS= option. As a result, observations may be excluded inadvertently if
values in the list are misspelled or if the case does not match exactly.
Specifying MIDPOINTS=OLD generates default midpoints using the Nelder
algorithm (Applied Statistics 25:94–7, 1976). Specifying GOPTIONS V6COMP serves
the same purpose.
Not supported by: Java (partial)
Featured in: Example 8 on page 1065.
MISSING
accepts a missing value as a valid level for the response variable.
See also: “Displaying Map Areas and Response Data” on page 1005.
NAME=’entry-name’
If you specify DEVICE=ACTXIMG or DEVICE=JAVAIMG, then the name that you
specify will be used for the client image output even in the file exists. For all other
devices, if the name duplicates an existing entry name, SAS/GRAPH specifies the
name of the catalog entry for the map. The maximum length of the entry-name value
is eight characters. The default name is GMAP. If the specified name duplicates the
1022 PRISM Statement Chapter 35
PRISM Statement
Creates three-dimensional prism maps in which levels of magnitude of the specified response
variables are represented by polyhedrons (raised polygons) of varying height, pattern, and color.
Requirements: At least one response variable is required. You must use the ID statement
in conjunction with the PRISM statement.
Global statements: FOOTNOTE, LEGEND, PATTERN, TITLE
The GMAP Procedure PRISM Statement 1023
Description
The PRISM statement specifies the variable or variables that contain the data that
are represented on the map by raised map areas. This statement automatically
3 determines the midpoints ranges or midpoints
3 assigns patterns to the map areas.
You can use statement options to control the ranges of the response values, specify
the angle of view, and enhance the appearance of the map.
In addition, you can use global statements to modify the map area patterns and the
legend, as well as add titles and footnotes to the map. You can also use an Annotate
data set to enhance the map.
Note: For maps that contain intersecting polygons or polygons within polygons,
extremely complicated maps, or maps that contain line segments that cross, use the
GREDUCE procedure to reduce and simplify the map if necessary. 4
The option(s) can be one or more options from any or all of the following categories:
3 appearance options:
ANNOTATE=Annotate-data-set
CEMPTY=empty-area-outline-color
COUTLINE=area-outline-color | SAME
WOUTLINE=area-outline-width
XLIGHT=x
YLIGHT=y
XSIZE=map-width <units>
YSIZE=map-height <units>
XVIEW=x
YVIEW=y
ZVIEW=x
3 mapping options:
AREA=n | response-variable-name
DISCRETE
LEVELS=number-of-response-levels | ALL
MIDPOINTS=value-list | OLD
MISSING
3 legend options:
CTEXT=text-color
LEGEND=LEGEND<1...99>
NOLEGEND
3 description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options
HTML=variable
HTML_LEGEND=variable
1024 PRISM Statement Chapter 35
Required Arguments
response-variable(s)
specifies one or more variables in the response data set, or in the merged response
and feature table, that contain response values that are to be represented on the
map. Each response variable produces a separate map. All variables must be in the
input data set. Multiple response variables are separated with blanks.
Missing values for the response variable are not considered valid unless you use
the MISSING option.
Response variables can be either numeric or character. By default, and as
determined by the LEVELS= or MIDPOINTS= values, numeric response variables
are grouped into ranges, or response levels. Each response level is assigned a
different prism height and a different pattern and color combination.
Character variables and numeric variables (when you use the DISCRETE option)
have a unique response level for each unique response variable value.
See also: “About Response Variables” on page 1004.
Options
Options in a PRISM statement affect all of the graphs that are produced by that
statement. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate onto the maps that are produced by the PRISM
statement. Annotate coordinate systems 1, 2, 7, and 8 are not valid with Prism maps.
Note: You can use the %MAPLABEL Macro to create the Annotate-data-set. See
“%MAPLABEL Macro” on page 686 for more information. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
AREA=n| response-variable-name
specifies that a different map pattern be used for the surface of each map area or
group of map areas on the map.
The value of n indicates which variable in the ID statement determines the groups
that are distinguished by a surface pattern. By default, all map unit areas are drawn
using the same surface fill pattern. If your ID statement has only one map area
identification variable, then use AREA=1 to indicate that each map area surface uses
a different pattern. If you have more than one variable in your ID statement, then
use n to indicate the position of the variable that defines groups that will share a
pattern. When you use the AREA= option, the map data set should be sorted in order
of the variables in the ID statement.
A column name defined in either the MAP= or DATA= data sets may be indicated
with the response-variable-name value. If the column name exists in both the MAP=
and DATA= data sets, then the column in the MAP= data set will be used. When
column-name is used, the areas will be colored based on the AREA= value. Duplicate
AREA= values may have different patterns assigned.
By default, the AREA= option fills map areas by rotating the default hatch
patterns through the colors list, beginning with the M2N0 pattern. The default
outline color depends on the PATTERN statement:
3 If no PATTERN statement is specified, the default outline color is the
foreground color (the first color in the colors list).
3 If a PATTERN statement or the V6COMP graphics option is specified, the
default is COUTLINE=SAME.
The GMAP Procedure PRISM Statement 1025
You can specify pattern fills or colors or both with PATTERN statements that
specify map/plot patterns. A separate PATTERN definition is needed for each
specified area.
See also: “PATTERN Statement” on page 169.
Featured in: Example 3 on page 1049.
CEMPTY=empty-area-outline-color
outlines empty map areas in the specified color. Empty map areas are generated in
prism maps either
3 when there is no response value for a map area and the MISSING option is not
used, or
3 when a map area is omitted from the response data set and the ALL option is
included in the PROC GMAP statement.
The default outline color is the same as the default COUTLINE= color.
Not supported by: Java
See also: ALL on page 1008 and “Displaying Map Areas and Response Data” on
page 1005.
COUTLINE=area-outline-color | SAME
outlines non-empty map areas in the specified color. When
COUTLINE=area-outline-color and DEVICE=JAVA or ACTIVEX, both empty and
non-empty map areas are outlined. SAME specifies that the outline color of a map
area is the same as the interior pattern color.
The default outline color depends on the PATTERN statement:
3 If no PATTERN statement is specified, the default outline color is the
foreground color (the first color in the colors list).
3 If a PATTERN statement or the V6COMP graphics option is specified, the
default is COUTLINE=SAME.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the map. The maximum length for
entry-description is 256 characters. By default, the GMAP procedure assigns a
description of the form PRISM MAP OF map_variable.
1026 PRISM Statement Chapter 35
DISCRETE
generates a separate response level (prism height, color, and surface pattern) for each
different value of the formatted response variable. The LEVELS= option is ignored
when you use the DISCRETE option.
Use this option if your numeric response variable is assigned a user-written format.
Note: If the data does not contain a value in a particular range of the format,
that formatted range is not displayed in the legend. 4
Featured in: Example 5 on page 1054 and Example 11 on page 1069 (with the
CHORO statements).
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with an area of
the map and point to the data or graph that are displayed in response to drill-down
input.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with legend
values and point to the data or graphs that are displayed in response to drill-down
input.
Not supported by: Java, ActiveX
LEGEND=LEGEND<1...99>
specifies the LEGEND definition to associate with the map. LEGEND= is ignored if
the specified LEGEND definition is not currently in effect. In the GMAP procedure,
the PRISM statement produces a legend unless you use the NOLEGEND option. If
you use the SHAPE= option in a LEGEND statement, only the value BAR is valid.
Most of the LEGEND options described in “LEGEND Statement” on page 151 are
supported by both Java and ActiveX. If a LEGEND option is not supported by Java
or ActiveX, it is noted in the LEGEND option definition.
Not supported by: Java (partial), ActiveX (partial)
See also: “LEGEND Statement” on page 151
Featured in: Example 8 on page 1065.
LEVELS=number-of-response-levels | ALL
specifies the number of response levels to be graphed when the response variables
are numeric and the DISCRETE and MIDPOINTS= options are not specified. Each
response level is assigned a different prism height, surface pattern, and color
combination.
If you specify DEVICE=ACTIVEX or DEVICE=ACTXIMG, and if you specify
LEVELS=ALL, then a color ramp is used to assign each response value a continuous
color scheme. The response values are assigned lighter and darker values of a color
scheme to express lower and higher response values. When used with all other
devices, the LEVELS=ALL and DISCRETE options behave exactly the same. For
more information, see the DISCRETE option on page 1026.
If neither the LEVELS= option nor the DISCRETE option is used, then the GMAP
procedure determines the number of response levels by using the formula
FLOOR(1+3.3 log(n)), where n is the number of unique map area identification
variable values.
The LEVELS= option is ignored when you use the DISCRETE or
MIDPOINTS=value-list option. When MIDPOINTS=OLD is used with the LEVELS=
option, default midpoints are generated using the Nelder algorithm (Applied
Statistics 25:94–7, 1976).
Note: LEVELS=ALL is a . 4
The GMAP Procedure PRISM Statement 1027
If a numeric variable has an associated format, the specified values must be the
unformatted values. With numeric response values, DEVICE=JAVA only uses
midpoints that fall in the range of the data being used. Thus, if your data ranged
from 30-80, but midpoints were specified at 25, 50, 75,and 100, only 50 and 75 are
used.
For character response variables, value-list has this form:
’value-1’ <...’value-n’>
The values are character strings enclosed in single quotation marks and separated
by blanks. For example,
midpoints=’Midwest’ ’Northeast’ ’Northwest’
Specify the values in any order. If a character variable has an associated format,
the specified values must be the formatted values. Character response values
specified with the MIDPOINTS= option are not supported by DEVICE=JAVA.
You can selectively exclude some response variable values from the map, as shown
here:
midpoints=’Midwest’
Only those observations for which the response variable exactly matches one of the
values listed in the MIDPOINTS= option are shown on the map. As a result,
observations may be inadvertently excluded if values in the list are misspelled or if
the case does not match exactly.
Specifying MIDPOINTS=OLD generates default midpoints using the Nelder
algorithm (Applied Statistics 25:94–7, 1976). Specifying GOPTIONS V6COMP serves
the same purpose.
Not supported by: Java (partial)
Featured in: Example 8 on page 1065.
MISSING
accepts a missing value as a valid level for the response variable.
See also: “Displaying Map Areas and Response Data” on page 1005.
NAME=’entry-name’
When you specify DEVICE=ACTXIMG or DEVICE=JAVAIMG, specifies the name
that will be used for the client image output even in the file exists. For all other
devices, if the name duplicates an existing entry name, then SAS/GRAPH specifies
the name of the catalog entry for the map. The maximum length for entry-name is
eight characters. The default name is GMAP. If the specified name duplicates an
1028 PRISM Statement Chapter 35
existing name, then SAS/GRAPH software appends a number to the duplicate name
to create a unique entry, for example, GMAP1.
NOLEGEND
suppresses the legend.
WOUTLINE=area-outline-width
specifies the width, in pixels, of all map area outlines.
Not supported by: Java, ActiveX
XLIGHT=x
YLIGHT=y
specify the coordinates of the imaginary light source in the map coordinate system.
The position of the light source affects the way the sides of the map polygons are
shaded. Although you can specify any point for the light source using the XLIGHT=
and YLIGHT= options, the light source is actually placed in one of only four positions.
Table 35.3 on page 1028 shows how the point you specify is positioned.
in quadrants I or II, or on the X or +Y axis behind the map (point A), and all side polygons
are shadowed
on or within approximately 10 degrees of the Y the viewing position (point D), and none of the
axis side polygons are shadowed
in quadrant III (except within 10 degrees of to the left of the map (point B), and the
the Y axis) right-facing sides of polygons are shadowed
in quadrant IV (except within 10 degrees of the to the right of the map (point C), and the
Y axis) left-facing side polygons are shadowed
Figure 35.6 on page 1029 illustrates the light source positions. Assume that your
viewing position, selected by the XVIEW=, YVIEW=, and ZVIEW= options, is point D.
The GMAP Procedure PRISM Statement 1029
By default, the light source position is the same as the viewing position specified
by the XVIEW=, YVIEW=, and ZVIEW= options. The light source position cannot
coincide with the viewing reference point (0.5,0.5), which corresponds with the
position directly above the center of the map.
Not supported by: Java, ActiveX
See also: XVIEW= on page 1029.
Featured in: Example 8 on page 1065.
XSIZE=map-width <units>
YSIZE=map-height <units>
specify the dimensions of the map that you are drawing. By default, the map uses
the entire procedure output area.
Valid units are CELLS (character cells), CM (centimeters), IN (inches), or PCT
(percentage of the graphics output area). The default unit is CELLS.
If you specify values for map-width and map height that are greater than the
dimensions of the procedure output area, the map is drawn using the default size. If
you specify one value and not the other, the dimension is adjusted to maintain the
correct aspect ratio.
Not supported by: Java, ActiveX
XVIEW=x
YVIEW=y
ZVIEW=z
specify the viewing position coordinates for the map. In this system, the four corners
of the map lie on the X-Y plane at coordinates (0, 0, 0), (0, 1, 0), (1, 1, 0), and (1, 0, 0).
The viewing position cannot coincide with the viewing reference point at
coordinates (0.5, 0.5, 0).
The value for z cannot be negative.
If you omit the XVIEW=, YVIEW=, and ZVIEW= options, the default coordinates
are (0.5, −2,3). This viewing position is well above and to the south of the center of
the map. One, two, or all three view coordinates can be specified; any that are not
specified are assigned the default values.
1030 SURFACE Statement Chapter 35
Figure 35.5 on page 1016 shows the position of the viewing reference point, as well
as the default viewing position.
To ensure that the polygon edges are distinguishable, the angle from vertical must
be less than or equal to 45 degrees. If you specify a ZVIEW= value such that this
condition cannot be satisfied (that is, a very small value), PROC GMAP increases the
ZVIEW= value automatically so that the angle is 45 degrees or less. While you can
use the XVIEW= and YVIEW= options with DEVICE=JAVA, ZVIEW= can not be
used with DEVICE=JAVA.
Not supported by: Java (partial)
Featured in: Example 8 on page 1065.
SURFACE Statement
Creates three-dimensional surface maps in which levels of magnitude of the specified response
variables are represented by spikes of varying height.
Requirements: At least one response variable is required and must be numeric. The ID
statement must be used in conjunction with the SURFACE statement.
Global statements: FOOTNOTE, TITLE
Not supported by: Java, ActiveX
Description
The SURFACE statement specifies the variable or variables that contain the data
that are represented on the map by raised map areas. This statement automatically
determines the midpoints. You can use statement options to control spike proportions,
specify the angle of view, and modify the general appearance of the map. For example,
you can select the color and number of lines for the representation of the surface area.
You can control the selection of spike heights and base widths.
In addition, you can use global statements to add titles and footnotes to the map.
You can also enhance the map with an Annotate data set.
Required Arguments
response-variable(s)
specifies one or more variables in the response data set, or in the merged response
and feature table, that contain response values that are to be represented on the
map. The response-variable must be numeric and must contain only positive values.
Each response variable produces a separate map. All variables must be in the input
data set. Multiple response variables are separated with blanks.
The GMAP procedure scales response variables for presentation on the map. The
height of the spikes on the map correspond to the relative value of the response
variable, not to the actual value of the response variable. However, when the viewing
angle is changed, the spikes may not appear this way. The spikes in the front may
appear to be higher than the spikes in the back, which represent greater values.
See also: “About Response Variables” on page 1004.
Options
SURFACE statement options affect all maps that are produced by that statement.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate onto maps that are produced by the SURFACE
statement. Annotate coordinate systems 1, 2, 7, and 8 are not valid with surface
maps.
Note: You can use the %MAPLABEL Macro to create the Annotate-data-set. See
“%MAPLABEL Macro” on page 686 for more information. 4
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
CBODY=surface-map-color
specifies the color that is used to draw the surface map. By default, the first color in
the current colors list is used.
CONSTANT=n
specifies a denominator to use in the distance decay function. This function
determines the base width of the spike that is drawn at each map area center.
By default, CONSTANT=10. Values greater than 10 yield spikes that are wider at
the base. Values less than 10 yield spikes that are narrower at the base.
Let xk and yk represent the coordinates, and zk represent the function value at the
center of each map area. The zk values are scaled from 1 to 11. A square grid of x by
y points (where the size of the grid is the NLINES= option value) and the associated
function value f(x,y) are generated from the map area center value using this formula:
k
k 3k kzk
f (x; y) = 1 1:5 + :5D
where
2 k
k
D = x xk + y yk
and
1032 SURFACE Statement Chapter 35
k
= martix cdelim = XXXXXXXXXXXXXXX1 if Dk < 1; 0 otherwise:
TILT=degrees
specifies the degrees of the angle at which to tilt the map about the X axis in the
map coordinate system. The value of degrees can be 0 to 90. Increasing values cause
the map to tilt backward and makes the spikes more prominent. Decreasing values
make the map shape more distinguishable and the spikes less prominent. TILT=90
corresponds to viewing the map edge-on, while TILT=0 corresponds to viewing the
map from directly overhead. By default, TILT=70.
Featured in: Example 10 on page 1068.
XSIZE=map-width <units>
YSIZE=map-height <units>
specify the physical dimensions of the map. By default, the map uses the entire
procedure output area.
Valid units are CELLS (character cells), CM (centimeters), IN (inches), or PCT
(percentage of the graphics output area). The default unit is CELLS.
If you specify values for map-width and map-height that are greater than the
dimensions of the procedure output area, the map is drawn using the default size.
And if you specify only one dimension, the other is scaled to maintain the aspect ratio.
The GMAP Procedure Using FIPS Codes and Province Codes 1033
02 Alaska 31 Nebraska
04 Arizona 32 Nevada
12 Florida 39 Ohio
13 Georgia 40 Oklahoma
15 Hawaii 41 Oregon
16 Idaho 42 Pennsylvania
20 Kansas 47 Tennessee
21 Kentucky 48 Texas
22 Louisiana 49 Utah
23 Maine 50 Vermont
1034 Using FIPS Codes and Province Codes Chapter 35
24 Maryland 51 Virginia
25 Massachusetts 53 Washington
28 Mississippi 56 Wyoming
29 Missouri 72 Puerto Rico
10 Newfoundland
13 New Brunswick
24 Quebec
35 Ontario
46 Manitoba
47 Saskatchewan
48 Alberta
59 British Columbia
60 Yukon
61 Northwest Territories
Function Description
CONT Continent
CNTRY Country
GLC Geographic Location Code, distributed by Government Services
Administration. USA
ISO International Standard Organization
The formats for maps are located in the SASHELP.MAPFMTS catalog. See the
MAPS.NAMES table to view all the continent and country names and corresponding
GLC, ISO, and numeric representation for the continent values.
To use one of the formats for maps, you must specify the SASHELP.MAPFMTS
catalog on the FMTSEARCH= option on a SAS OPTIONS statement:
options fmtsearch=(sashelp.mapfmts);
In addition to using the PUT statement (as shown in the examples in the following
table), the formats can also be invoked using a FORMAT statement.
Note: Be sure to replace SAS-data-library with the location of the SAS data library
that contains map data sets at your site. 4
The following statements provide detailed information on a traditional map data set,
including the number of observations, the variables in each data set, and a description
of each variable:
libname maps ’SAS-data-library’;
run;
To see the contents and descriptions of all of the SAS-supplied map data sets you can
specify DATA=MAPS._ALL_ in the CONTENTS procedure. See the Base SAS
Procedures Guide for more information on the CONTENTS and DATASETS procedures.
To use only North Carolina in US2MERGED, a data set created by using SQL or
DATA step MERGE on the feature table US2 and a response data set also containing
the variable STATE, the GMAP procedure would begin with the following statement:
The WHERE= data set option applies only to the data set that you specify in the
argument in which the WHERE= option appears. If you use the WHERE statement,
the WHERE condition applies to the traditional map data set and the response data
sets or the merged response and feature table.
Another approach is to use a DATA step to create a subset of the larger data set.
This code illustrates another way to extract the observations for Quebec from the
CANADA traditional map data set:
data quebec;
set maps.canada(where=(province=24));
1040 Customizing SAS/GRAPH Map Data Sets Chapter 35
This code illustrates another way to extract North Carolina data from the US2
feature table:
data ncarolina;
set maps.us2(where=(STATE=37));
This approach is most useful when you want to create a permanent subset of a map
data set or when you need to make additional changes to the map data set.
Also see Chapter 42, “The GREMOVE Procedure,” on page 1223 for an example how
to use GREMOVE to create a regional map from one of the traditional map data sets
that are supplied with SAS/GRAPH.
The resulting map is much coarser than one drawn by using all of the observations
in the data set, but it is drawn much faster.
Another way to create a reduced map data set is to use a DATA step to exclude
observations with larger density values:
data states;
set maps.states(where=(density<2));
* If your data is in degrees, then it can be converted to radians by multiplying by the degree-to-radian constant [atan(1)/45].
The GMAP Procedure Creating Traditional Map Data Sets 1041
projected data in the $GEOREF formatted variable (see “$GEOREF format” on page
1001). Most SAS/GRAPH traditional map data sets contain projected coordinates that
are stored as X and Y.
If the projection supplied with the traditional map data set does not meet your needs,
then you can use the GPROJECT procedure (on unprojected map coordinates) to create
a different projection. For more information on traditional map data sets with
unprojected coordinates, see “Traditional Map Data Sets Containing X, Y, LONG, and
LAT” on page 1000. You should select a projection method that least distorts the
regions that you are mapping. (All projection methods inherently distort map regions.)
See Chapter 39, “The GPROJECT Procedure,” on page 1161 for more information.
Note: Using an unprojected traditional map data set with the GMAP procedure can
cause your map to be reversed and distorted. 4
You can also create a new traditional map data set that is a subset of the traditional
map data set:
data nolake;
set maps.chile;
if lake=0;
run;
3 If the unit area contains enclosed polygons, such as lakes, then the SEGMENT
variable has one value but the interior polygon is defined by separate boundaries.
To separate boundaries, a missing X and Y value must be inserted at the
separation point. For example, in the CANADA2 data set supplied with SAS/
GRAPH, the map data for the Northwest Territories (a unit area) use enclosed
polygons for two lakes.
Note: A single map segment (a section of a unit area with a single value of the
SEGMENT variable) cannot contain multiple polygons without at least one observation
with missing values for X and Y. All segments within the map data sets that are
supplied by SAS/GRAPH contain a single polygon that can have one or more separate
boundaries, each separated by an observation with missing values for X and Y. 4
Examples
The following examples include features from one or more of the GMAP statements.
This example produces a block map that shows the total number of hazardous waste
sites in each state in 1997. Since the DISCRETE option is not used, the response
variable is assumed to have a continuous range of values. Because neither the
LEVELS= nor MIDPOINTS= option is used, the GMAP procedure selects a number of
levels based on the number of map areas and then calculates the appropriate response
levels.
The blocks use the default pattern, which is a solid fill that rotates through the
colors list. Because the colors list is specified in the GOPTIONS statement, all colors
are used in the rotation. CBLKOUT= outlines the blocks in black, instead of using the
default outline color, which is the first color in the list– in this case, BLUE.
The map areas use the default pattern for map areas in a block map. This is the first
hatch pattern for maps, M2N0. By default, both the fill and the outline use the first
color in the colors list.
Assign the libref and set the graphics environment. COLORS= specifies the colors list,
which is used by the default patterns and outlines. CTEXT= specifies the color for all text on the
output.
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
The GMAP Procedure Example 2: Specifying Response Levels in a Block Map 1047
3 WV 6
8 WY 3
;
Produce the block map. The ID statement specifies the variable that is in both the map data
set and the response data set and defines map areas. The BLOCK statement specifies the
variable in the response data set that contains the response values for each of the map areas.
CBLKOUT= specifies the color for the block outlines.
This example uses LEVELS= to specify the number of response levels for the blocks.
LEVELS= tells GMAP how many response levels and GMAP calculates the quantiles.
Eight PATTERN statements explicitly define a color for each of these response levels.
A single PATTERN statement uses the REPEAT= option to define an empty map/plot
pattern outlined in black for all the map areas.
The example also changes the viewpoint by rotating the map to provide a better view
of the northeast states. As a result, the blocks appear shorter.
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Define the patterns for the blocks. PATTERN statements 1-8 specify bar/block patterns and
cannot be used by the map areas. They are applied to the blocks in order of the response level.
Define a pattern for the map areas. PATTERN9 defines a single map pattern that is
repeated for each of the 50 map areas (states). The pattern is an empty fill with a black border.
VALUE= defines a map/plot pattern, which cannot be used by the blocks. Specifying a color
causes PATTERN9 to generate only one pattern definition. REPEAT= specifies the number of
times to repeat the pattern definition.
Define legend characteristics. LABEL= produces a two line label and places it to the left of
the legend values. FRAME draws a border around the legend using the first color in the colors
list.
legend1 value=(justify=left)
label=(’Number’ justify=left ’of Sites:’
position=(middle left))
frame;
Produce the block map. LEVELS= specifies the number of response levels for the graph.
SHAPE= draws the blocks as 3D cylinders. XVIEW= changes the viewpoint for the map so that
the map appears to be slightly rotated. ZVIEW= raises the height of the viewpoint. LEGEND=
assigns the LEGEND1 statement to the map legend.
AREA=
CBLKOUT=
COUTLINE=
DISCRETE
WOUTLINE=
Other features:
FORMAT statement
LEGEND statement
PATTERN statement
Sample library member: GMPFORMT
This example creates a format that defines the ranges of values for the response
values and assigns this format to the response variable. These ranges appear in the
legend and make the map easier to understand. When a format is assigned to a
numeric response variable, the DISCRETE option must be used so that each formatted
value is treated as a separate response level.
The example also patterns the map areas by region. To do this, both data sets must
contain the ID variable, REGION. The response data set, SITES, already contains
REGION, so the program only needs to add it to the map data set. Then the map data
set is sorted by both the ID variables, REGION and STATE. Finally, the AREA= option
specifies that the ID variable REGION is the one by which the map areas are patterned.
Create map data set STATES1 by adding REGION to the MAPS.US map data set.
The GMAP Procedure Example 3: Assigning a Format to the Response Variable 1051
data states1;
set maps.us;
select;
when (state in (9,23,25,33,44,50)) region=1;
when (state in (34,36)) region=2;
when (state in (10,11,24,42,51,54)) region=3;
when (state in (1,12,13,21,28,37,45,47)) region=4;
when (state in (17,18,26,27,39,55)) region=5;
when (state in (5,22,35,40,48)) region=6;
when (state in (19,20,29,31)) region=7;
when (state in (8,30,38,46,49,56)) region=8;
when (state in (4,6,15,32)) region=9;
otherwise region=10;
end;
run;
Sort the new map data set. The map data must be sorted in the order of the ID variables.
proc sort data=states1 out=states2;
by region state;
run;
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Create a format for SITES. SITESFMT. defines and labels the ranges of values for SITES.
proc format;
value sitesfmt low-24=’0-24’
25-49=’25-49’
50-74=’50-74’
75-99=’75-99’
100-high=’over 100’;
run;
Define a hatch pattern for the map areas. PATTERN1 defines a dense hatch pattern for the
map areas. Because there are four colors in the colors list, the pattern rotation must be repeated
three times to create enough patterns for the ten regions.
pattern1 value=m3n0 r=3;
Define a solid pattern for the blocks. PATTERN2 through PATTERN6 define the patterns
for the block surfaces.
pattern2 value=solid color=green;
pattern3 value=solid color=cyan;
pattern4 value=solid color=lime;
pattern5 value=solid color=blue;
pattern6 value=solid color=red;
Produce the block maps. The FORMAT statement assigns SITESFMT. to the response
variable. DISCRETE specifies that each formatted value is a separate response level. AREA=
specifies that the map surface should be patterned by the first variable in the ID statement,
REGION. CBLKOUT= and COUTLINE= specify the color that outlines the blocks and the
regions, respectively. WOUTLINE= specifies the width of the block outline in pixels.
proc gmap map=states2 data=sites;
format sites sitesfmt.;
id region state;
block sites / discrete
area=1
legend=legend1
shape=block
cblkout=black
coutline=black
woutline=3;
run;
quit;
ID statement
CHORO statement option:
COUTLINE=
Sample library member: GMPCHORO
This example produces a choropleth (2D) map that shows the total number of
hazardous waste sites in each state in 1997. Since the DISCRETE option is not used,
the response variable is assumed to have a continuous range of values. Because neither
the LEVELS= nor MIDPOINTS= option is used, the GMAP procedure selects a number
of levels based on the number of map areas and then calculates the appropriate
response levels. The legend shows the midpoint value of each level.
The map areas use the default pattern, which is a solid fill that rotates through the
colors list. Because the colors list is specified in the GOPTIONS statement, all colors
are used in the rotation. COUTLINE= outlines the map areas in gray, instead of the
default outline color, which is the first color in the list, in this case, BLUE.
Assign the libref and set the graphics environment. COLORS= specifies the colors list,
which is used by the default patterns and outlines. CTEXT= specifies the color for all text on the
output.
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
1054 Example 5: Creating Maps with Drill-down for the Web Chapter 35
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Produce the choropleth map. The ID statement specifies the variable that is in both the map
data set and the response data set that defines map areas. COUTLINE= specifies the color for
the map area outlines.
PATTERN statement
TITLE statement
Sample library member: GMPDRILL
This example shows how to create a 2D choropleth map with simple drill-down
functionality for the Web. When this map is displayed in a browser, you can select an
area of the map and display additional information about the data.
The example explains how to use the ODS HTML statement and the HTML
procedure options to create the drill-down. It shows how to
3 explicitly name the HTML files and open and close them throughout the program
3 use BY-group processing with ODS HTML, including storing multiple graphs in
one file and incrementing anchor names, catalog entry names, and graphics file
names
3 use the PATH= option to specify the destination for the HTML and GIF files
created by the ODS HTML statement
3 use the NAME= option to name the graphics catalog entries
3 assign anchor names to the graphics output with the ANCHOR= option in the
ODS HTML statement
3 add an HTML HREF string to a data set to define a link target
3 assign link targets with the HTML= procedure option
3 use DES= to control the text of the table of contents entry
3 suppress the titles in the GIF files and display them in the HTML file.
For more information, see “ODS HTML Statement” on page 164.
The example also illustrates other CHORO and BLOCK statement options.
The program produces one choro map that shows Environmental Protection Agency
(EPA) regions and block maps of the states in each region. Each block map shows the
number of hazardous waste sites for each state in the selected region. Figure 35.10 on
page 1055 shows the map of the EPA regions.
Figure 35.11 on page 1056 shows the block map that appears when you select Region
5 in the map.
1056 Example 5: Creating Maps with Drill-down for the Web Chapter 35
Assign the libref and the Web-server path. FILENAME assigns the fileref ODSOUT, which
specifies a destination for the HTML and GIF files produced by the example program. To assign
that location as the HTML destination for program output, ODSOUT is specified later in the
program on the ODS HTML statement’s PATH= option. ODSOUT must point to a Web-server
location if procedure output is to be viewed on the Web.
Close the ODS Listing destination for procedure output, and set the graphics
environment. To conserve system resources, ODS LISTING CLOSE closes the Listing
destination for procedure output. Thus, the graphics output is not displayed in the GRAPH
window, although it is written to the catalog.
Create the data set SITES. SITES contains the FIPS codes for each state and the total
number of hazardous waste sites installed in each state. The STFIPS function converts state
postal codes to FIPS state codes.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
1 AK 12
4 AL 7
4 AR 12
The GMAP Procedure Example 5: Creating Maps with Drill-down for the Web 1057
2 AZ 10
1 CA 90
1 CO 15
5 CT 15
5 DE 18
4 FL 52
4 GA 15
1 HI 4
3 IA 16
1 ID 8
3 IL 38
3 IN 30
3 KS 10
4 KY 16
4 LA 15
5 MA 30
4 MD 13
5 ME 12
3 MI 72
3 MN 30
3 MO 22
4 MS 1
1 MT 8
4 NC 22
3 ND 0
3 NE 10
5 NH 18
5 NJ 105
2 NM 9
1 NV 1
5 NY 78
3 OH 34
2 OK 10
1 OR 10
5 PA 100
5 RI 12
4 SC 26
3 SD 2
4 TN 14
2 TX 26
1 UT 12
4 VA 25
5 VT 8
1 WA 49
3 WI 40
5 WV 6
1 WY 3
;
Add the HTML variable to SITES and create the NEWSITES data set. The HTML
variable REGIONDRILL contains the targets for the values of the variable REGION.
1058 Example 5: Creating Maps with Drill-down for the Web Chapter 35
data newsites;
length regiondrill $40;
set sites;
if region=1 then
regiondrill=’HREF="hazsite_statebody.html#Region1"’;
if region=2 then
regiondrill=’HREF="hazsite_statebody.html#Region2"’;
if region=3 then
regiondrill=’HREF="hazsite_statebody.html#Region3"’;
if region=4 then
regiondrill=’HREF="hazsite_statebody.html#Region4"’;
if region=5 then
regiondrill=’HREF="hazsite_statebody.html#Region5"’;
run;
Assign graphics options for producing the ODS HTML output. DEVICE=GIF causes the
ODS HTML statement to generate the graphics output as GIF files. TRANSPARENCY causes
the graphics output to use the Web-page background as the background of the graph.
Open the ODS HTML destination. BODY= names the file for storing HTML output.
CONTENTS= names the HTML file that contains the table of contents to the HTML procedure
output. The contents file links to each of the body files written to the HTML destination.
FRAME= names the HTML file that integrates the contents and body files. NOGTITLE suppress
the graph titles from the SAS/GRAPH output and displays them through the HTML page.
PATH= specifies the ODSOUT fileref as the HTML destination for all the HTML and GIF files.
Define the title and footnote for the map of the EPA regions.
Define a map pattern for each region. Each PATTERN statement defines one map/plot
pattern. The patterns are assigned to the map areas that represent the EPA regions
Generate the regional map. The ID statement specifies the variable that defines the map
areas and is in both the map data set and the response data set. DISCRETE specifies that each
value of the numeric response variable, STATE, be treated as a separate response level. HTML=
specifies REGIONDRILL as the variable that contains the targets for the map regions.
Specifying HTML variables causes SAS/GRAPH to add an image map to the HTML body file.
DES= specifies the description that is stored in the catalog and used in the Table of Contents.
NAME= specifies the name of the graphics catalog entry. Because the PATH= destination is a
file storage location and not a specific file name, the catalog entry name EPAMAP is
automatically assigned to the GIF file.
Open a new body file for the state maps. Assigning a new body file closes
HAZSITE_MAPBODY.HTML. The contents and frame files, which remain open, will provide
links to all body files. ANCHOR= specifies the name of the anchor that identifies the link target.
This name is automatically incremented when the graphics output is generated. GTITLE uses
titles in the GIF files.
Assign new graphics options for ODS HTML output. The active device is still GIF.
goptions notransparency
border;
Sort the response data set NEWSITES in order of the BY variable. The data must be in
sorted order before running the GMAP procedure with BY-group processing.
Define legend characteristics for the state maps. VALUE= specifies text for the legend
values that describes the ranges specified by MIDPOINTS= in the BLOCK statement.
legend1 shape=bar(3,4)
label=(’Number of Sites’
position=(top center))
1060 Example 5: Creating Maps with Drill-down for the Web Chapter 35
Define a pattern for the map areas. Because the procedure uses BY-group processing to
generate the maps, all map areas use the same map pattern.
Suppress the default BY-line and define a title that includes the BY-values. #BYVAL
inserts the value of the BY variable into the title of each block map.
options nobyline;
title1 ’Wastes Sites per State in Region #byval(region)’;
footnote1 h=3 j=r ’GMPDRIL2’;
Generate the block maps for each region. MIDPOINTS= defines the midpoints of the
ranges described in the legend. NAME= is a full 8 characters ending in 1 so the incremented
names match the regions. NAME= specifies the name of the first catalog entry. Because
BY-group processing generates multiple graphs from one BLOCK statement, the name assigned
by NAME= is incremented to provide a unique name for each piece of output. These names are
automatically assigned to the GIF files. DES= specifies the description that is stored in the
catalog and used in the Table of Contents. Because BY-group processing is used, the same
description is assigned to all the output.
Close the ODS HTML destination, and open the ODS Listing destination. You must close
the HTML destination before you can view the output with a browser.
The GMAP Procedure Example 6: Labeling the States on a U.S. Map 1061
This example uses the MAPS.USCENTER data set and the Annotate facility to add
postal code labels to each state. The program first builds an Annotate data set that
contains the instructions for drawing the labels. Some of the labels are in the center of
the state and others use external labeling with leader lines. The CHORO statement
assigns the Annotate data set to the map.
Note: The coordinates in MAPS.USCENTER have been projected to match
coordinates in the MAPS.US data set. 4
Create annotate data set, CENTER, from MAPS.USCENTER. The annotate data set labels
each state with a two-letter abbreviation. MAPS.USCENTER provides the x and y coordinates
for the labels. FLAG, which is initially turned off, signals when external labeling is in effect.
The labels are drawn after the map because the value of WHEN is a (after). The FIPSTATE
function converts the FIPS codes to state postal codes.
data center;
length function $ 8;
retain flag 0 xsys ysys ’2’ hsys ’3’ when ’a’
style ’swiss’;
set maps.uscenter
(where=(fipstate(state) ne ’DC’)
drop=long lat);
The FIPSTATE function creates the label text by converting the FIPS codes from
MAPS.USCENTER to two-letter postal codes.
function=’label’;
text=fipstate(state);
size=2.5;
position=’5’;
If the labeling coordinates are outside the state (OCEAN=’Y’), Annotate adds the label and
prepares to draw the leader line. Note: OCEAN is a character variable and is, therefore, case
sensitive. OCEAN=’Y’ must specify an uppercase Y.
if ocean=’Y’ then
do;
position=’6’;
output;
function=’move’;
flag=1;
end;
When external labeling is in effect, Annotate draws the leader line and resets the flag.
else if flag=1 then
do;
function=’draw’;
size=.25;
flag=0;
end;
output;
run;
Define pattern characteristics. PATTERN1 defines a single map pattern that is repeated for
each of the 50 map areas (states). The pattern is an empty fill with a blue border. VALUE=
defines a map/plot pattern, which cannot be used by the blocks. Specifying a color causes
PATTERN1 to generate only one pattern definition. REPEAT= specifies the number of times to
repeat the pattern definition.
Produce the choropleth map. NOLEGEND suppresses the legend. ANNOTATE= specifies
the data set to annotate the map.
This example produces a prism map of the hazardous waste sites. Since the
DISCRETE option is not used, the response variable is assumed to have a continuous
range of values. Because neither the LEVELS= nor MIDPOINTS= option is used, the
GMAP procedure selects a number of levels based on the number of map areas and
then calculates the appropriate response levels.
1064 Example 7: Producing a Simple Prism Map Chapter 35
The map areas use the default pattern, which is a solid fill that rotates through the
colors list. Because the colors list is specified in the GOPTIONS statement, all colors
are used in the rotation. COUTLINE= outlines the map areas in gray, instead of the
default outline color, which is the first color in the list, in this case, BLUE.
Since the XVIEW=, YVIEW=, and ZVIEW= options are not used, the default viewing
position, above and to the east and south of the center of the map, is used. Since the
XLIGHT= and YLIGHT= options are not used, none of the side polygons of the prisms
are shadowed. The light source is the same as the viewing position.
Assign the libref and set the graphics environment. COLORS= specifies the colors list,
which is used by the default patterns and outlines. CTEXT= specifies the color for all text.
libname maps ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(blue green lime lipk cyan red)
ctext=black ftext=swiss htitle=6 htext=3;
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Produce the prism map. The ID statement specifies the variable in the map data set and the
response data set that defines map areas. COUTLINE= specifies the map area outline color.
proc gmap map=maps.us data=sites;
id state;
prism sites / coutline=gray;
run;
quit;
The GMAP Procedure Example 8: Specifying Midpoints in a Prism Map 1065
This example explicitly specifies the midpoints for three response levels. Each
response level uses the default solid pattern and a color from the colors list.
The example also changes the map viewpoint and light source.
Assign the libref and set the graphics environment. COLORS= specifies the colors list,
which is used by the default patterns and outlines. CTEXT= specifies the color for all text.
libname maps ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(blue green red) ctext=black
ftext=swiss htitle=6 htext=3;
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
1066 Example 9: Producing a Simple Surface Map Chapter 35
Define legend characteristics. CBORDER= draws a black frame around the legend. If
FRAME were specified, it would be BLUE, the first color in the colors list.
legend shape=bar(4,4)
value=(j=l)
label=(’Number of Sites:’
j=l ’(midpoint of range)’)
cborder=black;
Produce the prism map. MIDPOINTS= specifies three response levels for the map. XLIGHT=
moves the light source to the right and adds shadows to the left-side polygons of the prisms.
XVIEW= and ZVIEW= shift the viewing point to the right and upward, respectively. This
reduces the number of prisms that are partially hidden by taller neighbors.
proc gmap map=maps.us data=sites;
id state;
prism sites / midpoints=25 50 75
xlight=5
xview=.75
zview=5
legend=legend
coutline=gray;
run;
quit;
This example produces a surface map that shows the total number of hazardous
waste sites in each state in 1997. Because the CONSTANT= and NLINES= options are
not used, the GMAP procedure draws a surface that consists of 50 lines and uses the
default decay function to calculate spike height and base width. And because the
ROTATE= and TILT= options are not used, the map is rotated 70 degrees around the Z
axis and tilted 70 degrees with respect to the X axis.
Assign the libref and set the graphics environment. COLORS= specifies the colors list. By
default the map uses the first color in the list.
libname maps ’SAS-data-library’;
goptions reset=global gunit=pct border cback=white
colors=(black blue green red)
ftext=swiss htitle=6 htext=3;
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Produce the surface map. The ID statement specifies the variable in the map data set and
the response data set that defines the map areas.
proc gmap map=maps.us data=sites;
id state;
surface sites;
run;
quit;
This example tilts and rotates the surface map and uses more lines to draw the
surface.
Create response data set SITES. This data set contains a map area identification variable,
STATE, and a response variable, SITES. The STFIPS function is used to convert the state
postal codes to FIPS state codes. STATE contains the FIPS codes for each state and matches the
values of STATE in the MAPS.US data set. SITES contains the total number of waste sites
installed in the state.
The GMAP Procedure Example 11: Creating a Map Using the Feature Table 1069
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7...moredata lines...
3 WV 6
8 WY 3
;
Produce the surface map. CONSTANT= specifies a value that is less than the default value
so the spikes are narrower at the base. NLINES= specifies the maximum number of map lines,
which gives the best map shape resolution. ROTATE= and TILT= adjust the map orientation to
make the crowded spikes in the northeast portion of the map easier to distinguish.
proc gmap map=maps.us data=sites;
id state;
surface sites / constant=4
nlines=100
rotate=40
tilt=60;
run;
quit;
When you use a feature table on PROC GMAP, you merge the feature table with your
response data set before generating a map, storing the combined data in a new data set.
1070 Example 11: Creating a Map Using the Feature Table Chapter 35
On PROC GMAP, you use the DATA= option to name the combined data set, and you
use the ID statement to identify the variable that contains the spatial information.
To illustrate the use of a feature table, assume you want to generate a map of the
United States. Rather than using the traditional map data set MAPS.US, you want to
use its corresponding feature table. To determine which feature table corresponds to a
traditional map data set, look in the MAPS.METAMAPS data set:
3 The feature table MAPS.US2 corresponds to the traditional map data set
MAPS.US.
3 In MAPS.US2, the values of the variable _MAP_GEOMETRY_ encapsulate the
geometry object.
The sample program uses the following procedures and statements:
3 PROC SORT sorts the current data set, WORK.SITES, by the values of variable
STATE. This prepares SITES for a merge with the feature table MAPS.US2, which
is delivered with SAS/GRAPH. The variable STATE identifies the map areas in
both SITES and MAPS.US2.
3 PROC SORT sorts the feature table MAPS.US2. The OUT= option specifies that
the sorted data be written to a new data set WORK.MAPS.
3 In the DATA step, the MERGE statement merges the feature table with the
response data. The combined data set is saved to a new data set named BOTH.
The data set BOTH is stored in WORK, a temporary library. To use the combined
data set in other SAS/GRAPH programs, you would need to save the merged data
set to a permanent library.
3 On the PROC GMAP statement, the DATA= option points to the combined data
set, BOTH. The ID statement specifies _MAP_GEOMETRY_ as the variable that
contains the spatial data. Because both the map and response data are stored in a
single data set, the MAP= option is not required on the PROC GMAP statement.
The following example creates the response data set SITES and merges it with the
feature table US2. It then uses the combined data set to generate a map as a
SAS/GRAPH Control for ActiveX.
Specify a valid file name and assign the libref for the SAS Maps library. This program
generates one HTML file. FILENAME assigns the fileref ODSOUT, which specifies a destination
for the HTML file that is produced by the sample program. ’External-html-file’ needs to be
replaced with the complete path specifying where the files will be located. The following two
lines are the only lines that need to be changed to run the program.
The GMAP Procedure Example 11: Creating a Map Using the Feature Table 1071
Create the data set SITES with regional data. Sites contains a region number for each
state and the total number of hazardous waste sites in each state. The STFIPS function
converts the state postal codes to FIPS state codes.
data sites;
length stcode $ 2;
input region stcode $ sites;
state=stfips(stcode);
datalines;
6 AR 12
10 AK 7
4 AL 12
9 AZ 10
9 CA 90
8 CO 15
1 CT 15
3 DE 18
4 FL 52
4 GA 15
9 HI 4
7 IA 16
10 ID 8
5 IL 38
5 IN 30
7 KS 10
4 KY 16
6 LA 15
1 MA 30
3 MD 13
1 ME 12
5 MI 72
5 MN 30
7 MO 22
4 MS 1
8 MT 8
4 NC 22
8 ND 0
7 NE 10
1 NH 18
2 NJ 105
6 NM 9
9 NV 1
2 NY 78
5 OH 34
6 OK 10
10 OR 10
3 PA 100
1 RI 12
4 SC 26
8 SD 2
4 TN 14
6 TX 26
1072 Example 11: Creating a Map Using the Feature Table Chapter 35
8 UT 12
3 VA 25
1 VT 8
10 WA 49
5 WI 40
3 WV 6
8 WY 3
;
Sort the response and the feature tables in the order of the BY variable. By default,
the first PROC SORT sorts the response data set created in the code above. Both sorted data
sets are stored in the SAS temporary library WORK. To allow the data sets to be merged, the
same BY variable is used to sort both the response and feature tables.
proc sort;
by state;
run;
data both;
merge maps sites;
by state;
run;
Specify the ACTIVEX driver and HTML output. To conserve system resources, ODS
LISTING CLOSE closes the Listing destination for procedure output. In the program’s ODS
HTML statement, the BODY= option names the file for storing HTML output. ODSOUT is
defined in the beginning of the code in the FILENAME statement.
Generate the choropleth map using the merged response data set and feature table.
The ID variable is the $GEOREF formatted variable containing the spatial information.
DISCRETE specifies that each level of REGION is a separate response level.
The GMAP Procedure Example 11: Creating a Map Using the Feature Table 1073
Close the HTML destination and open the listing destination. The HTML destination
must be closed before you can view the output with a browser. ODS LISTING opens the Listing
destination again so that the destination is again available for displaying output during this
SAS session.
CHAPTER
36
The GOPTIONS Procedure
Overview 1075
Procedure Syntax 1076
PROC GOPTIONS Statement 1077
Examples 1078
Example 1: Displaying TITLE and FOOTNOTE Statements 1078
Example 2: Displaying Graphics Options without the Description 1079
Overview
The GOPTIONS procedure provides information about the values of graphics options
and the global statement definitions that are currently in effect in your session. The
values displayed are either the defaults of the current device driver or user-defined
values that have been assigned in your SAS session. You can use the GOPTIONS
procedure to
3 list the current values of all of the graphics options, or of one specified option
3 display the values of all of the AXIS, FOOTNOTE, LEGEND, PATTERN,
SYMBOL, and TITLE definitions that are currently in effect.
Note: Do not confuse the GOPTIONS procedure with the GOPTIONS statement.
The GOPTIONS procedure lists the values that are defined in a GOPTIONS statement
as well as in any other global statement definitions. See “GOPTIONS Statement” on
page 146 for a list of the graphics options that you can set with the GOPTIONS
statement. See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on
page 261 for a complete description of each graphics option. 4
The list of graphics options displays in the SAS LOG window and includes the names
of the options, the current values, and a brief description of each one. You can use
PROC GOPTIONS statement options to control what information is listed and where it
appears in the LOG window. Output 36.1 contains part of a sample LOG listing.
1076 Procedure Syntax Chapter 36
Note: All of the graphics options that are displayed by the GOPTIONS procedure
are described in Chapter 8, “Graphics Options and Device Parameters Dictionary,” on
page 261. 4
Procedure Syntax
PROC GOPTIONS < option(s)>;
The GOPTIONS Procedure PROC GOPTIONS Statement 1077
Syntax
PROC GOPTIONS <option(s)>;
Options
You can specify as many options as you want and list them in any order.
AXIS
A
requests a list of all current AXIS definitions. AXIS also lists the current values for
all graphics options, unless you use the NOLIST option. If you have not defined any
AXIS statements, the GOPTIONS procedure issues a message.
CENTIMETERS
CM
displays the values of the HORIGIN=, HSIZE=, PAPERFEED=, PAPERLIMIT=,
VORIGIN=, and VSIZE= graphics options in units of centimeters (CM). These
graphics options use units of IN or CM only, and their values are always stored as
inches even if you specify CM. Therefore, the GOPTIONS procedure displays these
values in inches, unless you specify the CENTIMETERS option.
Note: The CENTIMETERS option does not affect the graphics options that can
use unit specifications of CELLS, CM, IN, PCT, and PT. 4
FOOTNOTE
F
requests a list of all of the current FOOTNOTE and TITLE definitions. FOOTNOTE
also lists the current values for all of the graphics options, unless you use the
NOLIST option. If you have not defined any FOOTNOTE or TITLE statements, the
GOPTIONS procedure issues a message.
1078 Examples Chapter 36
Examples
This example uses the FOOTNOTE option to display the current definitions of both
the FOOTNOTE and TITLE statements. It also uses the NOLIST option to suppress
the list of graphics options. Output 36.2 shows the listing that appears in the LOG.
Produce the listing. The NOLIST and FOOTNOTE options control the information that
appears in the LOG window.
proc goptions nolist footnote;
run;
This example uses the SHORT option to display only the values of graphics options
without the description of each graphics option. Output 36.3 shows the listing that
appears in the LOG window.
1080 Example 2: Displaying Graphics Options without the Description Chapter 36
Set the graphics environment. The values of the graphics options specified in this statement
appear in the LOG listing.
Produce the listing. The SHORT option suppresses the display of the description of each
graphics option.
CHAPTER
37
The GPLOT Procedure
Overview 1081
About Plots of Two Variables 1082
About Plots with a Classification Variable 1083
About Bubble Plots 1083
About Plots with Two Vertical Axes 1084
About Interpolation Methods 1085
Concepts 1085
Parts of a Plot 1085
About the Input Data Set 1086
Missing Values 1087
Values Out of Range 1087
Sorted Data 1087
Logarithmic Axes 1087
Procedure Syntax 1088
PROC GPLOT Statement 1088
BUBBLE Statement 1090
BUBBLE2 Statement 1098
PLOT Statement 1101
PLOT2 Statement 1115
Examples 1120
Example 1: Generating a Simple Bubble Plot 1120
Example 2: Labeling and Sizing Plot Bubbles 1122
Example 3: Adding a Right Vertical Axis 1124
Example 4: Plotting Two Variables 1126
Example 5: Connecting Plot Data Points 1129
Example 6: Generating an Overlay Plot 1131
Example 7: Filling Areas in an Overlay Plot 1134
Example 8: Plotting Three Variables 1135
Example 9: Plotting with Different Scales of Values 1138
Example 10: Creating Plots with Drill-down for the Web 1141
Overview
The GPLOT procedure plots the values of two or more variables on a set of
coordinate axes (X and Y). The coordinates of each point on the plot correspond to two
variable values in an observation of the input data set. The procedure can also generate
a separate plot for each value of a third (classification) variable. It can also generate
bubble plots in which circles of varying proportions representing the values of a third
variable are drawn at the data points.
The procedure produces a variety of two-dimensional graphs including
1082 About Plots of Two Variables Chapter 37
The program for this plot is in Example 4 on page 1126. For more information on
producing scatter plots, see “PLOT Statement” on page 1101.
The GPLOT Procedure About Bubble Plots 1083
You can also overlay two or more plots (multiple sets of data points) on a single set of
axes and you can apply a variety of interpolation techniques to these plots. See “About
Interpolation Methods” on page 1085.
By default, plots with a classification variable generate a legend. In the code that
generates the plot for Example 8 on page 1135, a SYMBOL statement connects the data
points and specifies the plot symbol that is used for each value of the classification
variable (CITY). The program for this plot is in Example 8 on page 1135. For more
information on how to produce plots with a classification variable, see “PLOT
Statement” on page 1101.
relation to the vertical axis is determined by the average salary for the category. The
size of each bubble represents the number of engineers in the category relative to the
total number of engineers in the data.
By default, the BUBBLE statement scales the axes to include the maximum and
minimum data values and draws an unlabeled circle at each data point. It labels each
axis with the name of its variable or an associated label and displays the value of each
major tick mark.
The program for this plot is in Example 1 on page 1120. For more information on
producing bubble plots, see “BUBBLE Statement” on page 1090.
The program for this plot is in Example 9 on page 1138. For more information on
how to produce plots with a right vertical axis, see “PLOT2 Statement” on page 1115
and “BUBBLE2 Statement” on page 1098.
Concepts
Parts of a Plot
Some terms used with GPLOT procedure are illustrated in Figure 37.5 on page 1086
and Figure 37.6 on page 1086.
1086 About the Input Data Set Chapter 37
be character or numeric. Graphs are automatically scaled to the values of the character
data or to include the values of numeric data, but you can control scaling with
procedure options or with associated AXIS statements.
Missing Values
If the value of either of the plot variables is missing, the GPLOT procedure does not
include the observation in the plot. If you specify interpolation with a SYMBOL
definition, the plot is not broken at the missing value. To break the plot line or area fill
at the missing value, use the PLOT statement’s SKIPMISS option. SKIPMISS is
enabled only for JOIN interpolations.
Sorted Data
Data points are plotted in the order in which the observations are read from the data
set. Therefore, if you use any type of interpolation that generates a line, sort your data
by the horizontal axis variable.
Logarithmic Axes
If your data contain logarithmic values or if the data values vary over a wide range
or contain large values, you may want to specify a logarithmic axis for the horizontal or
vertical axis. Logarithmic axes can be specified with the AXIS statement options
LOGBASE= and LOGSTYLE=. See “AXIS Statement” on page 124 for a complete
discussion.
1088 Procedure Syntax Chapter 37
Procedure Syntax
Requirements: At least one PLOT or BUBBLE statement is required. A PLOT2 or
BUBBLE2 statement can be used in conjunction with a PLOT or BUBBLE statement.
AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
Global statements:
FOOTNOTE, and NOTE Statements” on page 210, GOPTIONS“GOPTIONS Statement”
on page 146, LEGEND“LEGEND Statement” on page 151, PATTERN“PATTERN
Statement” on page 169, SYMBOL“SYMBOL Statement” on page 183, TITLE“TITLE,
FOOTNOTE, and NOTE Statements” on page 210
Reminder: The procedure can include BY, FORMAT, LABEL, WHERE, and NOTE
statements.
Supports: RUN-group processing Output Delivery System (ODS)
Syntax
PROC GPLOT < DATA=input-data-set>
<ANNOTATE=Annotate-data-set>
<GOUT=<libref.>output-catalog>
<IMAGEMAP=output-data-set >
<UNIFORM>;
Options
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GPLOT
procedure. To annotate individual graphs, use ANNOTATE= in the action statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
The GPLOT Procedure PROC GPLOT Statement 1089
DATA=input-data-set
specifies the SAS data set that contains the variables to plot. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29 and “About the Input Data Set” on page 1086.
GOUT=< libref. >output-catalog
specifies the SAS catalog in which to save the graphics output that is produced by
the GPLOT procedure. If you omit the libref, SAS/GRAPH looks for the catalog in
the temporary library called WORK and creates the catalog if it does not exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53.
IMAGEMAP=output-data-set
creates a temporary SAS data set that is used to generate an image map in an
HTML output file. The IMAGEMAP= option can be used only if the PLOT or PLOT2
statements are used, and the PLOT or PLOT2 statement must use the HTML=
option or the HTML_LEGEND= option or both.
If HTML= is used on the PLOT or PLOT2 statement, the plot points are defined as
hot zones, unless AREA= is also used, in which case there are not plot points and the
areas between plot lines are defined as hot zones. If HTML_LEGEND= is used, the
legend symbols are defined as hot zones. Information for the links is stored in the
variables referenced by the HTML= and/or HTML_LEGEND= options.
The %IMAGEMAP macro generates the image map in the HTML output file. The
macro takes two arguments, the name of the image map data set and the name or
fileref of the HTML output file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
UNIFORM
specifies that the same axis scaling is used for all graphs that are produced by the
procedure. By default, the range of axis values for each axis is based on the minimum
and maximum values in the data and, therefore, may vary from graph to graph and
among BY groups. Using the UNIFORM option forces the value range for each axis to
be the same for all graphs. Thus, if the procedure produces multiple graphs with both
left and right vertical axes, the UNIFORM option scales all of the left axes the same
and all of the right axes the same, based on the minimum and maximum data values.
In addition, UNIFORM forces the assignment of SYMBOL statements for the
category variable without regard to the BY-group variable, and, if a legend is
generated, makes the legend the same across graphs.
Not supported by: Java, ActiveX
1090 BUBBLE Statement Chapter 37
BUBBLE Statement
Creates bubble plots in which a third variable is plotted against two variables represented by the
horizontal and vertical axes; the value of the third variable controls the size of the bubble.
Requirements: At least one plot request is required.
Global statements: AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
FOOTNOTE, and NOTE Statements” on page 210, TITLE“TITLE, FOOTNOTE, and
NOTE Statements” on page 210
Description
The BUBBLE statement specifies one or more plot requests that name the horizontal
and left vertical axis variables and the variable that controls the size of the bubbles.
This statement automatically
3 centers each circle at a data point that is determined by the values of the vertical
and horizontal axes variables
3 scales the axes to include the maximum and minimum data values
3 labels each axis with the name of its variable or associated label
3 displays each major tick mark value
3 draws circles for values that are located within the axes.
You can use statement options to control axis scaling, draw reference lines, modify
the appearance of axes, control the display of the bubbles, specify a backplane color or
image, and specify annotation.
In addition, you can use global statements to modify axes (AXIS statement), and add
text to the graph (TITLE, NOTE, and FOOTNOTE statements). You can also use the
Annotate data set to enhance the plot.
Syntax
BUBBLE plot-request(s) </option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 bubble appearance options:
BCOLOR=bubble-color
BFONT=font
BLABEL
BSCALE=AREA | RADIUS
BSIZE=multiplier
3 plot appearance options:
ANNOTATE=Annotate-data-set
CAXIS=axis-color
CFRAME=background-color
CTEXT=text-color
FRAME | NOFRAME
GRID
HREVERSE
IFRAME= fileref | ’external-file’
IMAGESTYLE = TILE | FIT
NOAXIS
3 horizontal axis options:
AUTOHREF
The GPLOT Procedure BUBBLE Statement 1091
CAUTOHREF=reference-line-color
CHREF=reference-line-color | (reference-line-color) | reference-line-color-list
HAXIS=value-list | AXIS<1...99>
HMINOR=number-of-minor-ticks
HREF=value-list
HZERO
LAUTOHREF=reference-line-type
LHREF=reference-line-type | (reference-line-type) | reference-line-type-list
3 vertical axis options:
AUTOVREF
CAUTOVREF=reference-line-color
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
LAUTOVREF=reference-line-type
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
VAXIS=value-list | AXIS<1...99>
VMINOR=number-of-minor-ticks
VREF=value-list
VREVERSE
VZERO
3 catalog entry description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
Required Arguments
plot-request(s)
each specifies the variables to plot and produces a separate graph. All variables must
be in the input data set. Multiple plot requests are separated with blanks. A plot
request must have this form:
y-variable*x-variable=bubble-size
plots the values of two variables and draws a circle (bubble) at each data point.
The value of the third variable determines the size of the bubble.
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
bubble-size
variable that dictates the size of the bubbles. Bubble-size must be numeric. If
the value of bubble-size is positive, bubbles are drawn with a solid line; if it is
negative, bubbles are drawn with a dashed line.
Note: If you specify the JAVA, JAVAMETA, or JAVAIMG device drivers, then either
the x-variable or the y-variable must be numeric. 4
1092 BUBBLE Statement Chapter 37
Options
Options in a BUBBLE statement affect all graphs that are produced by that
statement. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate plots that are produced by the BUBBLE statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
AUTOHREF
draws reference lines at all major tick marks on the horizontal axis. To specify line
types for these reference lines, use the LAUTOHREF= option. To specify colors for
these reference lines, use the CAUTOHREF= option. To specify labels for these
reference lines, use the HAXIS= option.
AUTOVREF
draws reference lines at all major tick marks on the vertical axis. To specify line
types for these reference lines, use the LAUTOVREF= option. To specify colors for
these reference lines, use the CAUTOVREF= option. To specify labels for these
reference lines, use the VAXIS= option.
BCOLOR=bubble-color
specifies the color for the bubbles. If you omit the BCOLOR= option, the first color in
the colors list is used for the bubble color.
Featured in: Example 2 on page 1122 and Example 3 on page 1124.
BFONT=font
specifies the font to use for bubble labels. See Chapter 5, “SAS/GRAPH Fonts,” on
page 75for details on how to specify font. If you omit the BFONT= option, a font
specification is searched for in this order:
1 the FTEXT= option in a GOPTIONS statement
2 the default hardware font.
See also: The BLABEL option for information on the location and color of labels.
Featured in: Example 2 on page 1122.
Not supported by: Java, ActiveX
BLABEL
labels the bubbles with the values of the third variable. If the variable has a format,
the formatted value is used. By default, bubbles are not labeled.
The procedure normally places labels directly outside of the circle at 315 degrees
rotation. If a label in this position does not fit in the axis area, other 45-degree
placements (that is, 45, 135, and 225 degrees) are attempted. If the label cannot be
placed at any of the positions (45, 135, 225, or 315 degrees) without being clipped,
the label is omitted. However, labels may collide with other bubbles or previously
placed labels.
Labels display in the color specified by the CTEXT= option. If you omit CTEXT=,
the default is the first color in the colors list.
Featured in: Example 2 on page 1122.
BSCALE=AREA | RADIUS
specifies whether the bubble-scaling proportion is based on the area of the circles or
the radius measure. By default, BSCALE=AREA.
The value that is assigned to the BSCALE= option affects how large the bubbles
appear in relation to each other. For example, suppose the third variable value is
twice as big for one bubble as it is for another. If BSCALE=AREA, the area of the
larger bubble will be twice the area of the smaller bubble. If BSCALE=RADIUS, the
The GPLOT Procedure BUBBLE Statement 1093
radius of the larger bubble will be twice the radius of the smaller bubble and the
larger bubble will have more than twice the area of the smaller bubble.
Not supported by: Java, ActiveX
BSIZE=multiplier
specifies an overall scaling factor for the bubbles so that you can increase or decrease
the size of all bubbles by this factor. By default, BSIZE=5. If you specify BSIZE=0,
then the default size is used instead.
In Web output, the Java applets and the ActiveX Control override the default
value. To prevent this override, specify a value for the BSIZE= option, rather than
relying on the default value.
Featured in: Example 2 on page 1122 andExample 2 on page 1122.
Not supported by: Java (partial), ActiveX (partial)
CAUTOHREF=reference-line-color
specifies colors for reference lines drawn at major tick marks on the horizontal axis,
as specified by the AUTOHREF option. The default color is either the value of the
CAXIS= option or the first color in the color list. To specify line types for these
reference lines, use the LAUTOHREF= option. To specify labels for these reference
lines, use the HAXIS= option.
CAUTOVREF=reference-line-color
specifies colors for reference lines drawn at major tick marks on the vertical axis, as
specified by the AUTOVREF option. The default color is either the value of the
CAXIS= option or the first color in the color list. To specify line types for these
reference lines, use the LAUTOVREF= option. To specify labels for these reference
lines, use the VAXIS= option.
CAXIS=axis-color
CA=axis-color
specifies the color for the axis line and all major and minor tick marks. By default,
the procedure uses the first color in the colors list.
If you use the CAXIS= option, it may be overridden by
1 the COLOR= option in an AXIS definition, which in turn is overridden by
2 the COLOR= suboption of the MAJOR= or MINOR= option in an AXIS
definition.
Featured in: Example 2 on page 1122 and Example 3 on page 1124.
CFRAME=background-color
CFR=background-color
fills the axis area with the specified color. If the FRAME option is also in effect, the
procedure determines the color of the frame according to the precedence list given for
the FRAME option description. If the IFRAME= option is in effect, the specified
image fills the axis area instead of the specified color.
CHREF=reference-line-color | (reference-line-color)
CH=reference-line-color | (reference-line-color)
specifies the color of reference lines drawn perpendicular to the horizontal axis. This
option affects reference lines drawn with the AUTOHREF, HREF, and GRID options.
Specifying a single color without parentheses applies that color to all reference lines.
The CAUTOHREF= option overrides the CHREF= option for lines drawn with the
AUTOHREF option. Specifying a single color in parentheses applies that color only to
the first reference line drawn with the HREF= option. Specifying a color list applies
colors sequentially to successive reference lines drawn with the HREF= option. The
syntax of the color list is of the form (color1 color2... colorN) or (color1, color2...,
colorN). Default colors for reference lines are determined by the CAXIS= option or by
1094 BUBBLE Statement Chapter 37
the first color in the color list. To specify line types for these reference lines, use the
LHREF= option. To specify labels for these reference lines, use the HAXIS= option.
CTEXT=text-color
C=text-color
specifies the color for all text on the axes, including tick mark values, axis labels, and
bubble labels.
If you omit the CTEXT= option, a color specification is searched for in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
If you use the CTEXT= option, it overrides the color specification for the axis label
and the tick mark values in the COLOR= option in an AXIS definition that is
assigned to the axis.
If you use CTEXT=, the color specification is overridden in this situation: if you
also use the COLOR= suboption of a LABEL= or VALUE= option in an AXIS
definition that is assigned to the axis, that suboption determines the color of the axis
label or the color of the tick mark values, respectively.
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
CV=reference-line-color | (reference-line-color) | reference-line-color-list
specifies the color of reference lines drawn perpendicular to the vertical axis. This
option affects reference lines drawn with the AUTOVREF, VREF, and GRID options.
Specifying a single color without parentheses applies that color to all reference lines.
The CAUTOVREF= option overrides the CVREF= option for lines drawn with the
AUTOVREF option. Specifying a single color in parentheses applies that color only to
the first reference line drawn with the VREF= option. Specifying a color list applies
colors sequentially to successive reference lines drawn with the VREF= option. The
syntax of the color list is of the form (color1 color2... colorN) or (color1, color2...,
colorN). Default colors for reference lines are determined by the CAXIS= option or by
the first color in the color list. To specify line types for these reference lines, use the
LVREF= option. To specify labels for these reference lines, use the VAXIS= option.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the plot. The maximum length for
entry-description is 256 characters. The description does not appear on the plot. By
default, the procedure assigns a description of the form BUBBLE OF
variable*variable=variable.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. For more information, refer to the description of the option on
page 222, and the discussion of “Substituting BY Line Values in a Text String” on
page 226. The 256-character limit applies before the substitution takes place for
these options; thus, if in the SAS program the entry-description text exceeds 256
characters, it is truncated to 256 characters, and then the substitution is performed.
The descriptive text is shown in the "description" portion of each of the following:
3 in the Results window
3 among the catalog-entry properties that you can view from the Explorer window
3 in the Table of Contents that is generated when you use CONTENTS= option on
an ODS statement, assuming that the GPLOT output is generated while the
contents page is open. See “Linking to Output through a Table of Contents” on
page 495.
3 in the Description field of the PROC GREPLAY window
The GPLOT Procedure BUBBLE Statement 1095
FRAME | NOFRAME
FR | NOFR
specifies whether a frame is drawn around the axis area. The default is FRAME;
however, if the V6COMP option is in effect on the GOPTIONS statement, the default
is NOFRAME. If you also use a BUBBLE2 or PLOT2 statement and your plotting
statements have conflicting frame specifications, FRAME is used.
For the frame color, a specification is searched for in this order:
1 the CAXIS= option
2 the COLOR= option in the AXIS definition assigned to the vertical axis
3 the COLOR= option in the AXIS definition assigned to the horizontal axis
4 the default, the first color in the colors list.
To fill the axis area with a background color, use the CFRAME= option.
To fill the axis area with a background image, use the IFRAME= option.
GRID
draws reference lines at all major tick marks on both axes. You get the same result
when you use all of these options in a BUBBLE statement: AUTOHREF,
AUTOVREF, FRAME, LVREF=34, and LHREF=34. The line type for GRID is 34.
The line color is the color of the axis.
HAXIS=value-list | AXIS<1 . . . 99>
specifies major tick mark values for the horizontal axis or assigns an axis definition.
For a description of value-list, see the HAXIS= on page 1108 option for the PLOT
statement. To assign labels to horizontal reference lines, specify an axis definition
that contains the REFLABEL= option. Labels will be applied in sequence to all
reference lines drawn with the AUTOHREF and HREF= options.
If you assign an axis definition that does not currently exist, the option is ignored.
By default, the procedure scales the axis and provides an appropriate number of tick
marks.
If data values fall outside of the range that is specified by the HAXIS= option,
then by default the outlying data values are not used in interpolation calculations.
For Web output that is generated with a Java or ActiveX device driver, certain
options of the AXIS statement are not supported. For details, see “AXIS Statement”
on page 124.
See also: “About the Input Data Set” on page 1086 for more information on values
out of range.
Featured in: Example 2 on page 1122.
Not supported by: Java (partial), ActiveX (partial)
HMINOR=number-of-minor-ticks
HM=number-of-minor-ticks
specifies the number of minor tick marks that are drawn between each major tick
mark on the horizontal axis. Minor tick marks are not labeled. The HMINOR=
option overrides the NUMBER= suboption of the MINOR= option in an AXIS
definition. You must specify a positive number.
Featured in: Example 2 on page 1122.
HREF=value-list
draws one or more reference lines perpendicular to the horizontal axis at points that
are specified by value-list. For a description of value-list see the HAXIS= on page
1108 option for the PLOT statement. To specify colors for these reference lines, use
the CHREF= option. To specify line types for these reference lines, use the LHREF=
option. To specify labels for these reference lines, use the HAXIS= option.
1096 BUBBLE Statement Chapter 37
HREVERSE
specifies that the order of the values on the horizontal axis be reversed. For Web
output that is generated with a Java device driver, the horizontal axis data must be
numeric.
Not supported by: Java (partial)
HZERO
specifies that tick marks on the horizontal axis begin in the first position with a
value of zero. The HZERO request is ignored if negative values are present for the
horizontal variable or if the horizontal axis has been specified with the HAXIS=
option.
IFRAME=fileref | ’external-file’
identifies the image file you wish to apply to the backplane of the plot. See also the
IMAGESTYLE= option and “Placing a Backplane Image on Graphs with Frames” on
page 115. The IFRAME= option is overridden by the NOIMAGEPRINT
goption“IMAGEPRINT” on page 318.
Not supported by: Java
IMAGESTYLE= TILE | FIT
specifies whether to tile the image to fill the backplane or to stretch the image to fit
the backplane. The TILE value is the default. See also the IFRAME= option.
LAUTOHREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the horizontal
axis, as specified by the AUTOHREF option. The reference-line-type value can be a
whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46
specify dashed lines. The default value 1 draws a solid line. To specify colors for
these reference lines, use the CAUTOHREF= option. To specify labels for these
reference lines, use the HAXIS= option.
LAUTOVREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the vertical
axis, as specified by the AUTOVREF option. The reference-line-type value can be a
whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46
specify dashed lines. The default value 1 draws a solid line. To specify colors for
these reference lines, use the CAUTOVREF= option. To specify labels for these
reference lines, use the VAXIS= option.
LHREF=reference-line-type | (reference-line-type) | reference-line-type-list
LH=reference-line-type | (reference-line-type) | reference-line-type-list
specifies line types for reference lines drawn perpendicular to the horizontal axis.
The reference-line-type value can be a whole number from 1 to 46. A value of 1
specifies a solid line; values 2 through 46 specify dashed lines. This option affects
reference lines drawn with the AUTOHREF, HREF, and GRID options. Specifying a
single line type without parentheses applies that line type to all reference lines. The
LAUTOHREF= option overrides the LHREF= option for lines drawn with the
AUTOHREF option. Specifying a single line type in parentheses applies that line
type only to the first line drawn with the HREF= option. Specifying a line-type list
applies line types in sequence to successive reference lines drawn with the HREF=
option. The syntax of the line type list is of the form (type1 type2... typeN). The
default value 1 draws a solid line. To specify colors for these references lines, use the
CHREF= option. To specify labels for these reference lines, use the HAXIS= option.
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
LV=reference-line-type | (reference-line-type) | reference-line-type-list
specifies line types for reference lines drawn perpendicular to the vertical axis. The
reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a
The GPLOT Procedure BUBBLE Statement 1097
solid line; values 2 through 46 specify dashed lines. This option affects reference
lines drawn with the AUTOVREF, VREF, and GRID options. Specifying a single line
type without parentheses applies that line type to all reference lines. The
LAUTOVREF= option overrides the LVREF= option for lines drawn with the
AUTOVREF option. Specifying a single line type in parentheses applies that line
type only to the first line drawn by the VREF= option. Specifying a line-type list
applies line types in sequence to successive reference lines drawn with the VREF=
option. The syntax of the line type list is of the form (type1 type2... typeN). The
default value 1 draws a solid line. To specify colors for these references lines, use the
CVREF= option. To specify labels for these reference lines, use the VAXIS= option.
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GPLOT. If you specify
DEVICE=ACTIXIMG or DEVICE=JAVAIMG, then the name that you specify will be
used for the Java or ActiveX device driver image output even in the file exists. For
all other devices, if the name duplicates an existing entry name, SAS/GRAPH adds a
number to the duplicate name to create a unique entry, for example, GPLOT1.
NOAXIS
NOAXES
suppresses the axes, including axis lines, axis labels, all major and minor tick marks,
and tick mark values.
VAXIS=value-list | AXIS<1...99>
specifies the major tick mark values for the vertical axis or assigns an axis definition.
For a description of the value-list, see the HAXIS= option on page 1108 of the PLOT
statement. To assign labels to reference lines, specify an axis definition that contains
the REFLABEL= option. Labels will be applied in sequence to all reference lines
defined with the AUTOVREF and VREF= options.
For Web output that is generated with a Java or ActiveX device driver, certain
options of the AXIS statement are not supported. For details, see “AXIS Statement”
on page 124.
Featured in: Example 2 on page 1122 and Example 3 on page 1124.
Not supported by: Java (partial), ActiveX (partial)
VMINOR=number-of-minor-ticks
VM=number-of-minor-ticks
specifies the number of minor tick marks that are drawn between each major tick
mark on the vertical axis. Minor tick marks are not labeled. VMINOR= overrides the
NUMBER= suboption of the MINOR= option in an AXIS definition. You must specify
a positive number.
Featured in: Example 2 on page 1122.
VREF=value-list
draws one or more reference lines perpendicular to the vertical axis at points that
are specified by value-list. For a description of the value-list, see the HAXIS= option
on page 1108 of the PLOT statement. To specify colors for reference lines, use the
CVREF= option. To specify line types for these reference lines, use the LVREF=
option. To specify labels for these reference lines, use the VAXIS= option.
VREVERSE
specifies that the order of the values on the vertical axis should be reversed.
VZERO
specifies that tick marks on the vertical axis begin in the first position with a zero.
The VZERO request is ignored if the vertical variable either contains negative values
1098 BUBBLE2 Statement Chapter 37
or has been ordered with the VAXIS= option or the ORDER= option in an AXIS
statement.
BUBBLE2 Statement
Creates a second vertical axis on the right side of a graph produced by an accompanying BUBBLE
or PLOT statement. A second variable can be plotted against this axis.
Requirements: You cannot use the BUBBLE2 statement alone. You can use it only with
a BUBBLE or PLOT statement. At least one plot request is required.
AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
Global statements:
FOOTNOTE, and NOTE Statements” on page 210, TITLE“TITLE, FOOTNOTE, and
NOTE Statements” on page 210
Description
The BUBBLE2 statement specifies one or more plot requests that name the horizontal
and right vertical axis variables and the variable that controls the size of the bubbles.
This statement automatically
3 scales the axes to include the maximum and minimum data values
3 labels each axis with the name of its variable or an associated label
3 displays each major tick mark value
3 draws circles for values that are located within the axes.
You can use statement options to control right vertical axis scaling, draw reference
lines on the right vertical axis, control the display of the bubbles, display a background
color or image, and specify annotation.
In addition, you can use global statements to modify the axes (AXIS statement), and
add text to the graph (TITLE, NOTE, and FOOTNOTE statements). You can also use
the Annotate data set to enhance the plot.
Syntax
BUBBLE2 plot-request(s) < /option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 bubble appearance options:
The GPLOT Procedure BUBBLE2 Statement 1099
BCOLOR=bubble-color
BFONT=font
BLABEL
BSCALE=AREA | RADIUS
BSIZE=multiplier
3 plot appearance options:
ANNOTATE=Annotate-data-set
CAXIS=axis-color
CFRAME=background-color
CTEXT=text-color
FRAME | NOFRAME
GRID
NOAXIS | NOAXES
3 vertical axis options:
AUTOVREF
CAUTOVREF=reference-line-color
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
LAUTOVREF=reference-line-type
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
VAXIS=value-list | AXIS<1...99>
VMINOR=number-of-minor ticks
VREF=value-list
VREVERSE
VZERO
Required Arguments
plot-request(s)
each specifies the variables to plot and produces a separate graph. All variables must
be in the input data set. Multiple plot requests are separated with blanks. A plot
request must have this form:
y-variable*x-variable=bubble-size
plots the values of two variables and draws a circle (bubble) at each data point.
The value of the third variable determines the size of the bubble. All variables
must be in the input data set.
y-variable
variable plotted on the right vertical axis; typically it is different from y-variable
in the accompanying BUBBLE or PLOT statement.
x-variable
variable plotted on the horizontal axis; it is the same as x-variable in the
accompanying BUBBLE or PLOT statement.
bubble-size
variable that dictates the size of the bubbles. Bubble-size must be numeric. If
the value of bubble-size is positive, bubbles are drawn with a solid line; if it is
negative, bubbles are drawn with a dashed line.
1100 BUBBLE2 Statement Chapter 37
Options
Options for the BUBBLE2 statement are identical to those for the BUBBLE
statement except for these options, which are ignored if specified:
AUTOHREF
CAUTOHREF=
CHREF=
DESCRIPTION=
HAXIS=
HMINOR=
HREF=
HZERO=
IFRAME=
IMAGESTYLE =
LAUTOHREF=
LHREF=
NAME=
See “BUBBLE Statement” on page 1090 for complete descriptions of options used
with the BUBBLE2 statement.
These plot requests generate a plot in which both sets of bubbles have the same
value (size) but different locations on the graph.
3 The vertical axis variables are the same, Y, but the bubble size variables, S and
S2, are different:
bubble y*x=s;
bubble2 y*x=s2;
The resulting plot has two identical vertical axes and two sets of concentric
bubbles of different sizes.
3 Both the vertical axis variables, Y and Y2, and the bubble size variables, S and S2,
are different:
bubble y*x=s;
bubble2 y2*x=s2;
These plot requests produce the equivalent of an overlay plot in which two
different sets of bubbles plotted against different vertical axes are displayed on the
same graph.
The GPLOT Procedure PLOT Statement 1101
The plot requests on the BUBBLE and BUBBLE2 statements must be evenly
matched, for example:
bubble y*x=s b*a=c;
bubble2 y2*x=s b2*a=c2;
These statements produce two graphs each with two vertical axes. The first pair of
plot requests (Y*X=S and Y2*X=S) produce one graph in which the variable X is plotted
on the horizontal axis, the variable Y is plotted on the left axis, and the variable Y2 is
plotted on the right axis. In this pair, the value of S is the same for both requests. The
second pair of plot requests (B*A=C and B2*A=C2) produce another graph in which the
variable A is plotted on the horizontal axis, the variable B is plotted on the left axis,
and the variable B2 is plotted on the right axis.
Any modifications to horizontal axes specifications must be identical for both
statements; if they are different, the BUBBLE2 axis specification is ignored.
If the scale of values for the left and right vertical axes is the same and you want
both axes to represent the same range of values, specify the range with a VAXIS=
option in both the BUBBLE and BUBBLE2 statements.
PLOT Statement
Creates plots in which one variable is plotted on the horizontal axis and a second variable is
plotted on the left vertical axis.
Requirements: At least one plot request is required.
Global statements: AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
FOOTNOTE, and NOTE Statements” on page 210, LEGEND“LEGEND Statement” on
page 151, PATTERN“PATTERN Statement” on page 169, SYMBOL“SYMBOL
Statement” on page 183, TITLE“TITLE, FOOTNOTE, and NOTE Statements” on page
210
Supports: Drill-down functionality
Description
The PLOT statement specifies one or more plot requests that name the horizontal and
left vertical axis variables, and optionally a third classification variable. This statement
automatically
3 scales the axes to include the maximum and minimum data values
3 plots data points within the axes
3 labels each axis with the name of its variable and displays each major tick mark
value.
You can use statement options to manipulate the axes, modify the appearance of your
graph, and describe catalog entries. You can use SYMBOL definitions to modify plot
symbols for the data points, join data points, draw regression lines, plot confidence
limits, or specify other types of interpolations. For more information on the SYMBOL
statement, see “About SYMBOL Definitions” on page 1114.
In addition, you can use global statements to modify the axes; add titles, footnotes,
and notes to the plot; or modify the legend if one is generated by the plot. You can also
use an Annotate data set to enhance the plot.
Syntax
PLOT plot-request(s) </option(s)>;
1102 PLOT Statement Chapter 37
option(s) can be one or more options from any or all of the following categories:
3 plot options:
AREAS=n
GRID
LEGEND | LEGEND=LEGEND<1...99>
NOLEGEND
OVERLAY
REGEQN
SKIPMISS
3 appearance options:
ANNOTATE=Annotate-data-set
CAXIS=axis-color
CFRAME=background-color
COUTLINE=outline-color
CTEXT=text-color
FRAME | NOFRAME
HREVERSE
IFRAME= fileref | ’external-file’
IMAGESTYLE = TILE | FIT
NOAXIS | NOAXES
3 horizontal axis options:
AUTOHREF
CAUTOHREF=reference-line-color
CHREF=reference-line-color | (reference-line-color) | reference-line-color-list
HAXIS=value-list | AXIS<1...99>
HMINOR=number-of-minor-ticks
HREF=value-list
HZERO
LAUTOHREF=reference-line-type
LHREF=reference-line-type | (reference-line-type) | reference-line-type-list
3 vertical axis options:
AUTOVREF
CAUTOVREF=reference-line-color
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
LAUTOVREF=reference-line-type
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
VAXIS=value-list | AXIS<1...99>
VMINOR=number-of-minor-ticks
VREF=value-list
VREVERSE
VZERO
3 catalog entry description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
3 ODS options:
The GPLOT Procedure PLOT Statement 1103
HTML=variable
HTML_LEGEND=variable
Required Arguments
plot-request(s)
each specifies the variables to plot and produces a separate graph, unless you specify
OVERLAY. All variables must be in the input data set. Multiple plot requests are
separated with blanks. You can plot character or numeric variables. A plot request
can be any of these:
y-variable*x-variable<=n>
plots the values of two variables and, optionally, assigns a SYMBOL definition to
the plot.
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
n
number of the nth generated SYMBOL definition.
Note: The nth generated SYMBOL definition is not necessarily the same as the
nth SYMBOL statement. Plot requests of the form y-variable*x-variable=n assign
the SYMBOL definition that is designated by n to the plot that is produced by
y-variable*x-variable. For more information, see “About Plot Requests that Assign
a SYMBOL Definition” on page 1114. 4
(y-variable(s))*(x-variable(s))
plots the values of two or more variables and produces a separate graph for each
combination of Y and X variables. That is, each Y*X pair is plotted on a separate
set of axes, unless you specify OVERLAY.
y-variable(s)
variables plotted on the left vertical axes.
x-variable(s)
variables plotted on the horizontal axes.
If you use only one y-variable or only one x-variable, omit the parentheses for
that variable, for example,
plot (temp rain)*month;
This plot request produces two plots, one of TEMP and MONTH and one of
RAIN and MONTH.
y-variable*x-variable=third-variable
plots the values of two variables against a third classification variable
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
1104 PLOT Statement Chapter 37
third-variable
classification variable against which y-variable and x-variable are plotted.
Third-variable can be character or numeric, but numeric variables should
contain discrete rather than continuous values, or should be formatted to
provide discrete values.
A separate plot (set of data points) is produced for each unique value of
third-variable; all plots are drawn on the same set of axes, and a legend is
automatically generated to show the plot symbol and color for each value of the
classification variable.
Note: If a BY statement is used to produce multiple plots, you can make the
legend the same across graphs by specifying the UNIFORM option in the PROC
GPLOT statement. 4
The following plot request produces a graph with a plot line for each
department and a legend that shows the plot symbol for each department:
plot sales*weekday=dept;
Options
Options in a PLOT statement affect all graphs that are produced by that statement.
You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate plots that are produced by the PLOT statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
AREAS=n
fills all the areas below plot line n with a pattern. The value of n specifies which
areas to fill:
3 AREAS=1 fills the first area.
3 AREAS=2 fills both the first and second areas, and so forth.
If you specify a value for AREAS= that is greater than the number of bounded
areas in the plot, the area between the top plot line and the axis frame is filled.
Before an area can be filled, the data points that border the area must be joined by
a line. Use a SYMBOL statement with one of these interpolation methods to join the
data points:
INTERPOL=JOIN
INTERPOL=STEP
INTERPOL=Rseries
INTERPOL=SPLINE | SM | L
See “SYMBOL Statement” on page 183 for details on interpolation methods.
By default, the AREAS= option fills areas by rotating a solid pattern through the
colors list, starting with the first color in the list. If it needs more patterns, it rotates
hatch patterns, beginning with the M2N0 pattern. See “PATTERN Statement” on
page 169 for more information on map/plot patterns. However, if the V6COMP
graphics option is in effect, or if color is limited to a single color with the
The GPLOT Procedure PLOT Statement 1105
CPATTERN= or COLORS= graphic options, the solid pattern is skipped and the first
default pattern is M2N0. If the COLORS= graphic option specifies a single color, use
as many SYMBOL statements as you have areas to fill in the plot because the
INTERPOL= setting does not automatically apply to multiple symbol definitions.
Note: If your device’s default colors list is in effect and the first color in the list is
black, color rotation begins with the second color in the list (no solid black patterns),
unless the V6COMP graphics option is in effect. See “How Default Patterns and
Outlines Are Generated” on page 178 for more information. 4
You can alter the default pattern behavior by specifying patterns and colors on
PATTERN statements that specify map and plot patterns. A separate PATTERN
definition is needed for each specified area.
If you specify PATTERN statements, AREAS= uses the lowest numbered
PATTERN statement first. If it runs out of patterns, it uses the default behavior for
map and plot patterns. See “PATTERN Statement” on page 169 for details.
Pattern definitions are assigned to the areas below the plot lines in the order the
plots are drawn. The first area is that between the horizontal axis and the plot line
that is drawn first. The second area is that above the first plot line and below the
plot line that is drawn second, and so forth. If the line that is drawn second lies
below the line that is drawn first, the second area is hidden when the first is filled.
The plots with the lower line values must be drawn first to prevent one area fill from
overlaying another. If the lines cross, only the part of an area that is above the
previous line is visible.
Therefore, if you produce multiple plots by submitting multiple plot requests and
using the OVERLAY option, the plot requests must be ordered in the PLOT
statement so that the plot request that produces the lowest line values is the first
(leftmost) plot request, the plot request that produces the next lowest line values is
the second plot request, and so on.
If you produce multiple plots with a y-variable*x-variable=third-variable plot
request, the lines are plotted in order of increasing third variable values. Therefore,
the data must be recoded so that the lowest value of the third variable produces the
lowest plot line, the next lowest value produces the next lowest plot line, and so on.
AREAS= works only if all plot lines are generated by the same PLOT or PLOT2
statement.
If you use the VALUE= option in the SYMBOL statement, some symbols may be
hidden. If reference lines are also specified with AREAS=, they are drawn behind the
pattern fill.
Featured in: Example 7 on page 1134.
AUTOHREF
draws reference lines at all major tick marks on the horizontal axis. If the AREAS=
option is also used, the filled areas cover the reference lines. To draw lines on top of
the filled areas, use the ANNOTATE= option in either the PROC GPLOT statement
or the PLOT statement. To specify line types for these reference lines, use the
LAUTOHREF= option. To specify colors for these reference lines, use the
CAUTOHREF= option. To specify labels for these reference lines, use the HAXIS=
option.
AUTOVREF
draws reference lines at all of the major tick marks on the vertical axis. If you also
use the AREAS= option, the filled areas cover the reference lines. To draw lines on
top of the filled areas, use the ANNOTATE= option in either the PROC GPLOT
statement or the PLOT statement. To specify line types for these reference lines, use
the LAUTOVREF= option. To specify colors for these reference lines, use the
CAUTOVREF= option. To specify labels for these reference lines, use the VAXIS=
option.
1106 PLOT Statement Chapter 37
CAUTOHREF=reference-line-color
specifies colors for reference lines drawn at major tick marks on the horizontal axis,
as specified by the AUTOHREF option. The default color is either the value of the
CAXIS= option or the first color in the color list. To specify line types for these
reference lines, use the LAUTOHREF= option. To specify labels for these reference
lines, use the HAXIS= option.
CAUTOVREF=reference-line-color
specifies colors for reference lines drawn at major tick marks on the vertical axis, as
specified by the AUTOVREF option. The default color is either the value of the
CAXIS= option or the first color in the color list. To specify line types for these
reference lines, use the LAUTOVREF= option. To specify labels for these reference
lines, use the VAXIS= option.
CAXIS=axis-color
CA=axis-color
specifies the color for the axis line and all major and minor tick marks. By default,
the procedure uses the first color in the colors list.
If you use the CAXIS= option, it may be overridden by
3 the COLOR= option in an AXIS definition, which in turn is overridden by
3 the COLOR= suboption of the MAJOR= or MINOR= option in an AXIS
definition for major and minor tick marks.
Featured in: Example 5 on page 1129.
CFRAME=background-color
CFR=background-color
fills the axis area with the specified color. If the FRAME option is also in effect, the
procedure determines the color of the frame according to the precedence list given
later in the FRAME option description. If the IFRAME= option is in effect, an image
will appear in the background instead of the color.
CHREF=reference-line-color | (reference-line-color) | reference-line-color-list
CH=reference-line-color | (reference-line-color) | reference-line-color-list
specifies the color of reference lines drawn perpendicular to the horizontal axis. This
option affects reference lines drawn with the AUTOHREF, HREF, and GRID options.
Specifying a single color without parentheses applies that color to all reference lines.
The CAUTOHREF= option overrides the CHREF= option for reference lines drawn
with the AUTOHREF option. Specifying a single color in parentheses applies that
color only to the first reference line drawn with the HREF= option. Specifying a color
list applies colors sequentially to successive reference lines drawn with the HREF=
option. The syntax of the color list is of the form (color1 color2 ...colorN) or (color1,
color2, ...colorN). The default color for reference lines is determined by the CAXIS=
option or by the first color in the color list. To specify line types for these reference
lines, use the LHREF= option. To specify labels for these reference lines, use the
HAXIS= option.
COUTLINE=outline-color
specifies the color of the outline that is drawn around filled areas. The filled areas
are generated when the SYMBOL statement or GOPTIONS statement specifies
INTERPOL on page 191=map/plot-pattern. The default outline color is black for
ActiveX devices. Otherwise, the default color is the first color in the colors list. The
COUTLINE= option cannot be used with the PATTERN statement. The
COUTLINE= option overrides the SYMBOL statement option CO=.
Not supported by: Java
CTEXT=text-color
C=text-color
The GPLOT Procedure PLOT Statement 1107
specifies the color for all text on the axes, including tick mark values and axis labels.
If the PLOT request generates a legend, the CTEXT= option also colors the legend
label and the value descriptions.
If you omit the CTEXT= option, a color specification is searched for in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
If you use the CTEXT= option, it overrides the color specification for the axis label
and the tick mark values in the COLOR= option in an AXIS definition that is
assigned to the axis.
If you use the CTEXT= option, the color specification is overridden in one or more
of these situations:
3 If you also use the COLOR= suboption of a LABEL= or VALUE= option in a
AXIS definition that is assigned to the axis, that suboption determines the color
of the axis label or the color of the tick mark values, respectively.
3 If you also use the COLOR= suboption of a LABEL= or VALUE= option in a
LEGEND definition that is assigned to the legend, it determines the color of the
legend label or the color of the legend value descriptions, respectively.
Featured in: Example 5 on page 1129
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
CV=reference-line-color | (reference-line-color) | reference-line-color-list
specifies the color of reference lines drawn perpendicular to the vertical axis.
Specifying a single color without parentheses applies that color to reference lines
drawn with the AUTOVREF and VREF= options. The CAUTOVREF= option
overrides the CVREF= option for reference lines drawn with the AUTOVREF option.
Specifying a single color in parentheses applies that color only to the first reference
line drawn with the VREF= option. Specifying a color list applies colors sequentially
to successive reference lines drawn with the VREF= option. The syntax of the color
list is of the form (color1 color2 ...colorN) or (color1, color2, ...colorN). The default
color for reference lines is determined by the CAXIS= option or by the first color in
the color list. To specify line types for these reference lines, use the LVREF= option.
To specify labels for these reference lines, use the VAXIS= option.
For needle plots that are generated with a Java or ActiveX device driver, the value
of the CVREF= option is not applied to the default reference line that is drawn at
zero when the minimum value of the vertical axis is less than zero. The color of this
line is the first color in the color list, which is black by default.
Featured in: Example 5 on page 1129
Not supported by: Java (partial), ActiveX (partial)
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the plot. The maximum length for
entry-description is 256 characters. The description does not appear on the plot. By
default, the procedure assigns a description of the form PLOT OF
y-variable*x-variable, where y-variable and x-variable are the names of the plot
variables.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. For more information refer to the description of the text-string on
page 222 option and the section that discusses “Substituting BY Line Values in a
Text String” on page 226. The 256-character limit applies before the substitution
takes place for these options; thus, if in the SAS program the entry-description text
exceeds 256 characters, it is truncated to 256 characters, and then the substitution is
performed.
1108 PLOT Statement Chapter 37
The descriptive text is shown in the "description" portion of each of the following:
3 in the Results window
3 among the catalog-entry properties that you can view from the Explorer window
3 in the Table of Contents that is generated when you use the CONTENTS=
option on an ODS statement. This assumes that the GPLOT output is
generated while the contents page is open. See “Linking to Output through a
Table of Contents” on page 495.
3 in the Description field of the PROC GREPLAY window
FRAME | NOFRAME
FR | NOFR
specifies whether a frame is drawn around the axis area. The default is FRAME;
however, if the V6COMP option is in effect on the GOPTIONS statement, the default
is NOFRAME. If you also use a BUBBLE2 or PLOT2 statement and your plotting
statements have conflicting frame specifications, FRAME is used.
For the frame color, a specification is searched for in this order:
1 the CAXIS= option
2 the COLOR= option in the AXIS definition assigned to the vertical axis
3 the COLOR= option in the AXIS definition assigned to the horizontal axis
4 the default, the first color in the colors list.
To fill the axis area with a background color, use the CFRAME= option.
To fill the axis area with a background image, use the IFRAME= option.
GRID
draws reference lines at all major tick marks on both axes. You get the same result
when you use all of these options in a PLOT statement: AUTOHREF, AUTOVREF,
FRAME, LVREF=34, and LHREF=34. The line type for GRID is 34. The line color is
the color of the axis. When specified in a PLOT2 statement, the reference lines are
drawn on the vertical axis on the right side of the plot.
HAXIS=value-list | AXIS<1 . . . 99>
specifies major tick mark values for the horizontal axis or assigns an axis definition.
By default, the procedure scales the axis and provides an appropriate number of tick
marks. To assign labels to reference lines, use an axis definition that contains the
REFLABEL= option. The labels will be applied in sequence to all reference lines
defined with the AUTOHREF and HREF= options.
The way you specify value-list depends on the type of variable:
3 For numeric variables, value-list is either an explicit list of values, or a starting
and an ending value with an interval increment, or a combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
If a numeric variable has an associated format, the specified values must be
the unformatted values.
3 For date-time values, value-list includes any SAS date, time, or datetime value
described for the SAS functions INTCK and INTNX, shown here as SAS-value:
’SAS-value’i < ...’SAS-value’i>
’SAS-value’i TO ’SAS-value’ i<BY interval>
3 For character variables, value-list is a list of unique character values enclosed in
quotation marks and separated by blanks:
’value-1’ < ...’value-n’>
The GPLOT Procedure PLOT Statement 1109
NAME= ’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GPLOT. If you specify
DEVICE=ACTIXIMG or DEVICE=JAVAIMG, then the name that you specify will be
used for the Java or ActiveX device driver image output even in the file exists. For
all other devices, if the name duplicates an existing entry name, SAS/GRAPH adds a
number to the duplicate name to create a unique entry, for example, GPLOT1.
NOAXIS
NOAXES
suppresses the axes, including axis lines, axis labels, all major and minor tick marks,
and tick mark values.
NOLEGEND
suppresses the legend that is generated by a plot request of the type
y-variable*x-variable=third-variable.
OVERLAY
places all the plots that are generated by the PLOT statement on one set of axes.
The axes are scaled to include the minimum and maximum values of all of the
1112 PLOT Statement Chapter 37
variables, and the variable names or labels associated with the first pair of variables
label the axes.
The OVERLAY option produces a legend if you include the LEGEND or the
LEGEND=n option in the PLOT statement.
OVERLAY is not enabled with plot requests of the form
y-variable*x-variable=third-variable. However, you can achieve an overlay effect by
using a PLOT and PLOT2 statement.
When generating output for the Web with the JAVA, JAVAMETA, or JAVAIMG
device drivers, the OVERLAY option cannot be used in the PLOT statement in
combination with the global statement SYMBOL. This applies only when the
SYMBOL statement uses the INTERPOL= option, and when the INTERPOL= option
has the values BOX, HILO, or STD. For Java output using the PLOT2 statement,
INTERPOL=BOX|HILO|STD cannot be used in a SYMBOL statement, with or
without the OVERLAY option.
Featured in: Example 6 on page 1131 and Example 7 on page 1134.
Not supported by: Java (partial)
REGEQN
displays the regression equation that is specified in the INTERPOL= option of the
SYMBOL statement in the lower left hand corner of the plot. You cannot modify the
format that is used for the equation.
The GPLOT regression equation is computed from the screen coordinates of the
markers. Therefore, a graph might not display if the chart area for the plot becomes
so small that markers cannot be drawn because there are no coordinates from which
to build the regression equation. In such cases, the regression equation is no longer
meaningful.
Featured in: Example 4 on page 1126.
Not supported by: Java, ActiveX
SKIPMISS
breaks a plot line or an area fill at occurrences of missing values of the Y variable.
By default, plot lines and area fills are not broken at missing values. SKIPMISS is
available only with JOIN interpolation. If SKIPMISS is used, observations should be
sorted by the independent (horizontal axis) variable. If the plot request is
y-variable*x-variable=third-variable, observations should also be sorted by the values
of the third variable.
See also: “About the Input Data Set” on page 1086.
VAXIS=value-list | AXIS<1...99>
specifies the major tick mark values for the vertical axis or assigns an axis definition.
See the HAXIS= option for a description of the value-list. To assign labels to
reference lines, use an axis definition that contains the REFLABEL= option. The
labels will be applied in sequence to all reference lines defined with the AUTOVREF
and VREF= options.
For Web output that is generated with a Java or ActiveX device driver, certain
options of the AXIS statement are not supported. For details, see “AXIS Statement”
on page 124.
Featured in: Example 4 on page 1126 and Example 5 on page 1129.
Not supported by: Java (partial), ActiveX (partial)
VMINOR=number-of-minor-ticks
VM=number-of-minor-ticks
specifies the number of minor tick marks that are drawn between each major tick
mark on the vertical axis. Minor tick marks are not labeled. The VMINOR= option
overrides the NUMBER= suboption of the MINOR= option in an AXIS definition. You
must specify a positive number.
The GPLOT Procedure PLOT Statement 1113
VREF=value-list
draws one or more reference lines perpendicular to the vertical axis at points that are
specified by the value-list . See the HAXIS= option for a description of the value-list.
If the AREAS= option is also used, the filled areas cover the reference lines. To draw
lines on top of the filled areas, use the ANNOTATE= option in either the PROC
GPLOT statement or the PLOT statement. To specify colors for these reference lines,
use the CVREF= option. To specify line types for these reference lines, use the
LVREF= option. To specify labels for these reference lines, use the VAXIS= option.
Featured in: Example 5 on page 1129.
VREVERSE
specifies that the order of the values on the vertical axis be reversed.
VZERO
specifies that tick marks on the vertical axis begin in the first position with a zero.
The VZERO request is ignored if the vertical variable either contains negative values
or has been ordered with the VAXIS= option or the ORDER= option in an AXIS
statement.
The procedure assigns the first generated SYMBOL definition to Y*X, the second
generated SYMBOL definition to B*A, and the third to S*R.
If more SYMBOL definitions are needed than have been defined, the procedure uses
the default definitions for the plots that remain.
See “SYMBOL Statement” on page 183.
PLOT2 Statement
Produces one or more plots with the vertical axis on the right side of the graph against which a
second variable can be plotted.
Requirements: You cannot use the PLOT2 statement alone. It can be used only with a
PLOT or BUBBLE statement. At least one plot request is required.
Global statements: AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
FOOTNOTE, and NOTE Statements” on page 210, LEGEND“LEGEND Statement” on
page 151, PATTERN“PATTERN Statement” on page 169, SYMBOL“SYMBOL
Statement” on page 183, TITLE“TITLE, FOOTNOTE, and NOTE Statements” on page
210
Description
The PLOT2 statement specifies one or more plot requests that name the horizontal and
right vertical axis variables. This statement automatically
3 plots data points within the axes
3 scales the axes to include the maximum and minimum data values
3 labels each axis with the name of its variable and displays each major tick mark
value.
You can use statement options to manipulate the axes and modify the appearance of
your graph. You can use SYMBOL definitions to modify plot symbols for the data
points, join data points, draw regression lines, plot confidence limits, or specify other
types of interpolation. For more information on the SYMBOL statement see “About
SYMBOL Definitions” on page 1114.
Note: When using PLOT2 to generate output with the JAVA or ACTIVEX device
drivers, and when the global statement SYMBOL is used, the value of the SYMBOL
statement option INTERPOL= cannot be BOX, STD, or HILO. 4
In addition, you can use global statements to modify the axes; add titles, footnotes,
and notes to the plot; or modify the legend if one is generated by the plot. You can also
use an Annotate data set to enhance the plot.
Syntax
PLOT2 plot-request(s) < /option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 plot options:
AREAS=n
GRID
LEGEND | LEGEND=LEGEND<1...99>
NOLEGEND
OVERLAY
REGEQN
SKIPMISS
3 appearance options:
ANNOTATE=Annotate-data-set
1116 PLOT2 Statement Chapter 37
CAXIS=axis-color
CFRAME=background-color
COUTLINE=outline-color
CTEXT=text-color
FRAME | NOFRAME
NOAXIS | NOAXES
3 vertical axis options:
AUTOVREF
CAUTOVREF=reference-line-color
CVREF=reference-line-color | (reference-line-color) | reference-line-color-list
HREVERSE
LAUTOVREF=reference-line-type
LVREF=reference-line-type | (reference-line-type) | reference-line-type-list
VAXIS=value-list | AXIS<1...99>
VMINOR=n
VREF=value-list
VREVERSE
VZERO
3 ODS options:
HTML=variable
HTML_LEGEND=variable
Required Arguments
plot-request(s)
each specifies the variables to plot and produces a separate graph, unless you specify
OVERLAY. All variables must be in the input data set. Multiple plot requests are
separated with blanks. A plot request can be any of these:
y-variable*x-variable<=n>
plots the values of two variables and, optionally, assigns a SYMBOL definition to
the plot.
y-variable
variable plotted on the right vertical axis.
x-variable
variable plotted on the horizontal axis.
n
number of the nth generated SYMBOL definition.
(y-variable(s))*(x-variable(s))
plots the values of two or more variable and produces a separate graph for each
combination of Y and X variables.
y-variable(s)
variables plotted on the right vertical axes.
x-variable(s)
variables plotted on the horizontal axes.
The GPLOT Procedure PLOT2 Statement 1117
y-variable*x-variable=third-variable
plots the values of two variables against a third classification variable
y-variable
variable plotted on the right vertical axis.
x-variable
variable plotted on the horizontal axis.
third-variable
classification variable against which y-variable and x-variable are plotted.
Third-variable can be character or numeric, but numeric variables should
contain discrete rather than continuous values, or should be formatted to
provide discrete values.
For more information about plot requests, see “PLOT Statement” on page 1101.
In a PLOT2 plot request, the X variable for the horizontal axis must be the same
as in the accompanying PLOT or BUBBLE statement. Typically, the Y variable for
the right vertical axis is different.
Use the same types of plot requests with a PLOT2 statement that you use with a
PLOT statement, but a PLOT2 statement always plots the values of y-variable on the
right vertical axis.
Options
Options for the PLOT2 statement are identical to those for the PLOT statement
except for these options, which are ignored if you specify them:
AUTOHREF
CAUTOHREF=
CHREF=
DESCRIPTION=
HAXIS=
HMINOR=
HREF=
HZERO=
IFRAME=
IMAGESTYLE =
LAUTOHREF=
LHREF=
NAME=
See “PLOT Statement” on page 1101 for descriptions of options that you can use with
the PLOT2 statement.
These statements produce two graphs, each with two vertical axes. The first pair of
plot requests (Y*X and Y2*X) produce one graph in which X is plotted on the horizontal
axis, Y is plotted on the left axis, and Y2 is plotted on the right axis. The second pair of
1118 PLOT2 Statement Chapter 37
plot requests (B*A and B2*A) produce another graph in which A is plotted on the
horizontal axis, B is plotted on the left axis, and B2 is plotted on the right axis.
Figure 37.8 Diagram of Graphs Produced by Multiple Plot Requests in PLOT and
PLOT2 Statements
For plots such as these, the PLOT2 statement should use a SYMBOL statement that
specifies INTERPOL=NONE and VALUE=NONE.
Figure 37.11 Right Axis with Different Values and Different Scale
To scale both axes the same, specify the same range of values either with the VAXIS=
option in both the PLOT and PLOT2 statements, or with AXIS statements.
Examples
This example shows a bubble plot in which each bubble represents a category of
engineer. The plot shows engineers on the horizontal axis and average salaries on the
vertical axis. Each bubble’s vertical location is determined by the average salary for the
category. Each bubble’s size is determined by the number of engineers in the category:
the more engineers, the larger the bubble.
Create the data set. The data set JOBS contains average salary data for several categories of
engineer. It also indicates the number of engineers in each category.
data jobs;
length eng $5;
1122 Example 2: Labeling and Sizing Plot Bubbles Chapter 37
Define axis characteristics. OFFSET= specifies an offset for the tick marks so that bubbles
near an axis are not clipped.
axis1 offset=(5,5);
Generate bubble plot. HAXIS= assigns the AXIS1 statement to the horizontal axis. The
salary averages are assigned a dollar format.
proc gplot data=jobs;
format dollars dollar9.;
bubble dollars*eng=num / haxis=axis1;
run;
quit;
This example modifies the code in Example 1. It shows how BUBBLE statement
options control the appearance of bubbles and their labels. It also shows how AXIS
statements can modify the plot axes.
Define axis characteristics. AXIS1 suppresses the horizontal axis label and uses OFFSET= to
move the first and last major tick mark values away from the vertical axes so bubbles are not
clipped. AXIS2 uses ORDER= to set major tick mark intervals. This could be done with VAXIS=
on the BUBBLE statement, but then you could not suppress the axis label and alter other axis
characteristics.
axis1 label=none
offset=(5,5)
width=3
1124 Example 3: Adding a Right Vertical Axis Chapter 37
value=(height=4);
axis2 order=(0 to 40000 by 10000)
label=none
major=(height=1.5)
minor=(height=1)
width=3
value=(height=4);
Generate bubble plot. VMINOR= specifies one minor tick mark for the vertical axis.
BCOLOR= colors the bubbles. BLABEL labels each bubble with the value of variable NUM, and
BFONT= specifies the font for labeling text. BSIZE= increases the bubble sizes by increasing
the scaling factor size to 12. CAXIS= colors the axis lines and all major and minor tick marks.
proc gplot data=jobs;
format dollars dollar9. num comma7.0;
bubble dollars*eng=num / haxis=axis1
vaxis=axis2
vminor=1
bcolor=red
blabel
bfont=swissi
bsize=12
caxis=blue;
run;
quit;
This example modifies Example 2 on page 1122 to show how a BUBBLE2 statement
generates a right vertical axis that displays the values of the vertical coordinates in a
different scale from the scale that is used for the left vertical axis. Salary values are
scaled by dollars on the left vertical axis and by yen on the right vertical axis.
BUBBLE and BUBBLE2 statement options control the size and appearance of the
bubbles and their labels. In particular, the VAXIS options calibrate the axes so that the
data points are identical and only one set of bubbles appears.
Note: If the data points are not identical, two sets of bubbles are displayed. 4
Create the data set JOBS2 and calculate variable YEN. The DATA step uses a SET
statement to read the JOBS data set.
data jobs2;
set jobs;
yen=dollars*125;
run;
Generate bubble plot with second vertical axis. In the BUBBLE statement, HAXIS=
specifies the AXIS1 definition and VAXIS= scales the left axis. In the BUBBLE2 statement,
VAXIS= scales the right axis. Both axes represent the same range of monetary values. The
BUBBLE and BUBBLE2 statements ensure that the bubbles generated by each statement are
identical by coordinating specifications on BCOLOR=, which colors the bubbles; BSIZE=, which
increases the size of the scaling factor to 12; and CAXIS=, which colors the axis lines and all
major and minor tick marks. Axis labels and major tick mark values use the default color, which
is the first color in the colors list.
RUN-group processing
SYMBOL statement
Sample library member: GPLVRBL1
In this example, the PLOT statement uses a plot request of the type
y-variable*x-variable to plot the variable HEIGHT against the variable WEIGHT. The
plot shows that weight generally increases with size.
This example then requests the same plot with some modifications. As shown by the
following output, the second plot request specifies a regression analysis with confidence
limits, and scales the range of values along the vertical and horizontal axes. It also
displays the regression equation specified for the SYMBOL statement. Because the
procedure supports RUN-group processing, you do not have to repeat the PROC GPLOT
statement to generate the second plot.
1128 Example 4: Plotting Two Variables Chapter 37
Create the data set. STATS contains the heights and weights of numerous individuals.
data stats;
input height weight;
datalines;
69.0 112.5
56.5 84.0
...more data lines...
67.0 133.0
57.5 85.0
;
run;
Generate scatter plot with regression line. HAXIS= and VAXIS= define the range of axes
values. HMINOR= specifies one minor tick mark between major tick marks. REGEQN displays
the regression equation specified on the SYMBOL1 statement.
Other features:
SYMBOL statement
Sample library member: GPLDTPT1
In this example, the PLOT statement uses a plot request of the type
y-variable*x-variable to plot the variable HIGH against the variable YEAR to show the
annual highs of the Dow Jones Industrial Average over several decades.
This example uses a SYMBOL statement to specify a plot symbol and connect data
points with a straight line. In addition, the example shows how PLOT statement
options can add reference lines and modify the axes (AXIS statements are not used).
Create the data set. STOCKS contains yearly highs and lows for the Dow Jones Industrial
Average, and the dates of the high and low values each year.
data stocks;
input year @7 hdate date9. @15 high
@24 ldate date9. @32 low;
format hdate ldate date9.;
datalines;
1955 30DEC55 488.40 17JAN55 388.20
1956 06APR56 521.05 23JAN56 462.35
...more data lines...
The GPLOT Procedure Example 6: Generating an Overlay Plot 1131
Define symbol characteristics. SYMBOL1 defines the symbol that marks the data points and
specifies its height and color. INTERPOL=JOIN joins the data points with straight lines.
symbol1 color=red
interpol=join
value=dot
height=3;
Generate the plot and modify the axis values. HAXIS= sets major tick marks for the
horizontal axis. VAXIS= sets major tick marks for the vertical axis. HMINOR= and VMINOR=
specify the number of tick marks between major tick marks.
proc gplot data=stocks;
plot high*year / haxis=1955 to 1995 by 5
vaxis=0 to 6000 by 1000
hminor=3
vminor=1
Add reference lines and specify colors. VREF= draws reference lines on the vertical axis at
three marks. LVREF= specifies the line style (dashed) for the lines; CVREF= specifies blue as
the line color. CAXIS= colors the axis lines and all major and minor tick marks. CTEXT=
specifies red for all plot text, including axis labels and major tick mark values.
OVERLAY
Other features:
LEGEND statement
SYMBOL statement
Data set: STOCKS on page 1130
Sample library member: GPLOVRL1
In this example, one PLOT statement plots both the HIGH and LOW variables
against the variable YEAR using two plot requests. The OVERLAY option on the PLOT
statement determines that both plot lines appear on the same graph. The other PLOT
options scale the vertical axis, add a reference line to the plot, and specify the number
of minor tick marks on the axes. The SYMBOL, AXIS, and LEGEND statements modify
the plot symbols, axes, and legend.
Note: If the OVERLAY option were not specified, each plot request would generate a
separate graph. 4
Define symbol characteristics. Each SYMBOL statement specifies a color, symbol type, and
size for the plot symbols, and connects the data points with a straight line. SYMBOL2 specifies
a solid triangle as the plot symbol by combining FONT=MARKER with VALUE=C.
symbol1 color=red
interpol=join
value=dot
height=3;
symbol2 font=marker value=C
color=blue
interpol=join
height=2;
Define legend characteristics. LABEL= suppresses the legend label. SHAPE= specifies a
width and height for legend values. POSITION= centers the legend inside the top of the axis
frame. MODE= shares the legend area with other graphics elements.
legend1 label=none
shape=symbol(4,2)
position=(top center inside)
mode=share;
Generate two plots and display them on the same set of axes. OVERLAY specifies that
both plot lines appear on the same graph. LEGEND= assigns the LEGEND1 definition to the
graph.
This example uses the AREAS= option in the PLOT statement to fill the areas that
are under the plot lines. As in the previous example, two plots are overlaid on the same
graph.
Set the graphics environment. COLORS= sets the area colors. CTEXT= sets the color for all
text.
Define symbol characteristics. INTERPOL= specifies a line to connect data points. The line
creates the fill boundary.
symbol1 interpol=join;
Generate a plot with filled areas. The plot requests are ordered to draw the lowest plot first.
Area 1 occupies the space between the lowest (first) plot line and the horizontal axis, and area 2
is below the highest (second) plot line. This arrangement prevents the pattern for area 1 from
overlaying the pattern for area 2. AREAS=2 fills all the areas below the second plot line.
This example shows that when your data contain a classification variable that groups
the data, you can use a plot request of the form y-variable*x-variable=third-variable to
generate a separate plot for every formatted value of the classification variable, which
in this case is CITY. With this type of request, all plots are drawn on the same graph
and a legend is automatically produced and explains the values of third-variable. The
default legend uses the variable name CITY for the legend label and the variable values
for the legend value descriptions. Because no LEGEND definition is used in this
example, the font and height of the legend label and the legend value descriptions are
set by the graphics options FTEXT= and HTEXT=. Height specifications in the
SYMBOL statement do not affect the size of the symbols in the legend values.
This example then modifies the plot request. As shown in the following output, the
plot is enhanced by using different symbol definitions for each plot line, changing axes
labels, and scaling the vertical axes differently.
The GPLOT Procedure Example 8: Plotting Three Variables 1137
Create the data set. CITYTEMP contains the average monthly temperatures of three cities:
Raleigh, Minneapolis, and Phoenix.
data citytemp;
input month faren city $;
datalines;
1 40.5 Raleigh
1 12.2 Minn
1 52.1 Phoenix
...more data lines...
12 41.2 Raleigh
12 18.6 Minn
12 52.5 Phoenix
;
Define symbol characteristics. This statement specifies that a straight line connect data
points, and that the data points be represented by a 3-unit-high dot. Because no color is
specified, the default color behavior is used and each line is a different color.
symbol1 interpol=join
value=dot
height=3;
Generate a plot of three variables. The plot request draws one plot on the graph for each
value of CITY and produces a legend that defines CITY values.
proc gplot data=citytemp;
plot faren*month=city / hminor=0;
run;
Define new symbol characteristics. SYMBOL statements are assigned to the values of CITY
in alphabetical order. For example, the value Minn is assigned SYMBOL1.
symbol1 color=green interpol=spline
width=2 value=triangle
height=3;
symbol2 color=blue interpol=spline
width=2 value=circle
height=3;
symbol3 color=red interpol=spline
width=2 value=square
height=3;
Define new axis characteristics. AXIS1 suppresses the axis label and specifies month
abbreviations for the major tick mark labels. AXIS2 specifies a two-line axis label and scales the
axis to show major tick marks at every 10 degrees from 0 to 100 degrees.
axis1 label=none
value=(’JAN’ ’FEB’ ’MAR’ ’APR’ ’MAY’ ’JUN’
’JUL’ ’AUG’ ’SEP’ ’OCT’ ’NOV’ ’DEC’)
order = 1 to 12 by 1
offset=(2)
width=3;
axis2 label=(’Degrees’ justify=right ’Fahrenheit’)
order=(0 to 100 by 10)
width=3;
Generate the enhanced plot. Because the procedure supports RUN-group processing, you do
not have to repeat the PROC GPLOT statement to generate the second plot.
plot faren*month=city / haxis=axis1 hminor=0
vaxis=axis2 vminor=1
caxis=red legend=legend1;
run;
quit;
This example shows how a PLOT2 statement generates a right axis that displays the
values of the vertical coordinates in a different scale from the scale that is used for the
left axis.
In this plot of the average monthly temperature for Minneapolis, temperature
variables that represent degrees centigrade (displayed on the left axis) and degrees
Fahrenheit (displayed on the right axis) are plotted against the variable MONTH.
Although the procedure produces two sets of data points, it calibrates the axes so that
the data points are identical and it displays only one plot.
This example uses SYMBOL statements to define symbol definitions. By default, the
SYMBOL1 statement is assigned to the plot that is generated by the PLOT statement,
and SYMBOL2 is assigned to the plot generated by the PLOT2 statement.
Create the data set and calculate centigrade temperatures. MINNTEMP contains
average monthly temperatures for Minneapolis.
1140 Example 9: Plotting with Different Scales of Values Chapter 37
data minntemp;
input @10 month
@23 f2;
c2=(f2-32)/1.8;
output;
datalines;
01JAN83 1 1 40.5 12.2 52.1
01FEB83 2 1 42.2 16.5 55.1
...more data lines...
01NOV83 11 4 50.0 32.4 59.8
01DEC83 12 1 41.2 18.6 52.5
;
Define symbol characteristics for PLOT2. SYMBOL2 suppresses interpolation lines and
plotting symbols; otherwise, they would overlay the lines or symbols displayed by SYMBOL1.
symbol2 interpol=none
value=none;
Define axis characteristics. In the AXIS2 and AXIS3 statements, ORDER= controls the
scaling of the axes. Both axes represent exactly the same range of temperature, and the
distance between the major tick marks on both axes represent an equivalent quantity of degrees
(10 for centigrade and 18 for Fahrenheit).
axis1 label=none
value=(’JAN’ ’FEB’ ’MAR’ ’APR’ ’MAY’ ’JUN’
’JUL’ ’AUG’ ’SEP’ ’OCT’ ’NOV’ ’DEC’)
offset=(2)
width=3;
axis2 label=(’Degrees’ justify=right ’ Centigrade’)
order=(-20 to 30 by 10)
width=3;
The GPLOT Procedure Example 10: Creating Plots with Drill-down for the Web 1141
Generate a plot with a second vertical axis. HAXIS= specifies the AXIS1 definition.
VAXIS= specifies AXIS2 and AXIS3 definitions in the PLOT and PLOT2 statements. CAXIS=
colors the axis lines and all major and minor tick marks. Axis labels and major tick mark values
use the default color. VMINOR= specifies the number of minor tick marks for each axis.
proc gplot data= minntemp;
plot c2*month / caxis=red
haxis=axis1 hminor=0
vaxis=axis2 vminor=1;
plot2 f2*month / caxis=red
vaxis=axis3
vminor=1;
run;
quit;
This example shows how to create a plot with simple drill-down functionality for the
Web. If you display the plot in a Web browser, you can select any plot point or legend
symbol to display a report on monthly temperatures for the selected city.
The example explains how to use an ODS statement such as ODS HTML to generate
a graph with drill-down links. It shows how to:
3 explicitly name the HTML files and direct the different types of output to different
files
3 use BY-group processing with ODS, and determine the anchor names for the
different pieces of output
3 use the PATH= option to specify the destination for the HTML and GIF files
created by the ODS statement
1142 Example 10: Creating Plots with Drill-down for the Web Chapter 37
For more information on drill-down graphs, see “Adding Drill-Down Links to Web
Presentations” on page 571.
This program modifies the code from sample GPLVRBL2, which shows how to
generate separate plots for the formatted values of a classification variable. In this
example, the code implements drill-down capability for the plot, enabling you to select
any plot point or legend symbol to drill down to a report on the yearly temperatures for
the corresponding city. The following figure shows the drill-down plot as it is viewed in
a Browser.
The following figure shows the report that appears when you select any plot point or
legend symbol that corresponds to the data for Raleigh.
The GPLOT Procedure Example 10: Creating Plots with Drill-down for the Web 1143
Assign the fileref to the Web-server path. FILENAME assigns the fileref ODSOUT, which
specifies a destination for the HTML and GIF files produced by the example program. ODSOUT
must point to a Web-server location if procedure output is to be viewed on the Web. Later in the
program, PATH=ODSOUT is specified on the ODS HTML statement, which directs program
output to that location.
Close the ODS listing destination for output. To conserve system resources, use ODS
LISTING to close the Listing destination for procedure output. Thus, the graphics output is not
displayed in the GRAPH window, although it is written to the catalog.
Assign graphics options for producing the ODS output. DEVICE=GIF causes ODS to
generate the graphics output as GIF files. TRANSPARENCY causes the graphics output to use
the Web-page background as the background of the graph. NOBORDER suppresses the border
around the graphics output area, which makes the border treatment the same as that for the
non-graphics output that is generated by the example.
Open the HTML destination. PATH= specifies the ODSOUT fileref as the HTML destination
for all the HTML and GIF files produced by the program. BODY= names the HTML file for
storing the drill-down plot. NOGTITLE suppresses the graph title from the SAS/GRAPH output
and displays it through the HTML page. ODS automatically assigns anchor names to each
piece of output that is generated while the HTML destination is open.
ods html path=odsout
body=’city_plots.html’
nogtitle;
Create the data set CITYTEMP. CITYTEMP contains the average monthly temperatures for
three cities.
data citytemp;
input Month Fahrenheit City $;
datalines;
1 40.5 Raleigh
1 12.2 Minn
1 52.1 Phoenix
2 42.2 Raleigh
2 16.5 Minn
2 55.1 Phoenix
3 49.2 Raleigh
3 28.3 Minn
3 59.7 Phoenix
4 59.5 Raleigh
4 45.1 Minn
4 67.7 Phoenix
5 67.4 Raleigh
5 57.1 Minn
5 76.3 Phoenix
6 74.4 Raleigh
6 66.9 Minn
6 84.6 Phoenix
7 77.5 Raleigh
7 71.9 Minn
7 91.2 Phoenix
8 76.5 Raleigh
8 70.2 Minn
8 89.1 Phoenix
9 70.6 Raleigh
9 60.0 Minn
9 83.8 Phoenix
10 60.2 Raleigh
10 50.0 Minn
10 72.2 Phoenix
11 50.0 Raleigh
11 32.4 Minn
11 59.8 Phoenix
12 41.2 Raleigh
12 18.6 Minn
12 52.5 Phoenix
;
The GPLOT Procedure Example 10: Creating Plots with Drill-down for the Web 1145
Add the HTML variable to CITYTEMP and create the NEWTEMP data set. The HTML
variable CITYDRILL contains the target locations to associate with the different values of the
variable CITY. Each location for CITYDRILL references the file city_reports.html, which this
program will create. Each location ends with the default anchor name (IDX1, IDX2, and IDX3)
that ODS assigns to the target output when it creates that output in file city_reports.html.
data newtemp;
set citytemp;
length citydrill $ 40;
if city=’Minn’ then
citydrill=’HREF="city_reports.html#IDX1"’;
else if city=’Phoenix’ then
citydrill=’HREF="city_reports.html#IDX2"’;
else if city=’Raleigh’ then
citydrill=’HREF="city_reports.html#IDX3"’;
Define titles and footnotes and a symbol definition for the plots.
symbol1 interpol=join
value=dot
height=3;
Generate the plot. Both HTML= and HTML_LEGEND= specify CITYDRILL as the variable
that contains the targets for the drill-down links. HTML= determines that each plot point will
be a hot zone that links to target output, and HTML_LEGEND= determines that the legend
symbols will be hot zones that link to target output. This GPLOT procedure generates the first
piece of output in this program; thus, the plot receives the first default anchor name, which is
IDX.
Change the HTML file. BODY= opens a new HTML file for storing the reports for city
temperatures. The new file is assigned the name city_reports.html, which is the file name
assigned above to variable CITYDRILL as part of its target-link locations. The reports that are
generated later in this program will all be written to this one HTML file.
goptions reset=footnote;
option nobyline;
Print a report of monthly temperatures for each city. The BY statement determines that a
separate report is generated for each city. Thus, the REPORT procedure generates three pieces
of output. To assign anchor locations to this new output, ODS increments the last anchor name
that was used (IDX), and therefore assigns the anchor names IDX1, IDX2, and IDX3 to the
output. These are the anchor locations that were specified above as the anchor locations for
variable CITYDRILL.
CHAPTER
38
The GPRINT Procedure
Overview 1147
Concepts 1148
About External Text Files 1148
Procedure Syntax 1148
PROC GPRINT Statement 1148
Examples 1153
Example 1: Specifying Color Text 1153
Example 2: Adjusting the Size of Characters 1156
Overview
The GPRINT procedure converts a text file into graphics output that can be
displayed or printed on a graphics output device. You can enhance the output with
TITLE, NOTE, and FOOTNOTE statements, or include Annotate graphics, or both.
Like output from any other SAS/GRAPH procedure, output from the GPRINT procedure
can be stored in catalogs and replayed with the GREPLAY procedure.
You can use the GPRINT procedure when you want to create graphics output from
tabular material, reports, or any external text file produced by the SAS System or other
software application. To display text and graphics generated by SAS/GRAPH software,
use the GSLIDE procedure.
Figure 38.1 on page 1147 shows a graphics output generated by the GPRINT
procedure from SAS output generated by the MEANS procedure. Titles and footnotes
have been added, and the Swiss font has been assigned to the procedure output text.
Concepts
Note: Depending on the operating environment and the method used to generate
the file, external text files may contain carriage-control characters. For more
information on carriage-control characters, see the NOCC option on page 1150. 4
You can use a FILENAME statement or host command to specify a fileref that points
to the location of the external text file that you want to print. This external file serves
as the input file for the GPRINT procedure.
Procedure Syntax
Global statements: FOOTNOTE, GOPTIONS, TITLE
Reminder: The procedure can include the NOTE statement.
Supports: Output Delivery System (ODS)
Syntax
PROC GPRINT FILEREF=fileref
<option(s)>;
ANNOTATE=Annotate-data-set
CTEXT=text-color
DESCRIPTION=’entry-description’
GOUT=<libref.>output-catalog
NAME=’entry-name’
NOCC
O
Required Arguments
FILEREF=fileref
specifies the fileref that is associated with the external file that will be used as input
to the GPRINT procedure. Fileref must have been previously defined in a
FILENAME statement or host command.
See also: “FILENAME Statement” on page 28.
Featured in: Example 2 on page 1156.
Options
Options in the PROC GPRINT statement affect all graphs that the statement
produces. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate the output that the GPRINT procedure produces.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
CTEXT=text-color
specifies the color in which the procedure displays the text from the input file.
If you do not use the CTEXT= option, a color specification is searched for in the
following order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
The CTEXT= option in the PROC GPRINT statement does not affect titles and
footnotes generated by TITLE and FOOTNOTE definitions.
Featured in: Example 1 on page 1153.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
entry-description is 256 characters. The description does not appear on the chart. By
default, the GPRINT procedure assigns the description OUTPUT FROM PROC
GPRINT.
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GPRINT procedure. If you omit the libref, SAS/GRAPH looks for the catalog in the
temporary library called WORK and creates the catalog if it does not exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53.
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is 8 characters. The default name is GPRINT. If the specified name
duplicates the name of an existing entry, SAS/GRAPH software adds a number to the
duplicate name to create a unique entry, for example, GPRINT1.
1150 PROC GPRINT Statement Chapter 38
NOCC
tells the procedure that the external text file does not contain carriage-control
characters. If you include the NOCC option, the procedure assumes that the first
character on each line of the input file is a text character and not a carriage-control
character. If you omit the NOCC option, the characters in column one are read as
carriage-control characters. If they are valid carriage-control characters, the
GPRINT procedure recognizes and executes them. If they are not valid
carriage-control characters, the GPRINT procedure issues an error message.
O
causes a 0 (numeric zero) to be converted to the letter O in the output. This option
circumvents the use of a numeric zero with an interior slash that is present on some
devices.
The number of columns and rows that fill the area is determined by the values of the
LCOLS or PCOLS and LROWS or PROWS device parameters. These values, which
determine the size and aspect ratio of a cell, can be temporarily altered with the
HPOS= and VPOS= graphics options. The more columns and rows there are in a given
area, the smaller the cells are. Therefore, using HPOS= and VPOS= to change the
number of columns and rows also changes the size of the cells and may change the size
of the characters. However, it does not affect the overall dimensions of the graph. For
details, see “Maintaining the aspect ratio of cells” on page 1152.
See “Procedure Output and the Graphics Output Area” on page 34 for a complete
description of the graphics output area and Chapter 2, “SAS/GRAPH Programs,” on
page 25 for information on device parameters and graphic options.
Matching Sizes
When you use the GPRINT procedure to convert SAS output to graphics output, you
may need to manipulate the dimensions of either or both to get the proper size
characters in the graphics output and to avoid truncating lines. Adjustment may be
necessary in the following situations:
3 If the number of rows per page in the SAS output (PAGESIZE=) exceeds the
number of rows in the graphics output area (LROWS or PROWS), then the
GPRINT procedure produces additional pages of graphics output.
3 If the number of rows per page in the SAS output (PAGESIZE=) is much less than
the number of rows in the graphics output area (LROWS or PROWS), then the
output does not fill the graphics output area.
3 If the width of a line of SAS output (LINESIZE=) exceeds the number of columns
in the graphics output area (LCOLS or PCOLS), then the GPRINT procedure
truncates the line.
3 If the width of SAS output (LINESIZE=) is much less than the number of columns
in the graphics output area (LCOLS or PCOLS), then the output does not fill the
graphics output area.
You can adjust the size of the SAS output or the size of the graphics output, or both.
Using Fonts
By default, the GPRINT procedure uses the default hardware font with a height of 1
cell to display the text from the external file. However, if you specify a nonscalable
hardware font, SAS/GRAPH may use the Simulate font instead. See Chapter 5, “SAS/
GRAPH Fonts,” on page 75 for details.
Font and height specifications for titles and footnotes are determined by the TITLE
and FOOTNOTE definitions. See “TITLE, FOOTNOTE, and NOTE Statements” on
page 210 for details.
To specify a font and height for the text, use the FTEXT= and HTEXT= graphics
options. If you specify a software font, it is best to use a uniform font such as Swiss
Uniform so that your text will be evenly spaced.
CAUTION:
Changes in the aspect ratio of cells made with the HPOS= and VPOS= graphics options are
ignored if you specify software fonts. Change the aspect ratio in the device entry if you
want the software characters proportioned to fit the new aspect ratio. 4
The GPRINT Procedure Example 1: Specifying Color Text 1153
If you specify a software font and change the aspect ratio of the cells with the
HPOS= and VPOS= graphics options, the change in aspect ratio is ignored and the
procedure continues to draw the font in the original proportions. As a result, your text
may not fit the graphics output area.
However, if you want the software characters to reflect a change in aspect ratio or if
you want the characters to fit the new aspect ratio even if they are distorted, use the
LCOLS or PCOLS and LROWS or PROWS device parameters in the device entry to
change the aspect ratio of the cells. Using the device entry to specify a change in the
aspect ratio enables you to distort the characters. See Chapter 31, “The GDEVICE
Procedure,” on page 915 for more information on changing device parameters.
Examples
This example creates the REFLIB.DOWHLC data set and generates a graph with
color text from output that is produced by the TIMEPLOT procedure. The TIMEPLOT
procedure is not a graphics procedure and produces text output only. (See Base SAS
Procedures Guide for details on the TIMEPLOT procedure.)
The first part of this example uses the TIMEPLOT procedure with the newly created
REFLIB.DOWHLC data set as input to produce Output 38.1:
1154 Example 1: Specifying Color Text Chapter 38
The second part of this example takes the output generated by the TIMEPLOT
procedure and converts it to a graph by using the GPRINT procedure. Figure 38.3 on
page 1154 shows the graph with color text, a title, and a footnote:
Assign the libref and set the graphics environment. HTEXT= assigns the height for the
text in the default unit, cells.
libname reflib ’SAS-data-library’;
goptions reset=global border cback=white
colors=(black blue green red)
ftitle=swissb htitle=3pct
htext=.8 ftext=none
hsize=7in vsize=5in;
Suppress the date line and page numbers and set the linesize and pagesize.
options nodate nonumber linesize=80 pagesize=60;
Generate graph from the external file and specify text color. CTEXT= assigns a color to
the text produced by the GPRINT procedure.
This example creates a graph from a text file and increases the size of the text. The
first part of this example uses the PRINT procedure to create an external file that
contains SAS output. The GPRINT procedure is used to import the text file into a
graph. Because the LINESIZE= option (columns) is set to 76 and the PAGESIZE=
option (rows) is set to 24, the output is small and occupies only a portion of the page, as
shown in Figure 38.4 on page 1157:
The GPRINT Procedure Example 2: Adjusting the Size of Characters 1157
In the second part of this example, the number of columns and rows in the graphics
output area is reduced with the HPOS= and VPOS= graphic options. Thus, the size of
the characters in the graph increase, as shown in Figure 38.5 on page 1157:
Assign the libref and set the graphics environment. FTEXT= in the GOPTIONS statement
specifies the default hardware font. (This is the default setting.)
libname reflib ’SAS-data-library’;
goptions reset=global border cback=white
colors=(black blue green red)
ftitle=swissb ftext=none
hsize=7in vsize=5in
hpos=142 vpos=68;
1158 Example 2: Adjusting the Size of Characters Chapter 38
Assign the fileref DOW to the external file. The fileref DOW is associated with the external
file where the output from PROC PRINT is stored.
filename dow ’external-file’;
Suppress the date line and page numbers. Set the line and page size.
options nodate nonumber linesize=76 pagesize=24;
Specify the destination for all subsequent procedure output. The PRINTTO procedure
directs the SAS output to the external file that the GPRINT procedure subsequently uses as
input. PRINT= directs all printed procedure output to the file referenced by the fileref DOW.
NEW causes the output file to be replaced each time the program is run.
proc printto print=dow new;
run;
Send the output to the destination file. The PRINT procedure generates the text and sends
it to the external file specified by PROC PRINTTO.
proc print data=reflib.dowhlc;
run;
Reset destination for printed output to the default. The destination for printed output is
reset to the default by resubmitting PROC PRINTTO with no options.
proc printto;
run;
Generate graph from the external file. FILEREF= specifies the external file that is used as
input. NOCC is omitted because the input text file contains carriage-control characters.
proc gprint fileref=dow;
run;
CHAPTER
39
The GPROJECT Procedure
Overview 1161
Concepts 1163
About the Input Map Data Set 1163
Input Map Data Sets that Contain Only Unprojected Values 1163
Input Map Data Sets that Contain Both Projected and Unprojected Values 1164
About Coordinate Values 1164
About Types of Map Projections 1165
Albers’ Equal-Area Projection 1165
Lambert’s Conformal Projection 1166
Gnomonic Projection 1167
Procedure Syntax 1167
PROC GPROJECT Statement 1168
ID Statement 1171
Using the GPROJECT Procedure 1172
Selecting Projections 1172
Controlling Projection Criteria 1172
Clipping Map Data Sets 1173
Examples 1173
Example 1: Using Default Projection Specifications 1174
Example 2: Emphasizing Map Areas 1177
Example 3: Clipping an Area from the Map 1178
Example 4: Projecting an Annotate Data Set 1180
References 1182
Overview
The GPROJECT procedure processes traditional map data sets by converting
spherical coordinates (longitude and latitude) into Cartesian coordinates for use by the
GMAP procedure. The process of converting coordinates from spherical to Cartesian is
called projecting. In many of the traditional map data sets available with SAS/GRAPH
software, the observation values are stored as longitude and latitude coordinates on a
sphere (which means the map is unprojected). When these observations are plotted by
the GMAP procedure, which is designed to plot points on a two-dimensional plane, the
resulting map is often reversed and elongated as a result of forcing the curved map
surface onto a flat plane.
The GPROJECT procedure enables you to use one of several map projection
techniques to project the coordinates in a traditional map data set into a
two-dimensional plane while attempting to minimize the distortion of area, distance,
direction, and shape properties of the original sphere. (The earth is not precisely
spherical and the GPROJECT procedure does not attempt to correct this small
1162 Overview Chapter 39
distortion.) The output map data set that is produced by the procedure contains
Cartesian coordinates that can be displayed correctly using the GMAP procedure.
The GPROJECT procedure also can create a rectangular subset of the input map
data set by excluding all points with longitude and latitude values that fall outside of a
specified range. This provides a handy way to reduce the size of the map data set if you
need only a portion of a larger map.
The GPROJECT procedure does not produce any graphics output. Instead, it
produces an output map data set, which typically becomes the input map data set for
the GMAP procedure (see Chapter 35, “The GMAP Procedure,” on page 995).
Figure 39.1 on page 1162 and Figure 39.2 on page 1163 illustrate the effect of using
GPROJECT defaults (Albers projection with standard parallels that are calculated by
the procedure) to project a typical map data set with coordinates that are stored as
longitude and latitude.
The program for the following maps can be seen in Example 1 on page 1174.
Concepts
Note: Projection is appropriate for map data sets in which the X and Y variable
values represent longitude and latitude. Some of the map data sets that are supplied
with SAS/GRAPH have already been projected; such data set should not be projected
again. 4
The following is a list of all of the Institute-supplied data sets that contain X and Y
variables whose values are unprojected:
1164 About Coordinate Values Chapter 39
CANADA3
CANADA4
COUNTIES
COUNTY
STATES
See Example 1 on page 1174 for an illustration of this type of input map data set and
the variables it contains.
Input Map Data Sets that Contain Both Projected and Unprojected Values
Most traditional map data sets contain both sets of variables (X, Y and LONG, LAT)
for projected and unprojected maps. In these cases, the X and Y variables will produce
a projected map so you do not need to use the GPROJECT procedure. However, you
may want to use the LONG and LAT variables to reproject the map using a different
projection type. To do this you must first rename the LONG and LAT variables. It is
necessary to rename the LONG and LAT variables because the GPROJECT procedure
looks for variables that are named X and Y by default. You can create a new map data
set using the OUT= option, drop the current X and Y variables, and rename the LONG
and LAT variables. Your new data set will then contain unprojected values in X and Y.
The following statements illustrate how to do this:
proc gproject data=map.austral
(drop=x y rename=(long=x lat=y))
out=newaust;
id id;
run;
For additional information on the supplied SAS/GRAPH map data sets, see “About
Map Data Sets” on page 999 and the METAMAPS data set in your maps data set
directory.
prime meridian
west longitude east longitude
north pole 90o
1.5708
north latitude
o
equator 0
0.0
south latitude
−90
o
By default, the GPROJECT procedure assumes that the units for the input
coordinate values are radians and that values for the horizontal coordinate increase
from east to west across the map. If your map coordinates are stored as degrees of arc,
use the DEGREE option in the PROC GPROJECT statement. If the horizontal
coordinate values in the map increase west-to-east rather than east-to-west, use the
EASTLONG option in the PROC GPROJECT statement. See “Options” on page 1168
for details of DEGREE and EASTLONG.
The unprojected map data sets that are provided with SAS/GRAPH can be projected
if you use the default procedure characteristics: coordinate units in the data sets are
radians, and horizontal values increase east-to-west.
Gnomonic Projection
The gnomonic projection is a planar projection from the surface of the sphere directly
onto an imaginary plane tangent to the sphere at the map projection pole. By default,
the projection pole is placed at the center of the map data set that is to be projected, but
you can specify the projection pole to be anywhere on the surface of the sphere. (See
thePOLELAT= and POLELONG option on page 1170.)
In the gnomonic projection, distortion increases as the distance from the map pole
increases. Because of this distortion, the PROC GPROJECT procedure deletes all of the
observations that lie more than 85 degrees from the map pole. The gnomonic projection
is best suited for mapping areas of small east-to-west extent.
Figure 39.7 on page 1167 illustrates a gnomonic projection of the northern
hemisphere.
Procedure Syntax
Requirements: Exactly one ID statement is required.
Syntax
PROC GPROJECT < option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 data set options:
DATA=input-map-data-set
OUT=output-map-data-set
3 projection options:
PARADIV=n
PARALEL1=latitude
PARALEL2=latitude
POLELAT=latitude
POLELONG=longitude
PROJECT=ALBERS | GNOMON | LAMBERT | NONE
3 coordinate options:
ASIS | DUPOK
DEGREE
EASTLONG
3 clipping options:
LATMIN=min-latitude
LATMAX=max-latitude
LONGMIN=min-longitude
LONGMAX=max-longitude
Options
ASIS
DUPOK
specify that observations for which the projected values for the X and Y variables are
identical to those in the previous observation should be retained. By default,
successive identical observations are deleted.
DATA=input-map-data-set
identifies the map data set to be processed. By default, the procedure uses the most
recently created SAS data set.
See also: “About the Input Map Data Set” on page 1163 and“SAS Data Sets” on
page 29.
Featured in: Example 4 on page 1180.
The GPROJECT Procedure PROC GPROJECT Statement 1169
DEGREE
DEG
specifies that the units for the longitude (X variable) and latitude (Y variable)
coordinates are degrees of arc. By default, coordinate units are considered to be
radians.
EASTLONG
EAST
specifies that the longitude (X variable) values in the input map data set increase to
the east. By default, longitude values increase to the west.
LATMAX=max-latitude
specify the maximum latitude that will be included in the projection. Any unit areas
that cross the selected latitude are clipped and closed along the specified parallels.
The LATMAX= and LATMIN= options do not have to be paired; you can specify a
maximum latitude without specifying a minimum.
When PROJECT=ALBERS, LAMBERT, or GNOMON, PROC GPROJECT treats
the value of max-latitude as degrees. When PROJECT=NONE, the procedure treats
the value as a Cartesian coordinate.
Featured in: Example 3 on page 1178.
LATMIN=min-latitude
specify the minimum latitude that will be included in the projection. Any unit areas
that cross the selected latitude are clipped and closed along the specified parallels.
The LATMAX= and LATMIN= options do not have to be paired; you can specify a
minimum latitude without specifying a maximum.
When PROJECT=ALBERS, LAMBERT, or GNOMON, PROC GPROJECT treats
the value of min-latitude as degrees. When PROJECT=NONE, the procedure treats
the value as a Cartesian coordinate.
Featured in: Example 3 on page 1178.
LONGMAX=max-longitude
specify the maximum longitude to be included in the projection. Any unit areas that
cross the selected longitude are clipped and closed along the specified meridians. The
LATMAX= and LATMIN= options do not have to be paired; you can specify a
maximum longitude without specifying a minimum.
When PROJECT=ALBERS, LAMBERT, or GNOMON, PROC GPROJECT treats
the value of max-longitude as degrees. When PROJECT=NONE, the procedure treats
the value as a Cartesian coordinate.
Featured in: Example 3 on page 1178.
LONGMIN=min-longitude
specify the minimum longitude to be included in the projection. Any unit areas that
cross the selected longitude are clipped and closed along the specified meridians. The
LATMAX= and LATMIN= options do not have to be paired; you can specify a
minimum longitude without specifying a maximum.
When PROJECT=ALBERS, LAMBERT, or GNOMON, the GPROJECT procedure
treats the value of min-longitude as degrees. When PROJECT=NONE, the procedure
treats the value as a Cartesian coordinate.
Featured in: Example 3 on page 1178.
OUT=output-map-data-set
names the new map data set, which contains the coordinates of the new unit areas
that are created by the GPROJECT procedure.
By default, the GPROJECT procedure names the new data set that uses the
DATAn naming convention. That is, the procedure uses the name WORK.DATAn,
1170 PROC GPROJECT Statement Chapter 39
where n is the next unused number in sequence. Thus, the first automatically named
data set is DATA1, the second is DATA2, and so on.
Featured in: Example 4 on page 1180.
PARADIV=n
specifies the divisor that computes the values used for standard parallels for the
Albers’ or Lambert’s projections when explicit values are not provided. By default
PARADIV=4, which causes standard parallels to be set at 1/4 and 3/4 of the range of
latitude values in the input map data set.
See also: PARALEL1= and PARALEL2= option
PARALEL1=latitude
PARALEL2=latitude
specify values for the standard parallels that are used in the Albers’ or Lambert’s
projection. Latitude must be in degrees. Positive values indicate north of the equator,
and negative values indicate south of the equator. These options are ignored for the
gnomonic projection.
By default, the GPROJECT procedure calculates values for the standard parallels.
The defaults are chosen to minimize the distortion inherent in the projection process.
The algorithm used is
PARALEL1 = minlat + R / PD
PARALEL2 = maxlat - R / PD
where:
R
is the range of latitude values in the input map data set.
PD
is the PARADIV= value (see the discussion of the PARADIV= option).
minlat
is the minimum latitude value in the input map data set.
maxlat
is the maximum latitude value in the input map data set.
If you do not use PARALEL1= or PARALEL2=, or you omit either option, the
GPROJECT procedure uses the calculated value for the missing parameter.
The standard parallels, whether explicitly specified or supplied by the procedure,
must lie on the same side of the equator. If they do not, PROC GPROJECT prints an
error message and stops (the procedure may calculate standard parallels that lie on
opposite sides of the equator). When projecting a map data set that contains unit
areas that cross the equator, you may have to explicitly specify standard parallels
that both lie on the same side of the equatMor. If this causes excessive distortion of
the map, you may be able to use the gnomonic projection instead of the Albers’ or
Lambert’s projection because the gnomonic technique has no such limitations at the
equator.
POLELAT=latitude
POLELONG=longitude
specify a projection pole to use for the gnomonic projection. The projection pole is the
point at which the surface of the sphere touches the surface of the imaginary plane
onto which the map is projected. POLELAT= specifies the latitude of the projection
point.
The GPROJECT Procedure ID Statement 1171
Units for latitude are degrees; positive values indicate north of the equator, and
negative values indicate south of the equator. POLELONG= gives the longitude for
the projection point. Units for longitude are degrees; positive values indicate west of
the prime meridian, and negative values indicate east of the prime meridian (unless
EASTLONG also has been used in the PROC GPROJECT statement).
If you do not use POLELAT= or POLELONG=, or you omit either option, PROC
GPROJECT uses values for the position of the center of the unit areas that are
defined by the DATA= data set for the missing parameter.
Note: The map that is defined by the input map data set should not contain
points more than 85 degrees (1.48353 radians) from the projection pole; all points
that exceed this value are deleted from the output map data set. 4
Featured in: Example 2 on page 1177.
PROJECT=ALBERS | LAMBERT | GNOMON | NONE
specifies the projection method to apply to the map data set. Values for PROJECT=
are as follows:
ALBERS
specifies Albers’ equal-area projection with two standard parallels.
LAMBERT
specifies Lambert’s conformal projection with two standard parallels.
GNOMON
specifies the gnomonic projection, which is an azimuthal projection.
NONE
specifies that no projection should be performed. Use this option in conjunction
with the LATMIN=, LATMAX=, LONGMIN=, and LONGMAX= options to perform
clipping without projection (for example, on map data sets that have already been
projected).
By default, PROJECT=ALBERS.
Note: There are several additional projections available. These projections are
experimental and are not supported by SAS Institute Technical Support. They are:
ADAMS, AITOFF, APIANUS, ARAGO, BEHRMANN, BRAUN, CYLINDRI,
ECKERT1, ECKERT3, ECKERT5, EQUIRECT or MARINUS, GALL, KVRSKY7,
MILLER1, MILLER2 , ORTHO, PARABOLI, PETERS, PUTNINS4, ROBINSON,
STEREO, WINKEL2.
You must specify the EASTLONG option to use any of these experimental
projections. 4
See also: “About Types of Map Projections” on page 1165.
Featured in: Example 2 on page 1177.
ID Statement
Identifies the variable or variables that define the hierarchy of the current unit areas in the input
map data set.
Requirements: At least one id-variable is required.
Featured in: Example 1 on page 1174.
Syntax
ID id-variable(s);
1172 Using the GPROJECT Procedure Chapter 39
Required Arguments
id-variable(s)
specifies one or more variables in the input map data set that identify unit areas.
Id-variable can be either numeric or character.
Each group of observations with a different ID variable value is evaluated as a
separate unit area.
Selecting Projections
Except when projecting map data sets that cover large areas, all three types of
projections (Albers’, Lambert’s, and gnomonic) produce relatively similar results when
you use default projection criteria, so you usually do not need to be concerned about
which projection method to use when you produce maps solely for graphics output.
However, the default projection criteria may be unsuitable in some circumstances. In
particular, the default specifications fail when the map that is being projected extends
on both sides of the equator. On other occasions, you may want to select a projection
method to achieve a particular effect.
For the Albers’ and Lambert’s projections, the two standard parallels must both lie
on the same side of the equator. PROC GPROJECT stops with an error message if this
condition is not met, regardless of whether you explicitly specify parallel values or let
the procedure calculate default values. See the descriptions of the PARALEL1= and
PARALEL2= option on page 1170 for more information on how to specify the two
standard parallels.
Examples
The following examples illustrate major features of the GPROJECT procedure.
Because these examples use map data sets that are supplied with SAS/GRAPH , you
may need to replace SAS-data-library in the LIBNAME statement with the actual
1174 Example 1: Using Default Projection Specifications Chapter 39
location of the SAS data library that contains the Institute-supplied map data sets on
your system. Contact your SAS Software Consultant for the location of the map data
sets at your site. If your site automatically assigns the libref MAPS to the SAS data
library that contains the Institute-supplied map data sets, delete the LIBNAME
statement in these examples.
Figure 39.8 on page 1174 illustrates the output produced the US48 map data set,
which contains only unprojected values, X and Y. Output 39.1 shows the variables in
the data set.
The GPROJECT Procedure Example 1: Using Default Projection Specifications 1175
1 1 1 3 1.48221 0.56286
2 1 1 3 1.48226 0.56234
3 1 1 3 1.48304 0.56231
.
.
.
The GPROJECT procedure is used with the US48 map data set as input to create the
projected map data set, US48PROJ. The values for X and Y in this new data set are
projected (cartesian). Output 39.2 shows the variables in the data set.
1 0.16068 -0.073470 3 1 1
2 0.16069 -0.073993 3 1 1
3 0.16004 -0.074097 3 1 1
.
.
.
The new projected map data set, US48PROJ, is used to create the projected map,
Figure 39.9 on page 1175.
Create reduced continental U.S. map data set and remove Alaska, Hawaii, and Puerto
Rico.
data us48;
set maps.states;
if state ne 2 and state ne 15 and state ne 72;
if density<4;
run;
Project map data set using all default criteria. The ID statement identifies the variable in
the input map data set that defines unit areas.
This example uses the gnomonic projection method to create a map in which the east
coast of the United States appears disproportionately large compared to the west coast.
Create reduced continental U.S. map data set and remove Alaska, Hawaii, and Puerto
Rico.
data us48;
set maps.states;
1178 Example 3: Clipping an Area from the Map Chapter 39
Project map onto a plane centered in the Pacific. PROJECT= specifies the projection
method for the map data set. POLELONG= and POLELAT= specify a projection pole for the
gnomonic projection. In this example, the pole is positioned in the Pacific Ocean.
This example uses the clipping capabilities of PROC GPROJECT to create a map of
the states in the United States that border the Gulf of Mexico. Because the PROJECT=
option is not used in the GPROJECT procedure, the Albers’ equal-area projection
method is used by default.
Clip and project rectangular subset of the map. LONGMIN= and LONGMAX= specify the
minimum and maximum longitudes to be included in the map projection. LATMIN= and
LATMAX= specify the minimum and maximum latitudes to be included in the map projection.
This example illustrates how to project an Annotate data set for use with a map data
set. It labels the locations of Miami, Boston, and Bangor on the map shown in the
second example. Because the X and Y variables in the USCITY data set already have
been projected to match the US data set, they cannot be used with the map that is
produced by the second example. To properly label the projected map, the example uses
the same projection method for the city coordinates as the method that is used for the
map coordinates. This example illustrates how to use the same projection method for
both data sets.
Create reduced continental U.S. map data set and remove Alaska, Hawaii, and Puerto
Rico.
data us48;
set maps.states;
if state ne 2 and state ne 15 and state ne 72;
if density<4;
run;
Create Annotate data set CITIES from the MAPS.USCITY data set. The unprojected
LONG and LAT variable values are converted to radians and substituted for the projected X and
Y variable values. LONG and LAT are converted by multiplying them by the arccosine of −1 and
dividing that amount by 180. The cities are each assigned a value for the NEWST variable,
sequentially beginning at 100.
data cities(drop=state rename=(newst=state));
set maps.uscity(keep=lat long city state);
length function style color $ 8
position $ 1 text $ 20;
retain function ’label’ xsys ysys ’2’
hsys ’1’ when ’b’ newst 100;
if state=12 and city=’Miami’ or
state=25 and city=’Boston’ or
state=23 and city=’Bangor’;
newst+1; color=’blue’; size=10; text=’T’;
position=’5’;
style=’marker’; x=long*arcos(-1)/180;
y=lat*arcos(-1)/180; output;
newst+1; color=’blue’; size=4;
text=’ ’||city;
position=’6’; style=’swissb’; output;
run;
Create data set ALL by combining data set US48 and data set CITIES.
data all;
set us48 cities;
run;
Project the ALL data set. DATA= specifies the data set to be projected. OUT= specifies the
name of the new projected data set that is created. The ID statement identifies the variable in
the input map data set that defines map areas.
proc gproject data=all
out=allp
1182 References Chapter 39
project=gnomon
polelong=160
polelat=45;
id state;
run;
Separate the projected data set into the CITIESP Annotate data set and the US48P
map data set.
data citiesp us48p;
set allp;
if state>100 then output citiesp;
else output us48p;
run;
Show the annotated map. The CHORO statement displays the projected map and annotates
it using the projected Annotate data set.
proc gmap data=us48p map=us48p all;
id state;
choro state
/ nolegend
annotate=citiesp;
run;
quit;
References
Pearson, F., II (1977), "Map Projection Equations," Report Number TR-3624, Naval
Surface Weapons Center, Dahlgren Laboratory, March, 1977.
Robinson, A.H. (1978), Elements of Cartography, New York: John Wiley & Sons, Inc.
1183
CHAPTER
40
The GRADAR Procedure
Overview 1183
Procedure Syntax 1184
PROC GRADAR Statement 1184
CHART Statement 1185
Examples 1196
Example 1: Generating the Data Set for the GRADAR Examples 1196
Example 2: Producing a Basic Radar Chart 1198
Example 3: Overlaying Radar Charts 1199
Example 4: Tiling Radar Charts 1201
Example 5: Using Multiple Classification Variables in Radar Charts 1202
Example 6: Filling the Stars in Radar Charts 1204
Example 7: Using Images in Radar Charts 1205
Example 8: Changing the Star Type in Radar Charts 1207
Example 9: Using Color and Line Styles in Radar Charts 1208
Example 10: Specifying the Mode for a Radar Chart 1209
Example 11: Assigning Axis Definitions to Axis Spokes 1210
Overview
The GRADAR procedure creates radar (or star) charts that show the relative
frequency of data measures in quality control or market research problems. On a radar
chart, the chart statistics are displayed along spokes that radiate from the center of the
chart (hence the term “star” charts). The charts are often stacked on top of one another
with reference circles, thus giving them the look of a radar screen. By default, the chart
vertices—the points where the statistical values intersect the spokes—are based on the
frequencies associated with the levels of a single numeric variable, but they can be
scored with a weight variable. Non-integer values of the chart variable are truncated to
integers. The measures can be displayed in decreasing order, the order in which they
appear in the input data, increasing order of internal values, or lexicographic order of
variable names.
Note: The Java applet does not support client-side rendering of GRADAR charts. 4
1184 Procedure Syntax Chapter 40
Procedure Syntax
Requirements: At least one CHART statement is required.
AXIS“AXIS Statement” on page 124, FOOTNOTE“TITLE,
Global Statements:
FOOTNOTE, and NOTE Statements” on page 210, GOPTIONS“GOPTIONS Statement”
on page 146, TITLE“TITLE, FOOTNOTE, and NOTE Statements” on page 210
Reminder: The procedure can include the BY, FORMAT, LABEL, and WHERE
statements as well as SAS/GRAPH NOTE statement.
Supports: Output Delivery System (ODS)
Syntax
<GOUT=<libref.>output-catalog>
<ANNOTATE=Annotate-data-set;>
Options
PROC GRADAR statement options affect all graphs produced by the procedure.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GRADAR
procedure. To annotate individual graphs, use ANNOTATE= in the CHART
statement.
See also: SAS/GRAPH Reference, Volumes 1 and 2 for more information on the
Annotate data set
DATA=input-data-set
specifies the SAS data set that contains the variable(s) to chart. By default, the
procedure uses the most recently created SAS data set.
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GRADAR procedure.
CHART Statement
Creates the radar charts in which the length of the vertices along the spines represent the values
of the chart statistic for the data categories.
Requirements: At least one chart variable is required.
Global statements: AXIS, TITLE, FOOTNOTE, and NOTE
Syntax
DESCRIPTION=’entry-description’
DOWN=variable
FONT=font
FREQ=variable
FRAME | NOFRAME
HEIGHT=height
HTML=variable
HTML_LEGEND=variable
IFRAME=fileref | ’external-image-file’
IMAGESTYLE=TILE | FIT
INBORDER
INHEIGHT=value
INTERTILE=value
LAST=’variable’
LSPOKE=linetype
LSTARCIRCLES=(linetypes)
LSTARS=(linetypes)
MAXNVERT=n
MAXVERT=n
MISSING
MODE=SHARE | PROTECT | RESERVE
NAME=’entry-name’
NCOLS=n
NROWS=n
NOFRAME
NOZEROREF
ORDERACROSS=FREQ | DATA | INTERNAL | FORMATTED | EXTERNAL
OTHER=’variable’
OVERLAY=overlay-variable
SPIDER | SPIDERWEB
SPKLABEL=CATEGORY | NONE
STARAXIS = (AXIS<1...99><, . . . ,AXIS<1...99>>)
STARCIRCLES=(values)
STARFILL= lists of (SOLID | EMPTY) one for each star.
STARINRADIUS=value
STARLEGEND=CLOCK | CLOCK0 | NUMBER | DEGREES | NONE
STARLEGENDLAB=’legend-label’
STAROUTRADIUS=value
STARSTART=value
STARTYPE=CORONA | POLYGON | RADIAL | SPOKE | WEDGE
SUMVAR=summary-variable
TILELEGEND=variable
TILELEGLABEL=’label’
WAXIS=n
WEIGHT=numeric-variable
The GRADAR Procedure CHART Statement 1187
WFRAME=n
WSPOKES=n
WSTARCIRCLES=(line-widths)
WSTARS=line-widths | (line-widths)
Required Arguments
chart-variable(s)
specifies one or more variables that define the categories of data to be charted. The
values of the chart variable determine the spokes in the corresponding radar chart.
These values are the observations in the reference data set for the chart variable.
You must have at least three observations in the data set as it takes three points to
define a plane. Technically, you can create a GRADAR chart with only one or two
observations, but a true chart will not display.
Options
Options in a CHART statement affect all graphs produced by that statement. You
can specify as many options as you want and list them in any order.
ACROSS=variable
ACROSSVAR=variable
generates a radar chart for each value of the specified variable, and displays the
charts from left-to-right across the graphics area. If used with the DOWN= option,
the charts are drawn in left-to-right and top-to-bottom order. To limit the number of
columns and/or rows that are displayed, use the NCOLS= and NROWS= options.
Used with the ORDERACROSS= option.
Featured in: Example 4 on page 1201 and Example 5 on page 1202.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate charts produced by the CHART statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
CAXIS=grid-color
CAXES=grid-color
CA=grid-color
specifies a color for the chart frame. The specified color must be a valid SAS/GRAPH
color name. If you omit the CAXIS= option, PROC GRADAR uses the first color in
the colors list as the chart frame’s color.
Not supported by: ActiveX
CFRAME=background-color | (variable)
CFR=background-color | (variable)
fills the frame area with the specified color. You can specify a valid SAS/GRAPH color
name, or a character variable of length eight whose value is the background color.
Featured in: Example 2 on page 1198 and Example 9 on page 1208.
CFRAMESIDE=color | (variable)
specifies the color for filling the frame area for the row labels displayed along the left
side of a chart. The specified color must be a valid SAS/GRAPH color name, or a
character variable of length eight whose value is the background color. If a label is
associated with the classification variable, the specified color is also used to fill the
frame area for this label. By default, these areas are not filled.
1188 CHART Statement Chapter 40
3 If the OVERLAY= option is used, the chart contains multiple stars. In that
case, specify a list of colors in parentheses. Be sure that there are at least as
many colors in the list as there are stars in the chart. If you do not specify
enough colors for each star in the chart to have a separate color, the default
color list is used to assign colors to additional stars. The color for the star
positioned at subgroup n on the chart is the value of the color corresponding to
the color at position n in the list of colors.
By default, the colors in the devices are used, starting with the second color.
Featured in: Example 2 on page 1198 and Example 9 on page 1208.
CTEXT=text-color
specifies a color for all text on the chart. The specified color must be a valid SAS/
GRAPH color name, or a character variable of length eight whose value is the color.
For ActiveX devices, the default color is black. For other devices, if you omit
CTEXT=, PROC GRADAR searches for a color specification in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the first color in the GOPTIONS colors list (the default).
CTILES=(variable) | color
CTILE=(variable) | color
specifies a character variable of length eight whose values are the fill colors for the
tiles in a radar chart. By default, the tiles are not filled. The values of the specified
variable must be identical for all observations with the same level of the
classification variables. The same color can be used to fill more than one tile. Use the
special value, EMPTY, to indicate that a tile is not to be filled.
Alternatively, CTILES= can specify a valid SAS/GRAPH color name to color all the
tiles the same color.
The CTILES= option cannot be used in conjunction with the NOFRAME option or
the CFRAME= option. You can use the TILELEGEND= option in conjunction with
the CTILES= option to add an explanatory legend for the CTILES= colors at the
bottom of the chart.
Not supported by: ActiveX
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
entry-description is 256 characters long. The description does not appear on the
chart. By default, the GRADAR procedure assigns a description of the form RADAR
CHART OF variable, where variable is the name of the chart variable.
The entry-description can include the #BYLINE, #BYVAL, and #BYVAR
substitution options, which work as they do when used on TITLE, FOOTNOTE, and
NOTE statements. The 256-character limit applies before the substitution takes place
for these options; thus, if in the SAS program the entry-description text exceeds 256
characters, it is truncated to 256 characters, and then the substitution is performed.
The descriptive text is shown in the "description" portion of each of the following:
3 the Results window
3 the catalog-entry properties that you can view from the Explorer window
3 the Table of Contents that is generated when you use CONTENTS= on an ODS
HTML statement (assuming the GRADAR output is generated while the
contents page is open)
3 the Description field of the PROC GREPLAY window.
1190 CHART Statement Chapter 40
DOWN=variable
DOWNVAR=variable
generates a radar chart for each value of the specified variable, and displays the
charts from top-to-bottom in the graphics area. If used with the ACROSS= option,
the charts are drawn in left-to-right and top-to-bottom order. To limit the number of
columns and/or rows that are displayed, use the NCOLS= and NROWS= options.
Featured in: Example 5 on page 1202.
FONT=font
specifies the font for all text strings in the radar chart. If you omit FONT=, the font
that is specified by the FTEXT= graphics option is used.
Featured in: Example 7 on page 1205.
FREQ=variable
specifies a frequency variable whose value provides the counts (numbers of
occurrences) of the values of the process variable. Specifying a FREQ= variable is
equivalent to replicating the observations in the input data set. The FREQ= variable
must be a numeric variable with non-negative integer values. If you specify more
than one process variable on the CHART statement, the FREQ= variable values are
used with each process variable. If you do not specify a FREQ= variable, each value
of the process variable is counted exactly once.
Featured in: Example 2 on page 1198.
FRAME | NOFRAME
FRAME (the default) draws a frame around the procedure output area. By default,
the frame color is the first color in the colors list. If you want to specify a different
color for the frame, use the CFRAME= option for a filled frame, and CAXIS= for only
the frame outline color.
NOFRAME suppresses the frame that is drawn around the chart by default. The
NOFRAME option cannot be specified in conjunction with the CFRAME= or
CTILES= options.
Not supported by: ActiveX
HEIGHT=height
HLABEL=height
specifies the height in percent screen units of text for labels and legends. This option
should be used only in conjunction with the FONT= option. The HEIGHT= option
takes precedence over the HTEXT= option in a GOPTIONS statement.
HTML=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. The maximum length for the value of this
variable is 1024 characters.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links in the HTML
file created by the ODS HTML statement. These links are associated with a legend
value and point to the data or graph you wish to display when the user drills down
on the value. The maximum length for the value of this variable is 1024 characters.
IFRAME=fileref | ’external-image-file’
specifies an image file to use on the chart’s frame. Fileref must be a valid SAS fileref
up to eight characters long and must have been previously assigned with a
FILENAME statement. External-image-file must specify the complete file name of
the image file you want to use. The format of external-image-file varies across
operating environments. For more information, see “Placing a Backplane Image on
Graphs with Frames” on page 115.
The GRADAR Procedure CHART Statement 1191
The line types are paired with the circles in the order specified. The default linetype
is 1, which produces a solid line.
LSTARS=(linetypes)
LSTAR=(linetypes)
specifies the line types for the outlines of stars that are produced for a radar chart.
3 If the OVERLAY= option is not used, each chart contains only one star. In that
case, specify a single line type for the star.
3 If the OVERLAY= option is used, the chart contains multiple stars. In that
case, specify a list of line types in parentheses. Be sure that there are at least
1192 CHART Statement Chapter 40
as many line types in the list as there are stars in the chart. The line type for
the star positioned at subgroup n on the chart is the value of the line type
corresponding to the color at position n in the list of line types.
By default, the outlines rotate through different line types and colors. To specify
line colors, use the CSTARS= option.
Featured in: Example 9 on page 1208.
MAXNVERT=n
MAXVERT=n
specifies the maximum number of vertices, from 1 to 360, in the radar chart. Either
spelling of the option is accepted. The MAXNVERT= or MAXVERT= options are for
use with the OTHER= option.
MISSING
accepts a missing value as a valid midpoint for the chart variable. By default,
observations with missing values are ignored. Missing values are always valid for
the overlay variables.
Not supported by: ActiveX
MODE=SHARE | PROTECT | RESERVE
specifies the display mode for a radar chart. The following keywords are available:
SHARE shares the drawing space between the text and the graph.
PROTECT shares the drawing space but maintains a solid rectangle (using
the background color) behind the text. This is useful when the
text is illegible because of the iframe image or cframe color.
RESERVE reduces the size of the text and graph in order to accommodate
both. RESERVE is the default.
Featured in: Example 10 on page 1209.
NAME=’entry-name’
specifies a string, up to 8 characters long. Default: RADAR. The name duplicates an
existing entry name and SAS/GRAPH software adds a number to the duplicate name
to create a unique name—for example, RADAR1.
NCOLS=n
NCOL=n
specifies the number of columns in a chart. You can use the NCOLS= option in
conjunction with the NROWS= option. By default, NCOLS=1 and NROWS=2 if one
classification variable is specified, and NCOLS=2 and NROWS=2 if two classification
variables are specified. If used with the ACROSS= and DOWN= options, the default
number of columns and rows are calculated by the number of classifications for the
variables that are listed on ACROSS= and DOWN=. In that case, you can use
NCOLS= and NROWS= to limit the number of columns and rows that are specified.
Featured in: Example 5 on page 1202.
Not supported by: ActiveX
NOFRAME
suppresses the frame that is otherwise drawn around the chart by default. The
NOFRAME option cannot be specified in conjunction with the CFRAME= or
CTILES= options
NOZEROREF
turns off the zero reference line when negative values are plotted. When a negative
value is plotted, a dashed line indicates the zero position. You can not change the
appearance of this zero reference line, but you can turn it off with the NOZEROREF
option. The zero reference line does not appear if there are no negative values plotted.
The GRADAR Procedure CHART Statement 1193
NROWS=n
NROW=n
specifies the number of rows in a chart. You can use the NROWS= option in
conjunction with the NCOLS= option. See NCOLS= for details. By default,
NROWS=1.
Featured in: Example 5 on page 1202.
Not supported by: ActiveX
ORDERACROSS=FREQ | DATA | INTERNAL | FORMATTED | EXTERNAL
Specifies the display order for the values of the ACROSS=variable.
Not supported by: ActiveX
OTHER=’category’
specifies a new category that merges all categories not selected because of the
MAXNVERT= or MAXVERT= option. The category should be specified as a
formatted value of the process variable. The OTHER= option is applicable only if you
also specify the MAXNVERT= or MAXVERT= option.
OVERLAY=overlay-variable
OVERLAYVAR=overlay-variable
creates a comparative radar chart using the levels of the overlay variable. All charts
are displayed in the same set of spokes. This option cannot be used with the
ACROSS= or DOWN= options.
Featured in: Example 3 on page 1199.
SPIDERWEB | SPIDER
displays lines connecting the points where tick marks would be instead of displaying
the tick marks, using the same number of points for all axes as for the first axis. The
default number of web lines is three.
If there is an axis statement along with the SPIDERWEB option, then the web
gets its values such as number, thickness, and color from the MAJOR=() values for
the axis drawn at the first position (default is 12 o’clock).
SPKLABEL=CATEGORY | NONE
labels the chart spokes with the category of the variable that is being charted.
NONE suppresses the labels. The default is CATEGORY; however, if the
STARLEGEND= option is specified, the default is NONE.
STARAXIS= (AXIS<1...99><, . . . ,AXIS<1...99>>)
STARAXES= (AXIS<1...99><, . . . ,AXIS<1...99>>)
assigns one or more axis definitions to the axis spokes in the radar chart. GRADAR
displays axis spokes clockwise, starting at the 12 o’clock position. The axis
definitions that are specified using the STARAXIS= option are assigned consecutively
to the spokes, starting from the first spoke. For example, STARAXIS=(AXIS3, AXIS1,
AXIS2) assigns the AXIS3 statement’s definition to the first axis spoke (at the 12
o’clock position), the AXIS1 statement’s definition to the second axis spoke, and the
AXIS2 statement’s definition to the third axis spoke.
The axis definitions are assigned consecutively, and you cannot skip a spoke. For
example, to assign a definition to the seventh spoke, you must also assign definitions
to the first six spokes. However, you do not have to assign definitions to all of the
spokes. Any remaining axis spokes on the GRADAR chart are displayed with the
default settings. For example, if the STARAXIS= option specifies three definitions
and the chart has more than three axis spokes, the fourth and remaining spokes are
displayed with the default settings. If there are more definitions specified than there
are axis spokes in the chart, the excess definitions are ignored.
Featured in: Example 11 on page 1210.
Not supported by: ActiveX
1194 CHART Statement Chapter 40
STARCIRCLES=(values)
STARCIRCLE=(values)
specifies reference circles that are superimposed on the stars that are produced for a
radar chart. All of the circles are displayed and centered at each point plotted on the
primary chart. The value determines the diameter of the circle as follows: a value of
0.0 specifies a circle with the inner radius, which displays a circle at the minimum
data value, and a value of 1.0 specifies a circle with the outer radius, which is the
length of the spokes in the chart. In general, a value of h specifies a circle with a
radius equal to inradius + h ( outradius - inradius).
For example, the values 0.0 and 1.0 correspond to an inner circle and an outer
circle. The value 0.5 specifies a circle with a radius of inradius + 0.5 ( outradius -
inradius), or a circle halfway between the inner circle and the outer circle. Likewise,
the value 0.25 specifies a circle one-fourth of the way from the inner circle to the
outer circle.
To specify the line types for the circles, use the LSTARCIRCLES= option. To
specify colors for the circles, use the CSTARCIRCLES= option.
Featured in: Example 3 on page 1199.
STARFILL= lists of (SOLID | EMPTY) one for each star
determines whether the star(s) in the radar chart are empty or filled with a solid
color. Valid values are EMPTY (the default) and SOLID. If there are multiple stars
in the chart, specify, in parentheses, a separate value for each star.
If STARFILL=SOLID and CSTARFILL= is not specified, then the star is filled
with the color specified on the CSTARS= option.
If STARFILL= is not set or is set to EMPTY, then CSTARFILL= is ignored.
Featured in: Example 6 on page 1204.
STARINRADIUS=value
STAROUTRADIUS=value
STARINRADIUS= specifies inner radius of stars. The value must be specified in
horizontal percent screen values, and it must be less than the value that is specified
with the STAROUTRADIUS= option. The inner radius of a star is the distance from
the center of the star to the circle that represents the lower limit of the standardized
vertex variables. The lower limit can correspond to the minimum value, a multiple of
standard deviations below the mean, or a lower specification limit. The default value
is one-third of the outer radius.
Not supported by: ActiveX
STARLEGEND=CLOCK | CLOCK0 | NUMBER | DEGREES | NONE
specifies the style of the legend used to identify the vertices of stars that are
produced for a radar chart. The following keywords are available:
CLOCK identifies the vertex variables by their positions on the clock
(starting with 12:00).
CLOCK0 identifies the vertex variables by their positions on the clock
(starting with 0:00 corresponding to 12:00).
NUMBER identifies the vertex variables by numbers, with 1 corresponding
to 12 o’clock.
DEGREES identifies the vertex variables by angles in degrees, with 0
degrees corresponding to 12 o’clock.
NONE suppresses the legend. This is the default.
Featured in: Example 4 on page 1201.
STARLEGENDLAB=’legend-label’
The GRADAR Procedure CHART Statement 1195
specifies the label displayed to the left of the legend for stars requested with the
STARLEGEND= option. The label can be up to 16 characters and must be enclosed
in quotes. The default label is Vertices:.
Featured in: Example 4 on page 1201.
Not supported by: ActiveX
STARSTART=value
specifies the vertex angle for the first variable that is specified on the CHART
statement. Vertex angles for the remaining variables are uniformly spaced clockwise
and assigned in the order listed. You can specify the value in the following ways:
3 Clock position: If you specify the value as a time literal (between ’0:00’T and
’12:00’T), the corresponding clock position is used for the first vertex variable.
For example, ’12:00’T indicates the 12 o’clock position, ’03:00’T the 3 o’clock
position (90 degrees), and ’09:00’T the 9 o’clock position (270 degrees).
3 Degrees:To specify a value in degrees you must specify a negative number. (This
is to distinguish degrees from clock values, which are stored internally as
positive numbers.) If you specify a negative number, the absolute value is used
for the first vertex angle in degrees. Here, 0 degrees corresponds to 12:00, −90
degrees to 3:00, and −270 degrees to 9:00. Always specify the value in degrees
as a negative number.
The default value is zero, so the first vertex variable is positioned at 12:00.
STARTYPE=CORONA | POLYGON | RADIAL | SPOKE | WEDGE
specifies the style of the stars that are produced for a radar chart. The following
keywords are available:
CORONA polygon with star-vertices emanating from the inner circle
POLYGON closed polygon
RADIAL rays emanating from the center
SPOKE rays emanating from the inner circle
WEDGE closed polygon with rays from the center to the full spoke length
(this is the default).
Featured in: Example 5 on page 1202 and Example 8 on page 1207.
SUMVAR=summary-variable
specifies the variable used to calculate the sum or means.
TILELEGEND=variable
specifies a variable used to add a legend for CTILES= colors. The variable can have a
formatted length less than or equal to 32. If a format is associated with the variable,
then the formatted value is displayed. The TILELEGEND= option must be used in
conjunction with the CTILES= option for filling the tiles in a chart. If CTILES= is
specified and TILELEGEND= is not specified, a color legend is not displayed.
The values of the CTILES= and TILELEGEND= variables should be consistent for
all observations with the same level of the classification variables. The value of the
TILELEGEND= variable is used to identify the corresponding color value of the
CTILES= variable in the legend.
Not supported by: ActiveX
TILELEGLABEL=’label’
specifies a label displayed to the left of the legend that is created when you specify a
TILELEGEND= variable. The label can be up to 16 characters and must be enclosed
in quotes. The default label is Tiles:.
Not supported by: ActiveX
1196 Examples Chapter 40
WFRAME=n
WAXIS=n
specifies the width in pixels for the frame lines. The default width is 1.
Not supported by: ActiveX
WEIGHT=numeric-variable
specifies a weight variable used to construct weighted radar charts. The WEIGHT=
variable must be numeric, and its values must be non-negative (non-integer values
are permitted). If a WEIGHT= variable is not provided for a chart variable, the
weights applied to that chart variable are assumed to be 1.
Not supported by: ActiveX
WSPOKES=line-width
WSPOKE=line-width
specifies the width in pixels of the spokes in a radar chart. The default width is 1.
WSTARCIRCLES=(line-widths)
WSTARCIRCLE=(line-widths)
specifies the width in pixels of the outline of circles requested by the STARCIRCLES=
option. The default width is 1. Works only if STARCIRCLES is specified.
WSTARS=line-width | (line-widths)
WSTAR=line-width | (line-widths)
specifies the width in pixels of the outline of stars that are produced for a radar
chart. The default width is 1.
Featured in: Example 3 on page 1199.
Examples
All of the GRADAR procedure examples in this help system use the data from this
SAS code. You must submit this code before you can run any of the other examples for
GRADAR.
During the manufacture of a metal-oxide semiconductor (MOS) capacitor, different
cleaning processes were used by two manufacturing systems that were operating in
parallel. Process A used a standard cleaning solution, while Process B used a different
cleaning mixture that contained less particulate matter. For five consecutive days the
causes of failure with each process were observed, recorded, and saved in the SAS data
set called FAILURE.
data failure;
label cause = ’Cause of Failure’ ;
input process $ 1-9 day $ 13-19 cause $ 23-36 count 40-41;
datalines;
Process A March 1 Contamination 15
Process A March 1 Corrosion 2
The GRADAR Procedure Example 1: Generating the Data Set for the GRADAR Examples 1197
In a radar chart, the vertices are determined by the levels of a single variable, which
is specified on the CHART statement. In this example, the variable CAUSE is specified
as the chart variable. The spokes in the chart start at the twelve o’clock position and go
in a clockwise order. The output shows that Contamination and Oxide Defects are the
most frequently occurring problems.
This example features the following options:
3 FREQ= specifies variable COUNT to score vertex lengths. Thus, the values of
COUNT weigh the contribution of each observation in the computation of the chart
statistic.
3 CSTARS= specifies a color for the star’s outline.
3 CFRAME= specifies a color to use to fill the chart’s axis area.
To run the code in this example, you must first generate the FAILURE data setExample
1 on page 1196.
The most typical way that radar charts are displayed is to overlay the charts on top
of each other. To produce an overlay chart, use the OVERLAY= option on the CHART
statement. On OVERLAY=, specify a classification variable whose values will
determine the charts to be overlaid. This example shows two blocks of code. The first
block generates a simple overlay chart, and the second block uses options to enhance
the chart appearance.
In the following example, OVERLAY= specifies variable DAY as the overlay variable.
To run the code in this example, you must generate the FAILURE data set Example 1
on page 1196.
proc gradar data=failure;
chart cause / freq=count
overlay=day;
run;
quit;
1200 Example 3: Overlaying Radar Charts Chapter 40
The code above relies on default settings. You can enhance a chart by specifying
additional options. The code below specifies variable PROCESS as the overlay variable
and features the following options:
3 STARCIRCLES= determines that two reference circles are superimposed on the
star charts. The value 1.0 determines that a circle with a radius equal to the
spoke length is displayed. The value 0.5 determines that a circle is displayed half
way between the outer circle and the smallest circle (value 0.0) that could be
drawn for the chart. The value 0.0 would display a circle at the minimum data
value, which does not mean that it is actually 0. For example, for data values of 4,
8, 10, and 12, STARCIRCLES=(0.0 1.0) would draw circles at 4 and 12.
3 CSTARCIRCLES= determines that both circles are colored black. If this option
were not used, both stars would be colored with the first color that is listed on
CSTARS=.
3 CSTARS= determines that the first star, which represents Process A, is colored
red, and that the second star, which represents Process B, is colored blue.
3 WSTARS= specifies pixel widths for the outlines of both stars. A separate width is
required for each star.
You can study the effects of two classifications simultaneously with a two-way
comparative radar chart. This arrangement provides the opportunity to discover both
one-way marginal effects and interaction effects. To produce the chart, use both the
ACROSS= and DOWN= options.
The GRADAR Procedure Example 5: Using Multiple Classification Variables in Radar Charts 1203
By default, the stars in a radar chart are empty. To fill the stars with a solid color,
use STARFILL=SOLID. When the stars are solid filled, the outline of each underlying
star and the spokes in the chart are drawn on top of the stars so that each chart can be
easily seen.
This example features the following options:
3 STARFILL= specifies a solid fill for each of the two stars that are generated by the
program. Because the default fill is EMPTY, STARFILL= must specify SOLID two
times; otherwise, the first star would be solid filled, but the second star would be
empty.
3 CSTARFILL= specifies colors for the two stars.
To run the code in this example, you must generate the FAILURE data set Example 1
on page 1196.
proc gradar data=failure;
chart cause / overlay=process
freq=count
cstarfill=(red blue)
starfill=(solid solid)
cframe= ltgray;
The GRADAR Procedure Example 7: Using Images in Radar Charts 1205
run;
quit;
In this next block of code, the image is displayed in the radar chart’s frame, so only
GRADAR options are used to specify the image. The code features the following options:
3 IFRAME= specifies the image file to display in the frame.
3 IMAGESTYLE= specifies that the image be scaled to fit within the frame.
3 FONT= specifies a font for all of the chart text so that it can be easily seen against
the background image.
font=centb;
run;
quit;
By default, the stars in a radar chart are displayed as wedges. You can specify an
alternative style with the STARTYPE= option. This example specifies
STARTYPE=CORONA.
To run the code in this example, you must generate the FAILURE data setExample 1
on page 1196.
freq=count
startype=corona;
run;
quit;
For overlay charts with multiple stars, the lines for the stars are rotated through
different line styles and colors so that the different stars can be easily seen. Rather
than relying on the default rotation patterns, you can control the line colors and line
styles with the CSTARS= and LSTARS= options.
This example features the following options:
3 CSTARS= specifies a different color for each of the star outlines in the chart. In
this example the colors are specified as hexadecimal values, but you can use any
valid SAS/GRAPH color names.
3 LSTARS= specifies a solid line as the line style for each star outline.
3 CFRAME= specifies a background color to display on top of the image that is
specified on the GOPTIONS statement’s IBACK= option.
To run the code in this example, you must generate the FAILURE data set Example 1
on page 1196.
The GRADAR Procedure Example 10: Specifying the Mode for a Radar Chart 1209
The MODE= option specifies the display mode for a radar chart. If a radar chart is
generated without the MODE= option set, the labels are sometimes too small and
illegible. This example uses the SHARE= keyword, which is one of three keywords
available for the MODE= option. The SHARE= keyword shares the drawing space
1210 Example 11: Assigning Axis Definitions to Axis Spokes Chapter 40
between the text and the graph. The result is that the text is enlarged and becomes
legible.
To run the code in this example, you must generate the FAILURE data set Example
1 on page 1196.
proc gradar data=failure;
chart cause / across=process
mode=share
freq=count
;
run;
quit;
The STARAXIS= option allows you to assign axis definitions to spokes in a radar
chart. In this example, three axis defintions are specified. However, there are seven
spokes in the radar chart. Spokes one and three are colored the same because they both
use the definition axis1. Spoke two uses the definition axis3. Spoke 4 uses the
definition axis2, and spokes five through seven receive the default settings.
The GRADAR Procedure Example 11: Assigning Axis Definitions to Axis Spokes 1211
To run the code in this example, you must generate the FAILURE data set Example
1 on page 1196.
axis1 color=red
label=(’weight’)
major=(height=.75 width=3)
width=3;
axis2 color=blue
label=(’height’);
axis3 color=green;
CHAPTER
41
The GREDUCE Procedure
Overview 1213
Concepts 1215
About the Input Map Data Set 1215
About Unmatched Area Boundaries 1215
Procedure Syntax 1215
PROC GREDUCE Statement 1216
ID Statement 1217
Using the GREDUCE Procedure 1218
Specifying Density Levels 1218
Subsetting a Map Data Set 1220
Examples 1220
Example 1: Reducing the Map of Canada 1220
References 1222
Overview
The GREDUCE procedure processes map data sets so that they can draw simpler
maps with fewer boundary points. It creates an output map data set that contains all of
the variables in the input map data set plus a new variable named DENSITY. For each
observation in the input map data set, the procedure determines the significance of that
point for maintaining a semblance of the original shape and gives the observation a
corresponding DENSITY value.
You can then use the value of the DENSITY variable to create a subset of the
original map data set. The observations in the subset can draw a map that retains the
overall appearance of the original map but contains fewer points, requires considerably
less storage space, and can be drawn much more quickly.
GREDUCE does not produce any graphics output. Instead, it produces an output
map data set that can become either
3 the input map data set for the GMAP procedure
3 the input map data set for a DATA step that removes points from the map.
Figure 41.1 on page 1214 and Figure 41.2 on page 1214 illustrate the effect of
reduction on a typical map data set. Figure 41.1 on page 1214 uses observations with
all DENSITY values as input to the GMAP procedure.
1214 Overview Chapter 41
Figure 41.2 on page 1214 uses only those observations with a DENSITY value of 0 or
2 as input to the GMAP procedure.
Concepts
See “About Map Data Sets” on page 999 for additional information on map data sets.
Procedure Syntax
Requirements: Exactly one ID statement is required.
Reminder: The procedure can include the BY statement.
ID id-variable(s);
Syntax
PROC GREDUCE <option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 data set options:
DATA=input-map-data-set
OUT=output-map-data-set
3 level options:
E1=min-distance
E2=min-distance
E3=min-distance
E4=min-distance
E5=min-distance
N1=max-points
N2=max-points
N3=max-points
N4=max-points
N5=max-points
Options
DATA=input-map-data-set
identifies the map data set that you want to process. By default, the procedure uses
the most recently created SAS data set.
See also: “About the Input Map Data Set” on page 1215and “SAS Data Sets” on
page 29.
E1=min-distance
E2=min-distance
E3=min-distance
E4=min-distance
E5=min-distance
specify the minimum distance that a point must lie from a straight line segment to
be included at density level 1, 2, 3, 4, or 5, respectively. That is, in a reduced curve of
three points, the middle point is at least a distance that is min-distance from a
straight line between the two outside points.
The GREDUCE Procedure ID Statement 1217
Express min-distance values in the units for the coordinate system of the input
map data set. For example, if the input map data set contains coordinates that are
expressed in radians, express the min-distance values in radians.
Specify the En= values in decreasing order. For example, the E2= value should be
less than the E1= value and so on.
N1=max-points
N2=max-points
N3=max-points
N4=max-points
N5=max-points
specify that for density level 1, 2, 3, 4, or 5, the boundary of a unit area should
contain no more than max-points points.
Specify the Nn= values in increasing order. For example, the N2= value should be
greater than or equal to the N1= value and so on.
By default, if you omit Nn= and En = , the GREDUCE procedure calculates values
for the five Nn = parameters using this formula:
Nn = n2 Nmax=36
Here Nmax is the maximum number of points in any unit area in the input map
data set. However, the restriction that the number of points for any level cannot be
less than the number of points in level 0 still applies.
OUT=output-data-set
names the new map data set, which contains all of the observations and variables in
the original map data set plus the new DENSITY variable. If the input map data set
contains a variable named DENSITY, the GREDUCE procedure replaces the values
of the variable in the output map data set. The original values of the DENSITY
variable from the input map data set are not included in the output map data set.
By default, the GREDUCE procedure names the new data set that uses the
DATAn naming convention. That is, the procedure uses the name WORK.DATAn,
where n is the next unused number in sequence. Thus, the first automatically named
data set is DATA1, the second is DATA2, and so on.
ID Statement
Identifies the variable or variables that define the hierarchy of the current unit areas in the input
map data set.
Requirements: At least one id-variable is required.
Featured in: Example 1 on page 1220.
Syntax
ID id-variable(s);
1218 Using the GREDUCE Procedure Chapter 41
Required Arguments
id-variable(s)
specifies one or more variables in the input map data set that identify unit areas.
Id-variable(s) can be either numeric or character.
Each group of observations with a different ID variable value is evaluated as a
separate unit area.
GREDUCE uses the usual Euclidean distance formula to determine the distance
between points. For example, the distance d between the points (x0,y0) and (x1,y1) is
GREDUCE uses the usual Euclidean distance formula to determine the distance
between points. For example, the distance d between the points (x0,y0) and (x1,y1) is
d= (x1 x0 )2 + (y1 y0 )2
If this distance function is not suitable for the coordinate system in your input map
data set, transform the X and Y values to an appropriate coordinate system before
using GREDUCE. An example of inappropriate coordinates is latitude and longitude
values around one of the poles. In this case, the data values should be projected before
they are reduced. See Chapter 39, “The GPROJECT Procedure,” on page 1161 for more
information on map projection.
If you specify both Nn= and En= values for a density level, GREDUCE attempts to
satisfy both criteria. However, the number of points for any level is never reduced
below the number of points in density level 0. If you specify a combination of Nn= or
En= values such that the resulting DENSITY values are not in order of increasing
1220 Subsetting a Map Data Set Chapter 41
density, a note is printed in the SAS log, and the DENSITY values are calculated in
increasing order of density.
Note: GREDUCE does not reduce the size of the output map data set compared to
the input map data set. By default, the output map data set from PROC GREDUCE
will be larger than the input map data set because it contains all of the variables and
observations from the original data set, with the addition of the DENSITY variable if it
was not present in the original data set. If the input map data set already had a
DENSITY variable, the output map data set will be the same size as the input map
data set. 4
Examples
The following example illustrates major features of the GREDUCE procedure.
Because the example uses one of the map data sets that are supplied with SAS/GRAPH
, you may need to replace SAS-data-library in the LIBNAME statement with the actual
location of the SAS data library that contains the Institute-supplied map data sets on
your system. Contact your SAS Software Consultant for the location of the map data
sets at your site. If your site automatically assigns the libref MAPS to the SAS data
library that contains the Institute-supplied map data sets, delete the LIBNAME
statement in this example.
In this example, the GREDUCE procedure creates the DENSITY variable for the
CANADA2 map data set that is provided with SAS/GRAPH . First, the map is
displayed at its original density by using the GMAP procedure. Second, the map is
displayed by using density values of 0 to 2.
Show the unreduced map. The ID statement specifies the variable in the map data set that
defines unit areas.
proc gmap map=maps.canada2 data=maps.canada2 all;
id province;
choro province / nolegend;
run;
The GREDUCE procedure creates a new map data set, CAN2, containing a DENSITY
variable. The ID statement specifies the variable in the map data set that defines unit areas.
Show reduced map with density levels 0-2. WHERE= selects map coordinates with the
appropriate DENSITY values.
References
Douglas, D.H. and Peucker, T.K. (1973), "Algorithms for the Reduction of the Number
of Points Required to Represent a Digitized Line or Its Caricature," The Canadian
Cartographer, 10, 112–122.
1223
CHAPTER
42
The GREMOVE Procedure
Overview 1223
Concepts 1224
About the Input Map Data Set 1224
About the Output Map Data Set 1225
About Unmatched Area Boundaries 1225
Procedure Syntax 1226
PROC GREMOVE Statement 1226
BY Statement 1227
ID Statement 1228
Examples 1228
Example 1: Removing State Boundaries from U.S. Map 1228
Example 2: Creating an Outline Map of Africa 1232
Overview
The GREMOVE procedure processes a map data set that is used as input. It does
not produce any graphics output. Instead, it produces an output data set that typically
becomes the input map data set for the GMAP procedure (see Chapter 35, “The GMAP
Procedure,” on page 995). The GREMOVE procedure combines unit areas defined in a
map data set into larger unit areas by removing shared borders between the original
unit areas. For example, Figure 42.1 on page 1224 and Figure 42.2 on page 1224 show
combined unit areas in a typical map data set by removing state boundaries to create
regional census divisions.
1224 Concepts Chapter 42
Concepts
The GREMOVE procedure processes the input map data set to remove internal
boundaries and creates a new map data set. The PROC GREMOVE statement
identifies the input and output map data sets. The ID statement identifies the variable
or variables in the input map data set that define the current unit areas. The BY
statement identifies the variable or variables in the input map data set that define the
new unit areas.
3 a numeric variable named X that contains the horizontal coordinates of the map
boundary points.
3 a numeric variable named Y that contains the vertical coordinates of the map
boundary points.
3 one or more variables that uniquely identify the current unit areas in the map.
These variables are listed in the ID statement. Each group of observations with a
different ID variable value is evaluated as a separate unit area.
3 one or more variables that identify the new unit areas to be created in the output
map data set. These variables are listed in the BY statement.
It may also contain the variable SEGMENT, which is used to distinguish
non-conterminous segments of the same unit areas. Other variables may exist in the
input map data set, but they do not affect the GREMOVE procedure and they will not
be carried into the output map data set.
Procedure Syntax
Requirements: The BY and ID statements are required.
Syntax
Options
DATA=input-map-data-set
specifies the map data set that is to be processed. By default, the procedure uses the
most recently created SAS data set. The GREMOVE procedure expects the
observations in the input map data set to be sorted in ascending order of the
BY-variable values.
See also: “About the Input Map Data Set” on page 1224 and “SAS Data Sets” on
page 29.
Featured in: Example 2 on page 1232.
OUT=output-data-set
names the new map data set, which contains the coordinates of the new unit areas
created by the GREMOVE procedure. By default, the GREMOVE procedure names
the new data set using the DATAn naming convention. That is, the procedure uses
the name WORK.DATAn, where n is the next unused number in sequence. Thus, the
first automatically named data set is DATA1, the second is DATA2, and so on.
See also: “About the Output Map Data Set” on page 1225.
Featured in: Example 2 on page 1232.
The GREMOVE Procedure BY Statement 1227
BY Statement
Lists the variable or variables that identify the new unit areas.
Requirements: At least one variable is required.
See also: “BY Statement” on page 141.
Featured in: Example 1 on page 1228.
Syntax
BY <DESCENDING>variable-l
<...< DESCENDING>variable-n>
<NOTSORTED>;
Required Arguments
variable(s)
identifies one or more variables in the input map data set that define the new unit
areas. Variable(s) can be either numeric or character.
The BY variables in the input map data set become the ID variables for the output
map data set.
Options
DESCENDING
indicates that the input map data set is sorted in descending order. By default, the
GREMOVE procedure expects all BY-variable values to appear in ascending order.
This option affects only the variable that immediately follows the option.
NOTSORTED
indicates that observations with the same BY-variable values are to be grouped as
they are encountered without regard for whether the values are in alphabetical or
numerical order. NOTSORTED can appear anywhere in the BY statement. It affects
all of the variables that are specified in the statement. NOTSORTED overrides
DESCENDING if both appear in the same BY statement.
Ordering Observations
To sort the input map data set, use the SORT procedure in base SAS, for example
/* arrange the observations in desired order */
proc sort data=mapdata out=mapsort;
by state;
run;
/* remove the county boundaries */
proc gremove data=mapsort out=newmap;
by state;
id county;
run;
1228 ID Statement Chapter 42
Notice that the GREMOVE procedure uses the same BY statement as the SORT
procedure.
See the Base SAS Procedures Guide for further information on the SORT procedure.
Note: If an observation is encountered for which the BY-variable value is out of the
proper order, the GREMOVE procedure stops and issues an error message. 4
ID Statement
Identifies the variable or variables that define the hierarchy of the current unit areas in the input
map data set.
Requirements: At least one id-variable is required.
Featured in: Example 1 on page 1228.
Syntax
ID id-variable(s);
Required Arguments
id-variable(s)
specifies one or more variables in the input map data set that identify the unit areas
to be combined. These variables are not included in the output map data set.
Id-variable(s) can be either numeric or character.
See also: “About the Input Map Data Set” on page 1224.
Examples
The following examples illustrate major features of the GREMOVE procedure.
This example processes the MAPS.US map data set, supplied with SAS/GRAPH, to
produce a new map data set containing boundaries for the U.S. Bureau of the Census
divisions. Because the MAPS.US map data set does not contain a variable to identify
any unit area other than states, this example creates a map data set that contains the
census divisions and that can be processed with the GREMOVE procedure.
The STATE variable in the MAPS.US data set, containing numeric FIPS codes for
each state, is used as the BY-variable to merge the CBSTATES and MAPS.US data
sets. Output 42.1 shows the variables that are present in the data set before using the
GREMOVE procedure:
1 1 1 0.16175 -0.10044
2 1 1 0.12305 -0.10415
3 1 1 0.12296 -0.10678
.
.
.
1524 56 1 -0.18757 0.15035
1525 56 1 -0.10158 0.13997
1526 56 1 -0.10398 0.11343
And Figure 42.3 on page 1229 shows the map before processing:
Output 42.2 shows the variables that are present in the data set after you use the
GREMOVE procedure. Notice that the new map data set contains a new variable called
DIVISION:
1230 Example 1: Removing State Boundaries from U.S. Map Chapter 42
1 0.29825 0.17418 1 1
2 0.29814 0.17820 1 1
3 0.30206 0.18045 1 1
.
.
.
1082 -0.18715 -0.16010 8 9
1083 -0.18747 -0.15971 8 9
1084 -0.18747 -0.15951 8 9
Figure 42.4 on page 1230 shows the new map after PROC GREMOVE has removed
interior state boundaries.
Assign the libref and set the graphics environment. If the libref MAPS is already
assigned, omit the LIBNAME statement.
Create data set CBSTATES. This data set includes a variable, DIVISION, that contains the
number of the U.S. Bureau of the Census division for the state. This data step converts letter
codes to numeric FIPS codes that match those in the STATE variable of MAPS.US.
data cbstates;
length state 8 stcode $ 2 division 4;
input stcode division;
The GREMOVE Procedure Example 1: Removing State Boundaries from U.S. Map 1231
state=stfips(stcode);
drop stcode;
datalines;
CT 1
MA 1
...more data lines...
OR 9
WA 9
;
Sort data set in FIPS-code order. Create a sorted data set, CBSORT. It can be properly
match-merged with the MAPS.US map data set, which is already sorted in FIPS-code order.
Add DIVISION variable to map data set by merging the CBSORT data set with
MAPS.US. Create a new map data set, USCB, that contains all of the state boundary
coordinates from the MAPS.US data set plus the added variable DIVISION.
data uscb;
merge cbsort maps.us;
by state;
run;
Sort data set in DIVISION order. Sort USCB by the DIVISION variable to create the
DIVSTATE data set.
Remove interior boundaries within divisions. BY specifies the variable, DIVISION, in the
input map data set that identifies the new unit areas. ID specifies the variable, STATE, in the
input map data set that identifies the current unit areas.
Show the regional map. ID specifies the variable, DIVISION, that identifies the unit areas in
the processed data set. CHORO specifies DIVISION as the response variable.
This example processes the MAPS.AFRICA map data set, supplied with SAS/
GRAPH, to produce a new map data set that contains no internal boundaries. This is
done by adding a new variable, REGION, to the map data set and setting it equal to 1.
Unit areas from the input map data set that have the same BY-variable value are
combined into one unit area in the output map data set. Output 42.3 shows the
variables present in the original map data set:
The GREMOVE Procedure Example 2: Creating an Outline Map of Africa 1233
The new AFRICA map data set is created with a new variable, REGION. Output
42.4 shows the variables that are present in the new map data set created by the
GREMOVE procedure:
1 0.24826 1.02167 1 1
2 0.25707 1.02714 1 1
3 0.26553 1.03752 1 1
.
.
.
982 1.19071 1.30043 3 1
983 1.18675 1.30842 3 1
984 1.18518 1.32822 3 1
1234 Example 2: Creating an Outline Map of Africa Chapter 42
Figure 42.6 on page 1234 shows the new map after PROC GREMOVE has removed
all of the interior boundaries:
Create the NEWAF data set. This new map data set contains all the variables in the SAS/
GRAPH supplied MAPS.AFRICA map data set plus the added variable REGION.
data newaf;
set maps.africa;
region=1;
run;
Remove the unit areas from the AFRICA data set. DATA= specifies the input map data set
and OUT= specifies the output map data set. The input map data set has a variable called
REGION that is used as the BY-variable to identify the new unit areas. The ID statement
specifies the current unit areas from the input map data set.
Display the map with no boundaries. ID specifies the variable, REGION, that identifies the
unit areas in the processed data set.
CHAPTER
43
The GREPLAY Procedure
Overview 1238
Concepts 1239
About Catalog Entries 1239
Duplicate Entry Names 1240
Ways to Use the GREPLAY Procedure 1241
Windowing Environment 1241
Code-based Statements 1241
Procedure Syntax 1242
PROC GREPLAY Statement 1243
? Statement 1246
BYLINE Statement 1247
CC Statement 1247
CCOPY Statement 1247
CDEF Statement 1248
CDELETE Statement 1249
CMAP Statement 1250
COPY Statement 1250
DELETE Statement 1251
DEVICE Statement 1251
FS Statement 1252
GOUT Statement 1252
GROUP Statement 1252
IGOUT Statement 1253
LIST Statement 1253
MODIFY Statement 1254
MOVE Statement 1255
NOBYLINE Statement 1256
PREVIEW Statement 1256
QUIT Statement 1256
REPLAY Statement 1257
TC Statement 1257
TCOPY Statement 1258
TDEF Statement 1259
TDELETE Statement 1262
TEMPLATE Statement 1262
TREPLAY Statement 1263
Using the GREPLAY Procedure 1264
Using the GREPLAY Windows 1264
GREPLAY Window Commands 1264
PROC GREPLAY Window 1265
PRESENTATION Window 1265
1238 Overview Chapter 43
Overview
The GREPLAY procedure displays and manages graphics output that is stored in
SAS catalogs. The GREPLAY procedure also creates templates and color maps that you
can use when you replay your graphics output. The GREPLAY procedure operates in
both windowing and line-mode environments.
With the GREPLAY procedure, you can
3 select one or more catalog entries from the same catalog for replay and route them
to your display or other devices, such as plotters and printers.
3 use, create, or modify templates. You can use templates to describe positioning on a
single display for the graphics output that is stored in one or more catalog entries.
3 use, create, or modify color maps. Color maps enable you to change the colors in
graphics output by mapping existing colors to new colors.
3 manage entries in SAS catalogs by
3 creating logical groupings of catalog entries that contain graphics output
3 renaming, deleting, or copying catalog entries that contain graphics output,
templates, and color maps
3 rearranging catalog entries that contain graphics output.
3 create new graphics output by replaying one or more catalog entries into panels
within a template.
Figure 43.1 on page 1239 shows four catalog entries that were replayed into a
template and displayed as a single graph.
The GREPLAY Procedure About Catalog Entries 1239
Concepts
Note: Image entries may exist in the catalog but are not recognized by PROC
GREPLAY. 4
You can store all of the previous entry types in a single SAS catalog, or you can store
them in separate catalogs and use a different catalog for each type of entry. A single
SAS catalog may contain graphics output, color maps, and templates.
Because the GREPLAY procedure operates on catalog entries, you must assign at
least one catalog before you can perform any tasks. The GREPLAY procedure has
several ways to assign the catalogs, as shown in Table 43.1 on page 1240.
In addition, you can assign a current template, which you can use when you replay
graphics output, and a current color map, which you can use to remap colors when you
replay graphics output. To assign the current template, use one of the following:
3 the TEMPLATE= option in the PROC GREPLAY statement
3 the TEMPLATE statement
3 the Template field in the PROC GREPLAY window.
To assign the current color map, use one of the following:
3 the CMAP= option in the PROC GREPLAY statement
3 the CMAP statement
3 the Cmap field in the PROC GREPLAY window.
TITLEONE to a catalog that already contains an entry with that name, the
procedure assigns the name TITLEON1 to the copied entry.
3 Template entries that contain individual entries will reserve the individual entry
names as well as the template entry name.
The GREPLAY procedure uses the same technique for the names of entries that
contain graphics output that is produced by the template facility.
Windowing Environment
To invoke the GREPLAY windows, submit the PROC GREPLAY statement without
the NOFS option, as follows:
proc greplay;
run;
SAS/GRAPH then opens the PROC GREPLAY window. For more information, see
“Using the GREPLAY Procedure” on page 1264.
If you are in a windowing environment, you can switch between the windows and
code-based statements while you run the procedure. See the “FS Statement” on page
1252 and the NOFS window command in the SAS Help facility.
Code-based Statements
If you do not use the GREPLAY windows, you can use code-based statements to
replay or manage the catalog entries. The GREPLAY procedure automatically uses
code-based statements if you do not have a windowing device or if you are running the
GREPLAY procedure in a batch environment. To use the GREPLAY procedure with
code-based statements on a windowing device, submit the PROC GREPLAY statement
with the NOFS option as follows:
proc greplay nofs;
Once you submit the PROC GREPLAY statement, you can enter and submit
statements and run them without re-entering the PROC GREPLAY statement.
You can exit the GREPLAY procedure with code-based statements in two ways:
3 submit the END, QUIT, or STOP statement
3 submit another PROC statement or DATA step.
1242 Procedure Syntax Chapter 43
Procedure Syntax
Requirements: Use statements other than the PROC GREPLAY statement only in a
nonwindowing or batch environment, or with the NOFS option. In these environments
at least one additional statement is required.
Note: You must have write access to a catalog in order to modify, add, or delete device
entries. Only GRSEG entry types may be replayed with the GREPLAY procedure.
Supports: RUN-group processing Output Delivery System (ODS)
Syntax
PROC GREPLAY <BYLINE>
<CC=color-map-catalog>
<CMAP=color-map-entry>
<FS>
<GOUT=<libref.>output-catalog>
<IGOUT=<libref.>input-catalog>
<IMAGEMAP=output-data-set>
<NOBYLINE>
<NOFS>
<PRESENTATION>
<TC=template-catalog>
<TEMPLATE=template-entry>;
Options
Each PROC GREPLAY statement option has an equivalent statement that you can
use instead.
BYLINE
specifies that the BY statement information for the SAS catalog entries should be
displayed. The BY statement information appears directly beneath the primary
description of the entry. By default, the BY statement information is displayed.
CC=color-map-catalog
identifies the color map catalog to be used with the GREPLAY procedure. Use the
CMAP= option to assign a current color map that is contained in color-map-catalog.
To assign a current color map or create new color maps, you must assign a color
map catalog with the CC= option.
To replay graphics output using a color map, you must assign a color map catalog
and a current color map with the CC= and CMAP= options.
Featured in: Example 3 on page 1274.
CMAP=color-map-entry
assigns a current color map to use when replaying graphics output, where
color-map-entry names an existing color map in the catalog specified in the CC=
option. If color-map-entry is not in the catalog, an error message is written to the
SAS log. Color-map-entry must have a catalog entry type of CMAP.
If you do not specify a color map catalog using the CC= option when using the
CMAP= option, a warning message is written to the SAS log.
1244 PROC GREPLAY Statement Chapter 43
To replay graphics output using a color map, you must assign a color map catalog
and a current color map with the CC= and CMAP= options.
FS
specifies that the GREPLAY procedure should use windows. By default, if your
device supports windows, the GREPLAY procedure uses windows. If your device does
not support windows, the procedure begins execution in line-mode and the FS option
has no effect.
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output that is produced by
the GREPLAY procedure. In addition, catalog entries that contain graphics output
can be copied to output-catalog. If you omit the libref, SAS/GRAPH looks for the
catalog in the temporary library called WORK and creates the catalog if it does not
exist. Output-catalog can be the same catalog that is specified in the IGOUT= option.
To copy catalog entries, you must assign an input and, optionally, an output
catalog with the IGOUT= and GOUT= options.
See also: “Storing Graphics Output in SAS Catalogs” on page 53
Featured in: Example 2 on page 1272.
IGOUT=<libref.>input-catalog
specifies the input catalog to use with the GREPLAY procedure. The input catalog
that you specify with the IGOUT= option should be a catalog that contains the
graphics output that will be replayed. If you omit the libref, SAS/GRAPH looks for
the catalog in the temporary library called WORK. Input-catalog can be the same
catalog that you specified in the GOUT= option.
To move, group, or delete catalog entries or to replay graphics output, you must
assign an input catalog with the IGOUT= option.
To copy catalog entries, you must assign an input and, optionally, an output
catalog with the IGOUT= and GOUT= options.
Featured in: Example 2 on page 1272.
IMAGEMAP=output-data-set
must be used in conjuntion with the REPLAY statement (see “REPLAY Statement”
on page 1257). The IMAGEMAP= option creates a temporary SAS data set that
contains information about the graph that is replayed from the graphics catalog. The
information in the image map data set includes the shape and coordinates of the
elements in the graph, along with values that were associated with those elements in
variables that were identified for that purpose in the HTML= and/or
HTML_LEGEND= options. The image map data set can be used to generate an
HTML image map in an HTML output file using the IMAGEMAP macro. The
IMAGEMAP macro takes two arguments, the name of the image map data set and
the name or fileref of an HTML output file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
See also: “Adding Links with the HTML= and HTML_LEGEND= Options” on page
574
NOBYLINE
suppresses the BY statement information for the SAS catalog entries. The BY
statement information appears directly beneath the primary description of the entry.
By default, the BY statement information is displayed.
NOFS
specifies that the GREPLAY procedure should use line mode. By default, if your
device supports windows, the GREPLAY procedure uses windows. If your device does
not support windows, the procedure uses line mode, regardless of whether you used
the FS option or the NOFS option.
The GREPLAY Procedure PROC GREPLAY Statement 1245
Details
When you submit the PROC GREPLAY statement, the mode of operation depends on
both the environment in which the statement is submitted and whether the NOFS
option is included, as shown in Table 43.2 on page 1245.
You can switch back and forth between windows and line-mode within a session.
1246 ? Statement Chapter 43
? Statement
Prints the current value of certain PROC GREPLAY options or of the current device driver.
Syntax
? required–argument;
Required Arguments
CC
prints the name of the current color map catalog. If no color map catalog has been
assigned, the GREPLAY procedure issues a message.
CMAP
prints the name of the current color map. If no color map has been assigned, the
GREPLAY procedure issues a message.
DEVICE
DEV
prints the name of the current device driver.
GOUT
prints the name of the current output catalog. If you did not assign an output
catalog, the GREPLAY procedure issues a message.
IGOUT
prints the name of the current input catalog. If you did not assign an input catalog,
the GREPLAY procedure issues a message.
TC
prints the name of the current template catalog. If you did not assign a template
catalog, the GREPLAY procedure issues a message.
TEMPLATE
prints the name of the current template. If you did not assign a template, the
GREPLAY procedure issues a message.
The GREPLAY Procedure CCOPY Statement 1247
BYLINE Statement
Displays BY statement information directly beneath the primary description of the catalog entries
when you list the contents of the input catalog.
Syntax
BYLINE;
CC Statement
Specifies a color map catalog and allows you to change the color map catalog without exiting the
procedure.
Syntax
CC color-map-catalog;
Required Arguments
color-map-catalog
identifies the SAS catalog where color maps should be stored or the name of a SAS
catalog containing color maps.
CCOPY Statement
Copies a color map from another catalog to the color map catalog or creates a duplicate copy of a
color map within the color map catalog.
Requirements: Assign a color map catalog before using the CCOPY statement.
See also: CC statement
Syntax
CCOPY <color-map-catalog.>color-map-entry<.CMAP>;
1248 CDEF Statement Chapter 43
Required Arguments
<color-map-catalog.>color-map-entry <.CMAP>
identifies the color map entry to be copied.
color-map-catalog
is the SAS catalog that contains the color map to be copied.
color-map-entry
is the name of the entry color map.
CMAP
is the catalog entry type.
If a color map of the same name already exists in the color map catalog, the
GREPLAY procedure creates a new name.
See also: “Duplicate Entry Names” on page 1240
Details
To copy a color map from another catalog to the color map catalog, use the CC
statement to specify color-map-catalog as the catalog from which the color map should
be copied. For example, the following statements copy HP.CMAP from the catalog
named ONE.CCAT to the catalog named TARGET.CLRMAP:
libname target ’SAS-data-library’;
libname one ’SAS-data-library’;
To create a duplicate copy of a color map, simply omit color-map-catalog from your
CCOPY statement. For example, to create a duplicate copy of the color map named
HP.CMAP in the color map catalog, use the following statement:
ccopy hp.cmap;
CDEF Statement
Defines or modifies a color map in the color map catalog.
Requirements: Assign a color map catalog before using the CDEF statement.
See also: CC statement
Featured in: Example 3 on page 1274
Syntax
CDEF color-map-entry
<color-definition(s)>
<DES=’entry-description’>;
The GREPLAY Procedure CDELETE Statement 1249
Required Arguments
color-map-entry
identifies an existing or new color map. Color-map-entry is the name of a catalog
entry.
If the color map name is not in the color map catalog, then the procedure creates a
new color map. If the color map name is already in the color map catalog, then the
procedure modifies or adds to that color map.
Options
color-number / from-color:to-color
specifies a color pair and how it is defined.
color-number
specifies the number of a color pair.
from-color:to-color
defines the colors that are being mapped:
from-color
is the color to be mapped.
to-color
is the new color that replaces from-color in the replayed graphics output.
DES=’entry-description’
specifies a description of the catalog entry for the color map. The maximum length
for the entry-description is 256 characters. By default, the GREPLAY procedure
assigns a description of **** NEW COLOR MAP **** to the color map.
CDELETE Statement
Deletes one or more color maps from the current color map catalog.
Caution: The GREPLAY procedure does not prompt you to confirm your request to
delete color maps.
Alias: CDEL
Syntax
CDELETE color-map-entry(s) | _ALL_ ;
1250 CMAP Statement Chapter 43
Required Arguments
color-map-entry(s)
identifies one or more color maps that you want to delete from the color map catalog.
You can submit a single entry or a list of entries in one CDELETE statement.
_ALL_
deletes all of the color maps from the color map catalog.
CMAP Statement
Assigns the current color map to be used when replaying graphics output.
Requirements: Assign a color map catalog before using the CMAP statement.
See also: CC statement
Featured in: Example 3 on page 1274
Syntax
CMAP color-map-entry;
Required Arguments
color-map-entry
identifies an existing color map, contained in the color map catalog, to use when
replaying your graphics output. If the color map is not in the current color map
catalog, the GREPLAY procedure issues an error message in the SAS log.
COPY Statement
Copies one or more catalog entries containing graphics output from the input catalog to the output
catalog.
Requirements: Assign an input catalog and an output catalog before using the COPY
statement.
Note: You cannot use the COPY statement to create a duplicate of an entry containing
graphics output in the same catalog. You can have only one copy of an entry containing
graphics output in a catalog.
See also: GOUT and IGOUT statements
Syntax
COPY entry-id(s) | _ALL_ ;
The GREPLAY Procedure DEVICE Statement 1251
Required Arguments
One of the following is required:
entry-id(s)
is the number or name of a catalog entry, or the number or name of a group of
entries to be copied from the input catalog to the output catalog. Entries must
contain graphics output. Multiple entry-id(s) can contain both numbers and names.
_ALL_
copies all of the graphics output entries in the input catalog to the output catalog.
DELETE Statement
Deletes SAS catalog entries containing graphics output from the current input catalog.
Caution: The GREPLAY procedure does not prompt you to confirm your request to
delete an entry containing graphics output.
Alias: DEL
Syntax
DELETE entry-id(s) | _ALL_ ;
Required Arguments
One of the following is required:
entry-id(s)
is the number or name of a catalog entry, or the number or name of a group of
entries to be deleted from the input catalog. Entries must contain graphics output.
Multiple entry-id(s) can contain both numbers and names.
_ALL_
deletes all of the graphics output entries in the input catalog.
DEVICE Statement
Specifies the device driver.
Requirements: You must specify a device driver that your graphics device can support
and that is available in your SAS session.
Alias: DEV
Syntax
DEVICE device-name;
Required Arguments
1252 FS Statement Chapter 43
device-name
specifies the device driver to use when you replay graphics output. The device driver
that you specify becomes the current device and is used for subsequent replays until
you submit another DEVICE statement or change the device driver in another way.
FS Statement
Switches from line mode to the GREPLAY procedure windows.
Requirements: Your device must support windows.
See also: NOFS on page 1244
Syntax
FS;
GOUT Statement
Assigns the current output catalog used by the GREPLAY procedure.
Note: You may change the output catalog without exiting the procedure by using the
GOUT statement.
Syntax
GOUT < libref.>output-catalog;
Required Arguments
<libref.>output-catalog
identifies the SAS catalog that you want to use as an output catalog. By default, the
output catalog is WORK.GSEG.
GROUP Statement
Creates groups of entries in the current input catalog.
Syntax
GROUP entry-id(s);
The GREPLAY Procedure LIST Statement 1253
Required Arguments
entry-id(s)
is the number or name of a catalog entry that contains graphics output. All of the
entries that are specified in the GROUP statement are included in a single group
with a group header. You can submit a single entry or a list of entries with a single
GROUP statement. A list of entries can contain both entry numbers and entry names.
Details
You can manage and display groups of entries with the DELETE, COPY, and
REPLAY statements in the same way that you manage single entries.
Only one group can be created per group statement. The default name for a group
header is GROUP. The default description for the group header is *** new group ***.
The GREPLAY procedure uses a naming convention to avoid duplicate names. See
“Duplicate Entry Names” on page 1240 for more information on the naming convention.
To change the name (and description) of a group, use the MODIFY statement.
IGOUT Statement
Assigns the current input catalog used by the GREPLAY procedure.
Note:You may change the input catalog without exiting the procedure by using the
IGOUT statement.
Syntax
IGOUT <libref.>input-catalog;
Required Arguments
<libref.>input-catalog
identifies the SAS catalog with entries that contain graphics output that you want to
replay.
LIST Statement
Prints entries in the input, template, and color map catalogs, as well as the contents of templates
and color maps.
Procedure output: The output from the LIST statement is sent to the SAS log.
Note: Entries are listed in the order of their creation date.
Featured in: Example 3 on page 1274
Syntax
LIST required-argument;
1254 MODIFY Statement Chapter 43
Required Arguments
One of the following is required:
CC
prints the color maps that are in the current color map catalog. If the catalog
contains both templates and color maps, only color maps are listed.
CMAP
prints the From and To color values in the current color map.
IGOUT
prints the number, names, and descriptions of the entries in the input catalog that
contains graphics output. In addition, the type of graphics output (dependent or
independent) is shown.
TC
prints the templates in the current template catalog. If the catalog contains both
templates and color maps, only the templates are listed.
TEMPLATE
prints the panel definition values of the current template.
MODIFY Statement
Changes the name, description, and BY statement information of entries or group headers in the
input catalog.
Syntax
MODIFY modify-pair(s);
modify-pair(s) has the following form:
entry-id / entry-description(s)
Required Arguments
entry-id / entry-description(s)
specifies the entry to modify.
entry-id
is the number or name of a catalog entry, or the number or name of a group of
entries in the input catalog. Entries must contain graphics output. Multiple
entry-id(s) can contain both numbers and names.
entry-description(s)
The GREPLAY Procedure MOVE Statement 1255
BYLINE=’character-string’
specifies a character string that can be used for additional information or for BY
statement information. Character-string can be up to 40 characters long and
must be enclosed in quotation marks. BY statement information appears
directly beneath the primary description of the catalog entry.
NAME=’entry-name’
specifies the new name of the catalog entry for the graph. The maximum length
for entry-name is eight characters. If the specified name duplicates the name of
an existing entry, SAS/GRAPH software adds a number to the duplicate name
to create a unique entry.
Note: The value for entry-name can be either with or without quotation
marks. 4
DES=’entry-description’
specifies the description of the catalog entry for the graph. The maximum
length for entry-description is 256 characters. The description does not appear
on the graph.
MOVE Statement
Rearranges entries in the input catalog by moving entries either before or after other entries.
Syntax
MOVE entry-id-1 AFTER | BEFORE entry-id-2;
Required Arguments
entry-id-1
is the name or number of an existing catalog entry or a group header that is to be
moved.
entry-id-2
is the name or number of an existing catalog entry or a group header. Entry-id-1 can
be placed before or after entry-id-2.
AFTER | BEFORE
specifies whether entry-id-1 should be moved before or after entry-id-2.
Details
To move an entire group, use the name of the group for entry-id-1. To move an entry
into a group, move the entry after a group header or before or after an entry in the
group. For example, this statement moves the entry CHART3 into the group that is
named NEW_SALES:
move chart3 after new_sales;
1256 NOBYLINE Statement Chapter 43
NOBYLINE Statement
Suppresses BY statement information.
Note: By default, the BY statement information is displayed.
See also: BYLINE statement
Syntax
NOBYLINE;
PREVIEW Statement
Displays the panel outlines for one or more templates using the current device. Use the TC
statement to specify the template catalog before using the PREVIEW statement.
Tip: When you preview a list of templates, press END or ENTER to preview the next
template in the list.
Note: The graphics output produced when you preview a template is stored in a catalog
named WORK.GTEM, which is deleted at the end of your session.
Syntax
PREVIEW template-entry(s) | _ALL_ ;
Required Arguments
One of the following is required:
template-entry(s)
identifies one or more template entries that are contained in the current template
catalog. You can preview one entry or a list of entries with one PREVIEW statement.
_ALL_
previews all of the templates in the current template catalog.
QUIT Statement
Exits the GREPLAY procedure.
Aliases: END, STOP
Syntax
QUIT;
The GREPLAY Procedure TC Statement 1257
REPLAY Statement
Selects one or more entries for replay from the current input catalog.
Note:If any entries specified in a REPLAY statement are not found in the input catalog,
PROC GREPLAY issues a message in the SAS log and continues to replay valid entries.
Alias: PLAY
Syntax
REPLAY entry-id(s) | _FIRST_ | _LAST_ | _ALL_ ;
Required Arguments
One of the following is required:
entry-id(s)
is the number or name of a catalog entry, or the number or name of a group of
entries in the input catalog. Entries must contain graphics output. Multiple
entry-id(s) can contain both numbers and names. For example, this statement
specifies both the entry named GRAPH and the third entry in the catalog:
replay graph 3;
_ALL_
replays all of the entries in the input catalog.
_FIRST_
replays the first entry in the input catalog.
_LAST_
replays the last entry in the input catalog.
TC Statement
Specifies the template catalog for the GREPLAY procedure.
Syntax
TC template-catalog;
1258 TCOPY Statement Chapter 43
Required Arguments
template-catalog
identifies the SAS catalog where templates are to be stored or identifies the name of
a SAS catalog that contains templates.
TCOPY Statement
Copies templates from another catalog to the template catalog or creates a duplicate copy of a
template within the template catalog.
Requirements: Assign a template catalog before using the TCOPY statement.
See also: TC statement
Syntax
TCOPY <template-catalog.>template-entry<.TEMPLATE>;
Required Arguments
<template-catalog.>template-entry<.TEMPLATE>
identifies the template entry that is to be copied.
template-catalog
is the SAS catalog that contains the template that is to be copied.
template-entry
is the template entry name.
TEMPLATE
is the catalog entry type. If a template of the same name already exists in the
template catalog, the GREPLAY procedure creates a new name.
See also: “Duplicate Entry Names” on page 1240
Details
To copy a template from another catalog to the template catalog, specify
template-catalog as the catalog from which the template should be copied. For example,
if you want to copy NEWTEMP.TEMPLATE from the catalog named ONE.TEMPLT to
the catalog named TARGET.TEMPLT, use the following statements:
libname target ’SAS-data-library’;
libname one ’SAS-data-library’;
tcopy newtemp.template;
TDEF Statement
Defines or modifies templates in the current template catalog.
Requirements: Assign a template catalog before using the TDEF statement.
See also: TC statement
Featured in: Example 1 on page 1270
Syntax
TDEF template-entry
<panel-definition(s)>
<DES=’entry-description’>;
panel-definition has the following form:
panel-number / <panel-option(s)>
panel-option(s) can be one or more of the following:
CLIP
COLOR=border-color
COPY=panel-number
DEF
DELETE
LLX=x
LLY=y
LRX=x
LRY=y
ROTATE=degrees
SCALEX=factor
SCALEY=factor
ULX=x
ULY=y
URX=x
URY=y
XLATEX=distance
XLATEY=distance
Required Arguments
template-entry
identifies an existing or a new template. If the template is not in the template
catalog, the procedure creates it. If the template is already in the template catalog,
the procedure modifies or makes additions to that template.
Only template-entry is required, but if you specify only the template name without
any options, no changes are made to an existing template and no new template is
created.
1260 TDEF Statement Chapter 43
Options
CLIP
specifies that any panels behind this panel should be clipped. If clipping is in effect
for a panel, only the graphics output that is to be placed in that panel can appear in
the space that the panel occupies, unless a previous panel occupies all or part of that
space.
COLOR=border-color
specifies the color of the panel border. If you omit border-color, then no border is
displayed around the panel when you replay graphics output in the panel. If you
preview a template that contains a panel without a border color, the GREPLAY
procedure uses the first color in the colors list as the outline for the border.
COPY=panel-number
specifies the number of the panel definition that is to be copied to this panel.
DEF
specifies a default panel. A default panel has the following characteristics:
DELETE
DEL
deletes the panel.
DES=’entry-description’
specifies the description of the catalog entry for the template. The maximum length
for entry-description is 256 characters. By default, the procedure uses *** new
template *** for the description.
LLX=x
specifies the X coordinate of the lower-left corner of the panel. Units for x are
percentage of the graphics output area.
LLY=y
specifies the Y coordinate of the lower-left corner of the panel. Units for y are
percentage of the graphics output area.
LRX=x
specifies the X coordinate of the lower-right corner of the panel. Units for x are
percentage of the graphics output area.
LRY=y
specifies the Y coordinate of the lower-right corner of the panel. Units for y are
percentage of the graphics output area.
panel-number
identifies the number of the panel that is being defined or modified.
ROTATE=degrees
The GREPLAY Procedure TDEF Statement 1261
specifies the rotation angle for the panel. The coordinates of the panel corners are
automatically adjusted.
SCALEX=factor
specifies the scale factor for the X coordinates in the panel. You can use this scale
factor to increase or decrease the size of the panel in the X direction or to reverse the
X coordinates for the panel.
SCALEY=factor
specifies the scale factor for Y coordinates in the panel. You can use this scale factor
to increase or decrease the size of the panel in the Y direction or to reverse the Y
coordinates for the panel.
ULX=x
specifies the X coordinate of the upper-left corner of the panel. Units for x are
percentage of the graphics output area.
ULY=y
specifies the Y coordinate of the upper-left corner of the panel. Units for y are
percentage of the graphics output area.
URX=x
specifies the X coordinate of the upper-right corner of the panel. Units for x are
percentage of the graphics output area.
URY=y
specifies the Y coordinate of the upper-right corner of the panel. Units for y are
percentage of the graphics output area.
XLATEX=distance
specifies the distance to move the X coordinates of the panel. Units for distance are
percentage of the graphics output area.
XLATEY=distance
specifies the distance to move the Y coordinates of the panel. Units for distance are
percentage of the graphics output area.
Details
Use coordinate values that are less than 0 and greater than 100 in the LLX=, LLY=,
LRX=, LRY=, ULX=, ULY=, URX=, and URY= options to zoom in on the graphics
output. That is, you can see only that part of the replayed graphics output in the range
from 0 to 100 percent of the graphics output area.
The values that you supply for the SCALEX= and SCALEY= options are used to
change the size and orientation of the panel. The scale factors are used for the
corresponding X and Y coordinates of the panel. For example, if you specify
scalex=.5
scaley=2
the X coordinates are scaled to half the original size, and the Y coordinates are scaled
to twice the original size.
If you supply a scale factor of 0, all of the coordinates are set to the same value. If
you use a scale factor of 1, nothing happens. If you use a scale factor greater than 1,
the values of the coordinates are increased and hence the size of the panel increases. If
you use a scale factor less than 1 but greater than 0, the values of the coordinates are
decreased and hence the size of the panel decreases. If you use a negative scale factor,
the coordinates are reversed and hence the panel (and any graphics output replayed in
the panel) is reversed.
1262 TDELETE Statement Chapter 43
TDELETE Statement
Deletes templates from the template catalog.
Caution: The GREPLAY procedure does not prompt you to confirm your request to
delete templates.
Alias: TDEL
Syntax
TDELETE template-entry(s) | _ALL_ ;
Required Arguments
One of the following is required:
template-entry(s)
identifies a template that is to be deleted from the template catalog. You can submit
a single entry or a list of entries in a single TDELETE statement.
_ALL_
deletes all of the templates in the template catalog.
TEMPLATE Statement
Assigns a current template to use when replaying graphics output.
Requirements: Assign a template catalog before using the TEMPLATE statement.
Note: If you specify a template that is not in the current template catalog or if you
specify a template before you have assigned a template catalog, the GREPLAY
procedure issues an error message.
Featured in: Example 1 on page 1270
Syntax
TEMPLATE template-entry;
Required Arguments
template-entry
identifies an existing template to use when replaying graphics output. Use the
TREPLAY statement to replay graphics output in the template.
The GREPLAY Procedure TREPLAY Statement 1263
TREPLAY Statement
Copies one or more entries from the graphics input catalog into a new entry in the graphics output
catalog, using positioning information provided by the current template.
Requirements: Before issuing the TREPLAY statement, first specify a graphics input
catalog with the “IGOUT Statement” on page 1253, assign a template catalog with the
“TC Statement” on page 1257, and choose a template with the “TEMPLATE Statement”
on page 1262.
Alias: TPLAY
Featured in: Example 2 on page 1272
Syntax
TREPLAY select-pairs<DES="entry-description" NAME="entry-name">;
Required Arguments
template-panel-number:entry-id
specifies the panel number and the name of a catalog entry.
template-panel-number
determines the postion of the graph in the new entry in the graphics output
catalog, based on the position of the specified panel in the current template.
entry-id
specifies the name or number of the entry in the graphics input catalog that is to
be added to the new entry in the graphics output catalog.
Options
DES="entry- adds a description to the new entry in the graphics output catalog.
description" The description is truncated after 40 characters.
NAME="entry- names the new entry in the graphics output catalog. The name must
name" begin with a letter and continue with up to seven more letters,
numbers, or underscores. If the NAME= option is not specified, the
new entry is named TEMPLATE by default. If an entry named
TEMPLATE already exists in the graphics output catalog, the new
entry is named TEMPLATx, where x is a unique number. This
naming convention also applies if the value of the NAME= option
already exists in the graphics output catalog.
Details
When you replay existing GRSEG entries in a template, the GREPLAY procedure
creates new graphics output that is stored in the output catalog.
1264 Using the GREPLAY Procedure Chapter 43
You can replay as many entries as you want in a single TREPLAY statement as
shown here:
treplay 1:plot1 2:plot2 3:chart1;
PLOT1 will be placed in panel 1 of the current template, PLOT2 will be placed in
panel 2, and CHART1 will be placed in panel 3. You can use entry numbers in the place
of entry names.
PROC PRESENTATION
PRESENTATION
GREPLAY
CC
EDITentry.CMAP TC EDITentry.TEMPLATE
BROWSEentry.CMAP BROWSEentry.TEMPLATE
DIRECTORY
EDIT.entry
BROWSE.entry
COLOR TEMPLATE
MAPPING DESIGN
This section briefly describes the GREPLAY windows; for a complete description of
each window and its fields, refer to the SAS Help facility.
PRESENTATION Window
This window is a modified version of the PROC GREPLAY window that enables you
to replay graphics output while it prevents you from deleting entries or changing
templates and color maps. Once you have created and organized your catalog, you may
want to use the PRESENTATION window in an application for replaying graphics
output.
DIRECTORY Window
This window lists the names of the catalog entries, gives a brief description of each,
and indicates the date on which each entry was created or last changed. Although all
catalog entry types are displayed in the DIRECTORY window, you can manage only
entries of type CMAP or TEMPLATE from this window.
PROC GREPLAY statement PROC GREPLAY window Submit the PROC GREPLAY
statement without using the
PRESENTATION or NOFS
options.
PRESENTATION window Submit the PROC GREPLAY
statement and include the
PRESENTATION and IGOUT=
options.
PROC GREPLAY window PRESENTATION window Specify a catalog and issue the
PRES command.
If you do not specify an output catalog with the GOUT= option in the PROC
statement of the SAS/GRAPH procedure that creates the graphics output, the graphics
output is automatically stored in the WORK.GSEG catalog. Replay the graphics output
that is stored in this catalog as follows:
proc greplay nofs;
igout work.gseg;
replay _all_;
run;
quit;
or to change the shape or size of graphics output. You can use color maps to remap
colors when replaying graphics output.
A color map is a list of up to 256 pairs of colors that enables you to change the colors
in graphics output by mapping the original colors to a list of new colors. Color maps are
useful for controlling how colors that are not available on the current device are
remapped.
When you assign a current color map and replay graphics output that is stored in a
catalog entry, any color in your graphics output that appears in the From column of the
color map is mapped to the corresponding color in the To column of the color map. The
new colors are not saved with the graphics output, and you do not create new graphics
output when you use a color map to replay graphics output.
Before you create a template, you must assign a template catalog. If you are use the
GREPLAY procedure in line mode, use the TDEF statement to define a template and
the PREVIEW statement to preview a template. For example, the following statements
define and preview a template named TEMPLT:
tdef templt 1/def;
preview templt;
Before you create a color map, you must assign a color map catalog. If you use the
GREPLAY procedure in line mode, use the CDEF statement to define a color map. For
example, the following statement defines a color map named CLRMAP:
cdef clrmap 1 / cyan : blue;
1270 Replaying Graphics Output in a Template Chapter 43
When you replay graphics output in a template, the new graphics output that is
created by the GREPLAY procedure is automatically provided a default name and is
stored in the output catalog, WORK.GSEG.
Templates are often used to describe positioning for replaying graphics output from
several catalog entries on a single display.
Examples
The following examples illustrate major features of the GREPLAY procedure.
This example creates a template with five panels. Four of the panels are small and
equal in size. The fifth panel is a large, full-size panel that can be used later to display
a common title or footnote for the entire template (see ). In this example, the LIST
statement displays the template contents in the log. Output 43.1 shows the template
definition that is written to the log file. The template that is defined here is also used
in Example 2 on page 1272.
The GREPLAY Procedure Example 1: Creating a Template 1271
Start the GREPLAY procedure. NOFS starts the procedure in line-mode. TC=assigns
TEMPCAT as the template catalog.
Define a template with four panels. The TDEF statement defines a template named
NEWTEMP and places it in the previously defined template catalog. Each definition identifies
the panel number and specifies the coordinates of the four corners. The panels are arranged
within the template as follows: panel 1 is lower left; panel 2 is upper left; panel 3 is upper right;
panel 4 is lower right; panel 5 is the full size so that it can contain a common title and footnote
for all the template entries. COLOR= draws a border for each panel in the specified color.
1/llx=0 lly=10
ulx=0 uly=50
urx=50 ury=50
lrx=50 lry=10
color=blue
2/llx=0 lly=50
ulx=0 uly=90
urx=50 ury=90
lrx=50 lry=50
color=red
3/llx=50 lly=50
ulx=50 uly=90
urx=100 ury=90
lrx=100 lry=50
color=green
4/llx=50 lly=10
ulx=50 uly=50
urx=100 ury=50
lrx=100 lry=10
color=cyan
5/llx=0 lly=0
ulx=0 uly=100
urx=100 ury=100
lrx=100 lry=0
color=lipk;
1272 Example 2: Replaying Graphics Output in a Template Chapter 43
Assign the current template. The TEMPLATE statement assigns the newly created template
NEWTEMP as the current template.
template newtemp;
list template;
quit;
.
.
.
Pan Clp Color Ll-x Ll-y Ul-x Ul-y Ur-x Ur-y Lr-x Lr-y
66 quit;
.
.
.
The TREPLAY statement replays into the template NEWTEMP four catalog entries
that contain graphics output. The NEWTEMP template is defined in Example 1 on
page 1270. It contains four equally sized panels and one large, full-size panel. Note
that assignments are made to all but one of the panels. Because the fourth panel is not
listed in the TREPLAY statement, it does not appear in the graphics output. The
HSIZE= and VSIZE= options are adjusted and then reset to default in order to reflect
the dimensions of the different-sized template panels.
Set the graphics environment. HSIZE= and VSIZE= are set for the dimensions of template
panels 1, 2, 3, and 4.
Generate three graphs in the permanent catalog GRAFCAT. The GSLIDE procedure
creates three text slides and stores them in GRAFCAT as specified by the GOUT= option. By
default, these are stored as GSLIDE, GSLIDE1, and GSLIDE2.
Reset HSIZE= and VSIZE= to the default values and generate a text slide with PROC
GSLIDE. Resetting the HSIZE and VSIZE values enables you to create a text slide with the
proper aspect ratio for use in template panel 5.
1274 Example 3: Creating a Color Map Chapter 43
Start the GREPLAY procedure. IGOUT= assigns GRAFCAT as the input catalog. GOUT=
assigns EXCAT as the output catalog. TEMPLATE= assigns NEWTEMP as the current
template. Remember, the NEWTEMP template is defined in Example 1.
list template;
Replay three graphs into template. The TREPLAY statement assigns three entries to panels
in the NEWTEMP template. Each assignment is a panel number and the name of a graphics
output entry. Names are the default names assigned by the GSLIDE procedure.
treplay 1:gslide
2:gslide1
3:gslide2
5:gslide3;
quit;
This example uses the CDEF statement to define a color map. The LIST statement is
used in this example to display the color map definition in the log. Output 43.2 shows a
partial listing of the log.
Start the GREPLAY procedure. CC= assigns CLRMAP as the color map catalog. GOUT=
specifies the permanent catalog in which to place the graphics output.
proc greplay cc=clrmap gout=excat nofs;
Define a color map. The CDEF statement defines a color map named MYCOLOR that
contains three color pairs.
cdef mycolor des=’Special Color Map’
1 / pink : red
2 / cyan : blue
3 / lig : green;
Specify current color map and write contents to the log. The CMAP statement assigns
MYCOLOR as the current color map. The contents of CMAP are listed in the log.
cmap mycolor;
list cmap;
quit;
.
.
75 /* list the contents of the color map */
76 list cmap;
FROM TO
1 PINK RED
2 CYAN BLUE
3 LIG GREEN
77 quit;
.
1276
1277
CHAPTER
44
The GSLIDE Procedure
Overview 1277
About Text Slides 1277
About Annotate Output 1278
Procedure Syntax 1278
PROC GSLIDE Statement 1279
Examples 1282
Example 1: Producing Text Slides 1282
Example 2: Displaying Annotate Graphics 1283
Overview
The GSLIDE procedure is useful for creating text slides for presentations. You can
overlay text slides on other graphics output with the GREPLAY procedure. The
GSLIDE procedure produces graphics output that consists of text and straight lines
that are generated by TITLE, FOOTNOTE, and NOTE statements. In addition, the
procedure provides an easy way to add titles, notes, and footnotes to output that is
produced entirely with an Annotate data set.
Figure 44.2 Output from an Annotate Data Set Displayed with the GSLIDE
Procedure (GSLANNOT)
Procedure Syntax
Requirements: At least one of these is required: a TITLE, FOOTNOTE, or NOTE
statement; an appearance option; the BORDER graphics option.
Global statements: FOOTNOTE, TITLE
Reminder: The procedure can include the SAS/GRAPH NOTE statement.
Supports: RUN-group processing Output Delivery System (ODS)
Syntax
PROC GSLIDE < option(s)>;
option(s) can be one or more options from any or all of the following categories:
3 appearance options:
ANNOTATE=Annotate-data-set
BORDER
CFRAME=frame-color
FRAME
IFRAME= fileref | ’external-file’
IMAGESTYLE = TILE | FIT
LFRAME=line-type
WFRAME=n
3 description options:
DESCRIPTION=’entry-description’
GOUT=<libref.>output-catalog
NAME=’entry-name’
3 HTML option:
<IMAGEMAP=output-data-set>
Options
You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set that includes Annotate variables that identify graphics commands
and parameters.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587.
Featured in: Example 2 on page 1283.
BORDER
draws a border around the graphics output area, which includes the title area, the
footnote area, and the procedure output area. A color specification for the border is
searched for in the following order:
1 the CTITLE= option in a GOPTIONS statement
2 the CTEXT= option in a GOPTIONS statement
3 the default, the first color in the colors list.
See also: “Adding Frames, Borders, and Images” on page 1281.
Featured in: Example 1 on page 1282.
CFRAME=frame-color
1280 PROC GSLIDE Statement Chapter 44
draws a frame around the procedure output area in the specified color. If you use
both the CFRAME= and FRAME options, FRAME is ignored. If you use the
IFRAME= option, the specified image fills the background of the slide.
Note: CFRAME= does not color the background of the slide. 4
See also: “Adding Frames, Borders, and Images” on page 1281.
Featured in: Example 1 on page 1282.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
entry-description is 256 characters. The description does not appear on the chart. By
default, the GSLIDE procedure assigns the description OUTPUT FROM PROC
GSLIDE.
FRAME
draws a frame around the procedure output area. By default, the frame color is the
first color in the colors list. If you want to specify a different color for the frame, use
the CFRAME= option instead. The FRAME option is overriden by the IFRAME=
option, which fills the backplane frame with an image.
See also: “Adding Frames, Borders, and Images” on page 1281.
GOUT=<libref.>output-catalog
specifies the SAS catalog in which to save the graphics output produced by the
GSLIDE procedure. If you omit the libref, SAS/GRAPH looks for the catalog in the
temporary library called WORK and creates the catalog if it does not exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53.
IFRAME=fileref | ’external-file’
identifies the image file you wish to apply to the backplane of the plot. See also the
IMAGESTYLE= option. The IFRAME= option is overidden by the NOIMAGEPRINT
goption.
IMAGEMAP=output-data-set
creates a temporary SAS data set that is used to generate an image map in an
HTML output file. The information in the image map data set includes the shape
and coordinates of the elements in the graph and drill-down URLs that have been
associated with those elements. The drill-down URLs are provided by one or two
variables in the input data set. These variables are identified to the GSLIDE
procedure with the HTML= and/or HTML_LEGEND= options.
The %IMAGEMAP macro generates the image map in the HTML output file. The
macro takes two arguments, the name of the image map data set and the name or
fileref of the HTML output file, as shown in the following example:
%imagemap(imgmapds, myimgmap.html);
See also: “Adding Links with the HTML= and HTML_LEGEND= Options” on page
574 and “HTML Variable” on page 651.
IMAGESTYLE= TILE | FIT
specifies whether to tile the image to fill the backplane or to stretch the image to fit
the backplane. The TILE value is the default. See also the IFRAME= option.
LFRAME=line-type
specifies the line type for a frame and draws a frame around the procedure output
area. Values for line-type are 1 through 46. Line types are shown in Figure 7.22 on
page 208. By default, LFRAME=1, which produces a solid line.
NAME=’entry-name’
The GSLIDE Procedure PROC GSLIDE Statement 1281
specifies the name of the catalog entry for the graph. The maximum length for
entry-name is eight characters. The default name is GSLIDE. If the specified name
duplicates the name of an existing entry, SAS/GRAPH software adds a number to
the duplicate name to create a unique entry, for example, GSLIDE1.
WFRAME=n
specifies the width of the frame where n is a number. The thickness of the frame
increases directly with n, but the thickness of the line may vary from device to
device. By default, WFRAME=1, which is the thinnest line. The WFRAME= option
also draws the frame.
See also: “Adding Frames, Borders, and Images” on page 1281.
Featured in: Example 1 on page 1282.
Examples
This example uses FOOTNOTE, NOTE, and TITLE statements to produce a text
slide. PROC GSLIDE statement options add both a border and a frame.
Generate the slide and define additional text. BORDER draws a box around the entire
graphics output area. CFRAME= draws a red box around the procedure output area.
WFRAME= specifies the thickness of the frame. The first NOTE statement, which has no text,
simply leaves a large blank line above the text specified by the second NOTE statement. The
second JUSTIFY= causes a line break.
proc gslide border
cframe=red
wframe=4;
note height=20;
note height=10
justify=center ’Goals and strategies’
justify=center ’for the coming year’;
run;
quit;
In this example, the GSLIDE procedure displays Annotate graphics along with
current TITLE and FOOTNOTE definitions. See Chapter 24, “Using Annotate Data
Sets,” on page 587 for information on creating Annotate data sets.
Create the Annotate data set, ART. ART contains the commands that draw the design of
triangles.
data art;
length function color style $ 8;
input function $ x y color $ style $;
xsys=’5’; ysys=’5’;
datalines;
poly 30 20 blue solid
polycont 50 20 . .
polycont 40 50 . .
poly 50 20 green x1
polycont 70 50 . .
polycont 60 50 . .
poly 40 50 red l1
polycont 60 50 . .
polycont 50 80 . .
;
Define title and footnotes displayed by the procedure. FOOTNOTE statements 4 and 5
have no text and are angled vertically to add space on the left and right sides between the
border of the output and the frame that surrounds the procedure output area.
Display the annotate graphics on the slide with the title and footnotes. The GSLIDE
procedure displays the graphics elements drawn by the commands in the Annotate data set
specified by the ANNOTATE= option.
CHAPTER
45
The GTESTIT Procedure
Overview 1285
About the Pictures 1286
About the LOG 1289
Procedure Syntax 1290
PROC GTESTIT Statement 1290
Examples 1291
Example 1: Testing a GOPTIONS Statement 1291
Example 2: Displaying, Changing and Verifying the Colors List for a Device Driver 1292
Overview
The GTESTIT procedure is a diagnostic tool for testing the installation of SAS/
GRAPH software and the configuration of your device. Use the GTESTIT procedure
when you want to
3 test a new device
3 test the settings of a device driver that you are developing
3 identify the colors and some of the SAS/GRAPH lines and fills for your device
3 review some of your current settings of device parameters and graphics options
3 test changes in settings of device parameters and graphics options.
The GTESTIT procedure produces three pictures that help you determine the
configuration of your graphics device and graphics options and parameters. Refer to
“About the Pictures” on page 1286 for examples of the pictures. Although it does not
show the settings of all device parameters and graphics options, the GTESTIT
procedure does show some of the most commonly used ones.
If you use a GOPTIONS statement to change one or more graphics options for the
current SAS session, or if you run the GDEVICE procedure to change the parameter
settings for your device, you can use the GTESTIT procedure to confirm that those
changes took effect.
For example, if you use the GOPTIONS statement to set HPOS=45 and
COLORS=(RED GREEN), you can display picture 1 in the GTESTIT procedure to
confirm that the graphics output area is divided into 45 columns and that foreground
colors have been limited to red and green.
1286 About the Pictures Chapter 45
See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on page 261,
Chapter 31, “The GDEVICE Procedure,” on page 915, and Chapter 3, “Device Drivers,”
on page 41 for more information on setting graphics options and device parameters.
The LOG window for picture 1, shown in Output 45.1, lists some of the same settings
that are displayed by picture 1, plus some additional settings.
TOP
D=PSLMONO B=1200 R= 25 C= 70 P=256
H= 16 W= 8 MAX=*** D=C000000000000000
RF=8000800000000000 S=0000000000000000
OPTS=D592244009280000 NCOLORS= 1 F=1
BLACK
SASGDDMX
L SAMPLE R
E I
F C G
T H
T
A C E G I K
E S R1 L1 X1 R5 L5 X5
BOTTOM SAS/GRAPH TEST PATTERN
Picture 2 tests your device’s ability to draw lines. Picture 2 always displays in the
first color of the current colors list. Figure 45.2 on page 1287 shows picture 2 of the
GTESTIT procedure.
The GTESTIT Procedure About the Pictures 1287
Picture 3 tests your device’s ability to draw simple polygons, polygons with multiple
boundaries (also known as holes), ellipses, and justified text. Figure 45.3 on page 1287
shows picture 3 of the GTESTIT procedure.
Table 45.1 on page 1288 explains the values displayed in picture 1 of the GTESTIT
procedure. It also provides the equivalent graphics option or device parameter. Chapter
8, “Graphics Options and Device Parameters Dictionary,” on page 261 includes a
complete description of the graphics options and device parameters.
1288 About the Pictures Chapter 45
Equivalent
GTESTIT Graphics Option or
Value Device Parameter Description
Equivalent
GTESTIT Graphics Option or
Value Device Parameter Description
* In the device entry, this field may be blank. If blank, the value displayed by
the GTESTIT procedure comes from an internal default in the device driver.
Table 45.2 on page 1289 lists GTESTIT values that appear only in the LOG window
for picture 1: these values do not appear in the picture itself. Table 45.2 on page 1289
also provides the equivalent graphics option or device parameter. Chapter 8, “Graphics
Options and Device Parameters Dictionary,” on page 261 contains complete information
about the graphics options and device parameters.
Equivalent
GTESTIT Graphics Option or
Value Device Parameter Description
Equivalent
GTESTIT Graphics Option or
Value Device Parameter Description
Procedure Syntax
Supports: Output Delivery System (ODS)
Syntax
PROC GTESTIT < PICTURE=1 | 2 | 3>
<GOUT=<libref.>output-catalog>;
Options
3
shows the test pattern for drawing polygons, ellipses, and justified text.
Examples
TOP
D=PSLMONO B=1200 R= 25 C= 70 P=256
H= 16 W= 8 MAX=*** D=C000000000000000
RF=8000800000000000 S=0000000000000000
OPTS=D592244009280000 NCOLORS= 1 F=1
BLACK
SASGDDMX
L SAMPLE R
E I
F C G
T H
T
A C E G I K
E S R1 L1 X1 R5 L5 X5
BOTTOM SAS/GRAPH TEST PATTERN
This example illustrates how you can use the GTESTIT procedure to confirm the
settings specified on a GOPTIONS statement. In this example, the GOPTIONS
statement enlarges the size of the elements in the graphics output by decreasing the
number of columns from the default number of columns for the device, resets the font to
the default, and specifies a limited colors list.
Set the graphics environment. HPOS= selects 45 columns. VPOS= selects 25 rows. FTEXT=
resets the font to the default font. COLORS= can determine the colors displayed in picture 1
and listed in the LOG, and the value of NCOLORS=.
goptions hpos=45
vpos=25
ftext=
colors=(blue red green);
Example 2: Displaying, Changing and Verifying the Colors List for a Device
Driver
Features:
1 GOPTIONS statement
2 GOPTIONS COLORS= option
3 GTESTIT procedure
The colors that SAS/GRAPH uses for the elements of a graph are determined, in
order of precedence, by:
1 The presence in a GOPTIONS statement of options that control the color of
elements (for example, GOPTIONS CTEXT= to control the color of text).
2 The COLORS= option on a GOPTIONS statement
3 The default color list for the device driver for which the graph is being prepared.
For more information on the order in which SAS/GRAPH chooses colors, see
“Defining and Using a Colors List” on page 93
You can use PROC GTESTIT to display the default color list for a device driver. For
example, the following procedure displays the default color list for graphs prepared for
the ActiveX control.
goptions reset=all device=activex;
proc gtestit picture=1;
run;
quit;
Running this procedure shows the default color list for the device ActiveX, as seen in
the following output from PROC GTESTIT:
The GTESTIT Procedure Example 2: Displaying, Changing and Verifying the Colors List for a Device Driver 1293
The following procedure uses the COLORS= option of the GOPTIONS statement to
change (temporarily) the color list for the device driver ActiveX. Then, it invokes PROC
GTESTIT to verify that the color list is changed. The color list is changed at most for
the duration of the SAS session. Use the GDEVICE procedure to change the color list
permanently.
goptions reset=all
device=activex
colors=(red, green, blue, yellow);
proc gtestit picture=1;
run;
quit;
The following output from PROC GTEST shows that the color list for ActiveX has
changed:
The following code resets the color list for the ActiveX device to the default, and then
reissues PROC GTESTIT to verify that the colors have been reset:
1294 Example 2: Displaying, Changing and Verifying the Colors List for a Device Driver Chapter 45
goptions colors=()
device=activex;
proc gtestit picture=1;
run;
quit;
The following output confirms that the default color list has been re-established:
1295
CHAPTER
46
The G3D Procedure
Overview 1295
About Surface Plots 1295
About Scatter Plots 1296
Concepts 1297
Parts of a Three-dimensional Plot 1297
About the Input Data Set 1298
Data for Surface Plots 1298
Data for Scatter Plots 1298
Changing Data Ranges 1298
About Rotating and Tilting the Plot 1299
About Controlling the Axes 1299
Procedure Syntax 1300
PROC G3D Statement 1300
PLOT Statement 1301
SCATTER Statement 1305
Examples 1314
Example 1: Generating a Default Surface Plot 1314
Example 2: Rotating a Surface Plot 1316
Example 3: Tilting Surface Plot 1317
Example 4: Generating a Simple Scatter Plot 1318
Example 5: Using Shapes in Scatter Plots 1320
Example 6: Rotating a Scatter Plot 1323
References 1325
Overview
The G3D procedure produces three-dimensional graphs that plot one vertical
variable (z) for a position on a plane that is specified by two horizontal variables (x and
y). The coordinates of each point correspond to the values of three numeric variable
values in an observation of the input data set. The observation may contain values in
the form y=f(x, y) or independent values such as the altitude at a given longitude and
latitude. With the G3D procedure you can generate surface graphs with the PLOT
statement or scatter plots with the SCATTER statement.
values of the horizontal variables are plotted on x and y axes, which form a horizontal
plane. The values of the vertical variable are plotted on a z axis, rising above that
plane to form a three-dimensional surface.
Figure 46.1 on page 1296 shows an example of a surface plot that uses all default
settings for the plot. The axes are scaled to include the maximum and minimum values
for each of the plotted variables x, y, and z. Each variable’s value range is divided into
three even intervals, which form the major axes tick marks, and the axes are labeled
with the names of the plotted variables or associated labels. The horizontal plane
formed by the x and y axes is rotated 70 around the z axis and also tilted 70 toward
you, and the plot is colored with the colors that are defined in the current colors list.
The program for this plot is shown in Example 1 on page 1314. For more information
on producing surface plots, see “PLOT Statement” on page 1301.
The program for this plot is shown in Example 4 on page 1318. For more information
on producing scatter plots, see “SCATTER Statement” on page 1305.
Concepts
Note: AXIS and LEGEND definitions are not supported by the G3D procedure. Use
the Annotate facility or TITLE, FOOTNOTE, and NOTE statements to produce legends,
tick mark values, and axis labels. See “About Controlling the Axes” on page 1299 and
“SCATTER Statement” on page 1305 for information on controlling axis labels and tick
mark values with PLOT statement and SCATTER statement options. 4
The G3D Procedure About Controlling the Axes 1299
Procedure Syntax
Requirements: At least one PLOT or SCATTER statement is required.
Global statements: FOOTNOTE, GOPTIONS, TITLE
Reminder: The procedure can include the BY, FORMAT, LABEL, NOTE, and WHERE
statements.
Supports: Output Delivery System (ODS)
Syntax
PROC G3D <DATA=input-data-set>
<ANNOTATE=Annotate-data-set>
<GOUT=<libref.>output-catalog>;
Options
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate all of the graphs that are produced by the G3D
procedure. To annotate individual graphs, use ANNOTATE= in the action statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
DATA=input-data-set
specifies the SAS data set that contains the variables to plot. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29“About the Input Data Set” on page 1298
GOUT=< libref. >output-catalog
specifies the SAS catalog in which to save the graphics output that is produced by
the G3D procedure. If you omit the libref, the SAS/GRAPH software places the
output in the temporary catalog WORK.GSEG. The output catalog is created if it
doesn’t already exist.
See also: “Storing Graphics Output in SAS Catalogs” on page 53
The G3D Procedure PLOT Statement 1301
PLOT Statement
Creates three-dimensional surface plots using values of three numeric variables from the input
data set.
Requirements: Exactly one plot request is required.
Global statements: FOOTNOTE, TITLE
Description
The PLOT statement specifies one plot request that identifies the three numeric
variables to plot. This statement automatically
3 scales the axes to include the maximum and minimum values for each of the
plotted variables x, y, and z
3 divides the value range for each variable into three even intervals, which are
represented by four major tick marks on the axis
3 rotates the x-y plane 70 around the z axis and tilts it 70 toward you, labeling
each axis with the name of the plotted variable or an associated label
3 colors the plot with colors that are defined in the current colors list: axis labels
and tick mark labels display in the first color from the list, axes display in the
second color, the top of the surface plot displays in the third color, and the bottom
of the surface plot (if visible) displays in the fourth color.
You can use statement options to modify any of the three plot axes as well as the
general appearance of the graph, control the viewing angle, and specify characteristics
for reference lines.
In addition, you can use global statements to add text to the graph, and an Annotate
data set to enhance the plot.
Syntax
PLOT plot-request < /option(s)>;
plot-request must be
y*x=z
option(s) can be one or more options from any or all of the following categories:
3 appearance options:
ANNOTATE=Annotate-data-set
CBOTTOM=bottom-surface-color
CTOP=top-surface-color
ROTATE=angle-list
SIDE
TILT=angle-list
XYTYPE=1 | 2 | 3
3 axes options:
CAXIS=axis-color
CTEXT=text-color
GRID
NOAXIS | NOAXES
1302 PLOT Statement Chapter 46
NOLABEL
XTICKNUM=number-of-ticks
YTICKNUM=number-of-ticks
ZMAX=max-value
ZMIN=min-value
ZTICKNUM=number-of-ticks
3 catalog entry description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
Required Arguments
y*x=z
specifies three numeric variables from the input data set:
y
is one of the variables that is plotted on the horizontal (x-y) plane.
x
is another of the variables that is plotted on the horizontal (x-y) plane.
z
is the variable that is plotted on the vertical (z) axis.
Options
Options in a PLOT statement affect all graphs that are produced by that statement.
You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate plots that are produced by the PLOT statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
CAXIS=axis-color
specifies a color for axis lines and tick marks. By default, axes are displayed in the
second color in the current colors list.
CBOTTOM=bottom-surface-color
specifies a color for the bottom of the plot surface. By default, the bottom surface is
displayed in the fourth color in the current colors list.
Featured in: Example 2 on page 1316
CTEXT=text-color
specifies a color for all text on the axes, including tick mark values and axis labels. If
you omit this option, a color specification is searched for in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
CTOP=top-surface-color
specifies a color for the top of the plot surface. By default, the top surface is
displayed in the third color in the current colors list.
Featured in: Example 2 on page 1316
The G3D Procedure PLOT Statement 1303
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length is
256 characters. The description does not appear on the chart. By default, the
procedure assigns a description of the form PLOT OF y*x=z, where y*x=z is the
request that is specified in the PLOT statement.
GRID
draws reference lines at the major tick marks on all axes.
Featured in: Example 2 on page 1316
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length is 8
characters. The default name is G3D. If you specify DEVICE=ACTIXIMG or
DEVICE=JAVAIMG, then the name that you specify will be used for the client image
output even in the file exists. For all other devices, if the name duplicates an existing
entry name, SAS/GRAPH adds a number to the duplicate name to create a unique
entry, for example, G3D1.
NOAXIS
NOAXES
specifies that a plot have no axes, axis labels, or tick mark values.
NOLABEL
specifies that a plot have no axis labels or tick mark values. Use this option if you
want to generate axis labels and tick mark values with an Annotate data set.
ROTATE=angle-list
specifies one or more angles at which to rotate the x-y plane about the perpendicular
z axis. The units are degrees. The default value is 70. The angle-list value is either
an explicit list of values, or a starting and an ending value with an interval
increment, or a combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
The values specified in the angle-list value can be negative or positive and can be
larger than 360. For example, a rotation angle of 45 can also be expressed as
rotate=405
rotate=-315
You can specify a sequence of angles to produce separate graphs for each angle.
The angles that are specified in the ROTATE= option are paired with any angles that
are specified with the TILT= option. If one option contains fewer values than the
other, the last value in the shorter list is paired with the remaining values in the
longer list.
See also: TILT= option on page 1303
Featured in: Example 2 on page 1316
SIDE
produces a surface graph with a side wall.
Featured in: Example 3 on page 1317
TILT=angle-list
specifies one or more angles at which to tilt the graph toward you. The units are
degrees and the default value is 70. The angle-list value is either an explicit list of
values, or a starting and an ending value with an interval increment, or a
combination of both forms:
1304 PLOT Statement Chapter 46
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
The values that are specified in the angle-list value must be 0 through 90.
You can specify a sequence of angles to produce separate graphs for each angle.
The angles that are specified in the TILT= option are paired with any angles that are
specified with the ROTATE= option. If one option contains fewer values than the
other, the last value in the shorter list is paired with the remaining values in the
longer list.
See also: ROTATE= option on page 1303
Featured in: Example 3 on page 1317
XTICKNUM=number-of-ticks
YTICKNUM=number-of-ticks
ZTICKNUM=number-of-ticks
specify the number of major tick marks that are located on a plot’s x, y, or z axis,
respectively. The value must be 2 or greater. The default value is 4 for all three
options.
Featured in: Example 2 on page 1316
XYTYPE=1 | 2 | 3
specifies the direction of lines that are used to represent the surface. XYTYPE=1
displays the surface by using lines that represent y axis values. That is, it only
draws lines that are parallel to the x axis. XYTYPE=2 displays the surface by using
lines that represent x axis values, and draws only lines that are parallel to the y
axis. XYTYPE=3 displays the surface by using lines that represent values for both
the x and y axes. The default is XYTYPE=3. See Figure 46.5 on page 1305 for an
example of the effect of XYTYPE= on the appearance of the surface.
ZMAX=max-value
ZMIN=min-value
specify the maximum and minimum values that are displayed on a plot’s z axis. By
default, the z axis is defined by the minimum and maximum z values that are in the
data set. Defining the ZMIN= and ZMAX= options to be greater than the minimum
and maximum values in the data set extends the plot’s z axis. Defining the ZMIN=
and ZMAX= options to be less than the minimum and maximum values in the data
set displays all z values in the range of ZMIN-to-ZMAX. Values that exceed that
range are displayed at the values of the ZMIN= or ZMAX= options.
The value of the ZMAX= option must be greater than the value of the ZMIN=
option.
Featured in: Example 2 on page 1316
SCATTER Statement
Creates three-dimensional scatter plots using values of three numeric variables from the input
data set.
Requirements: Exactly one plot request is required.
Global statements: FOOTNOTE, TITLE
Alias: SCAT
Description
The SCATTER statement specifies one plot request that identifies the three numeric
variables to plot. This statement automatically
3 scales the axes to include the maximum and minimum values for each of the
plotted variables x, y, and z.
3 divides the range for each variable into three even intervals that are represented
by four major tick marks on the axis.
3 uses reference lines to mark the major tick marks on the x and y axes.
3 rotates the x-y plane 70 around the z axis and tilts it 70 toward you, labeling
each axis with the name of the plotted variable or an associated label.
3 uses the colors that are defined in the current colors list: axis labels and tick mark
labels display in the first color from the colors list, axes in the second color, and
data points in the third color.
3 represents each data point with a pyramid that is connected to the horizontal
plane with a needle.
You can use statement options to modify any of the three plot axes as well as the
general appearance of the graph, control the viewing angle, and specify characteristics
for reference lines. In addition, if the needles drawn from the data points to the base
plane complicate a graph, you can suppress them.
1306 SCATTER Statement Chapter 46
You can use global statements to add text to the graph, and an Annotate data set to
enhance the plot.
Syntax
SCATTER plot-request </ option(s)>;
plot-request must be
y*x=z
option(s) can be one or more options from any or all of the following categories:
3 appearance options:
ANNOTATE=Annotate-data-set
COLOR=’data-point-color’ | data-point-color-variable
NONEEDLE
ROTATE=angle-list
SHAPE=’symbol-name’ | shape-variable
SIZE=symbol-size | size-variable
TILT=angle-list
3 axes options:
CAXIS=axis-color
CTEXT=text-color
GRID
NOAXIS | NOAXES
NOLABEL
XTICKNUM=number-of-ticks
YTICKNUM=number-of-ticks
ZMAX=max-value
ZMIN=min-value
ZTICKNUM=number-of-ticks
3 catalog entry description options:
DESCRIPTION=’entry-description’
NAME=’entry-name’
Required Arguments
y*x=z
specifies three numeric variables from the input data set:
y
is one of the variables that is plotted on the horizontal (x-y) plane.
x
is another of the variables that is plotted on the horizontal (x-y) plane.
z
is the variable that is plotted on the vertical (z) axis.
The SCATTER statement does not require a full grid of observations for the
horizontal variable.
The G3D Procedure SCATTER Statement 1307
Options
Options in a SCATTER statement affect all graphs that are produced by that
statement. You can specify as many options as you want and list them in any order.
ANNOTATE=Annotate-data-set
ANNO=Annotate-data-set
specifies a data set to annotate plots that are produced by the SCATTER statement.
See also: Chapter 24, “Using Annotate Data Sets,” on page 587
CAXIS=axis-color
specifies a color for axis lines and tick marks. By default, axes display in the second
color in the colors list.
Featured in: Example 6 on page 1323
COLOR=’data-point-color’ | data-point-color-variable
specifies a color name or a character variable in the input data set whose values are
color names. These color values determine the color or colors of the shapes that
represent a plot’s data points. Color values must be valid color names for the device
that is used. By default, plot shapes display in the third color in the current colors
list.
Using a list of colors in the value of the data-point-color-variable enables you to
assign different colors to the shapes to classify data.
Featured in: Example 5 on page 1320
CTEXT=text-color
specifies a color for all text on the axes, including tick mark values and axis labels. If
you omit this option, a color specification is searched for in this order:
1 the CTEXT= option in a GOPTIONS statement
2 the default, the first color in the colors list.
DESCRIPTION=’entry-description’
DES=’entry-description’
specifies the description of the catalog entry for the chart. The maximum length for
is 256 characters. The description does not appear on the chart. By default, the
procedure assigns a description of the form SCATTER OF y*x=z, where y*x=z is the
request that is specified in the SCATTER statement.
GRID
draws reference lines at the major tick marks on all axes.
Featured in: Example 5 on page 1320
NAME=’entry-name’
specifies the name of the catalog entry for the graph. The maximum length is eight
characters. The default name is G3D. If you specify DEVICE=ACTIXIMG or
DEVICE=JAVAIMG, then the name that you specify will be used for the client image
output even in the file exists. For all other devices, if the name duplicates an existing
entry name, SAS/GRAPH adds a number to the duplicate name to create a unique
entry, for example, G3D1.
NOAXIS
NOAXES
specifies that a plot have no axes, axis labels, or tick mark values.
NOLABEL
specifies that a plot have no axis labels or tick mark values. Use this option if you
want to generate axis labels and tick mark values with an Annotate data set.
1308 SCATTER Statement Chapter 46
NONEEDLE
specifies that a plot have no lines that connect the shapes representing data points to
the x-y plane. The NONEEDLE option option has no effect when SHAPE=’PILLAR’
or SHAPE=’PRISM’.
Featured in: Example 5 on page 1320
ROTATE=angle-list
specifies one or more angles at which to rotate the x-y plane about the perpendicular
z axis. The units are degrees and the default value is 70. The angle-list value can be
a list of values, a starting and an ending value with an interval increment, or a
combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
The angle-list value(s) can be negative or positive and can be larger than 360. For
example, a rotation angle of 45 can also be expressed
rotate=405
rotate=-315
You can specify a sequence of angles to produce separate graphs for each angle.
The angles that are specified in the ROTATE= option are paired with any angles that
are specified with the TILT= option. If one option contains fewer values than the
other, the last value in the shorter list is paired with the remaining values in the
longer list.
See also: TILT= option on page 1309.
Featured in: Example 6 on page 1323
SHAPE=’symbol-name’ | shape-variable
specifies a symbol name or a character variable whose values are symbol names.
Symbols represent a scatter plot’s data points. By default, SHAPE=’PYRAMID’.
Values for symbol-name are
BALLOON
CLUB
CROSS
CUBE
CYLINDER
DIAMOND
FLAG
HEART
PILLAR
POINT
PRISM
PYRAMID
SPADE
SQUARE
STAR.
Figure 46.6 on page 1309 illustrates these symbol types with needles.
The G3D Procedure SCATTER Statement 1309
py
po re
sq
ra
f la
cr e
in
ua
sp o n d
m
di
os
g
t
cl
ad
id
he
am
s
ub
pr
sta on
ar
ba
ism
pi er
t
cy
r
llo
cu
lla
lin
be
r
d
If you specify SHAPE=’symbol-name’, all data points are drawn in that shape. For
example, the procedure draws all data points as balloons when you specify
shape=’balloon’
To size your points according to the values of the variable TYPE in your input data
set, use
scatter y*x=z / size=type;
data planes;
input x y z shape $;
datalines;
1 1 1 PRISM
1 2 1 PRISM
1 3 1 PRISM
2 1 1 PRISM
2 2 1 PRISM
2 3 1 PRISM
3 1 1 PRISM
3 2 1 PRISM
3 3 1 PRISM
1 1 2 BALLOON
1 2 2 BALLOON
1 3 2 BALLOON
2 1 2 BALLOON
2 2 2 BALLOON
2 3 2 BALLOON
3 1 2 BALLOON
3 2 2 BALLOON
3 3 2 BALLOON
;
The SHAPE variable is assigned a different value for each different Z value for a
single combination of X and Y values.
Ordinarily, the SCATTER statement only plots the Z value for the last observation
for a single combination of X and Y. However, you can use a DATA step to assign a
slightly different x, y position to all observations where Z is greater than 1:
data planes2;
set planes;
if z > 1 then x = x + .000001;
run;
Then you can use a SCATTER statement to produce a plot like the one in Figure 46.7
on page 1312:
proc g3d data=planes2;
scatter x*y=z / zmin=0 shape=shape;
run;
quit;
1312 SCATTER Statement Chapter 46
To reverse the Y axis in the plot that is shown in Figure 46.8 on page 1313, you can
write a DATA step like the following to reverse the Y values and, therefore, reverse the
Y axis when the values are plotted:
data minus_y;
set original;
y=-y;
run;
The previous code creates the MINUS_Y data set by reading the ORIGINAL data set,
and then multiplying the values of variable Y by -1. Although plotting Y values from
the MINUS_Y data set would reverse values on the Y axis, it would misrepresent the
original data. Such a plot would label the axis with the negative-Y values. You can
correct the problem by using PROC FORMAT to display Y values as they are stored in
the ORIGINAL data set:
proc format;
picture reverse
low - < 0 = ’09.00’
0 < - high = ’09.00’ (prefix=’-’)
0 = ’09.00’;
run;
Here, the PICTURE statement defines a picture format named REVERSE, which you
can refer to in DATA and PROC steps by using the name followed by a period. A
picture format is a template for printing numbers. The ’09.00’ specifications are digit
selectors that indicate which digits or columns in the variable values will display in
output; columns that do not have a specified digit selector will not be displayed in
output. Thus, a picture format for displaying the values of variable Y needs a column
for a minus sign, a column for units, and two columns for decimals. The digit selector 0
specifies that no leading zeros will display in a column, and the digit selector 9 specifies
that a leading zero will display in a column.
The PICTURE statement defines this new picture format for three data ranges. The
lowest value in the data up to but not including zero will display with no prefix, which
means negative values will display without a minus sign. All values above (but not
including) zero to the highest value in the data will be displayed with the specified
prefix, which in this case is a minus sign. Because zero is excluded from both ranges, it
is assigned its own picture with no prefix.
You can now assign the REVERSE format to the Y values from the MINUS_Y data
set and use Y to generate a scatter plot. The resulting plot displays Y’s negative values
without a prefix, and its positive values display with a minus sign prefix. This
effectively represents Y values as they are stored internally in the ORIGINAL data set,
thus correcting the data misrepresentation that results from multiplying Y by -1.
1314 Examples Chapter 46
The following code generates the scatter plot shown in Figure 46.9 on page 1314:
title1 ’Reverse Y Axis Order’;
Examples
This example shows a surface plot that reveals the shape of a generated data set
named HAT. The PLOT statement in this example relies entirely on procedure defaults.
The axes are scaled to include all data values and are labeled with the names of the
axes variables. The axes major tick marks are divided into three even intervals, and
the horizontal plane is rotated 70 around the z axis and tilted 70 toward you. The plot
is displayed with the colors that the GOPTIONS statement defines for the colors list.
Create the data set.REFLIB.HAT is generated data that produces a symmetric surface
pattern, which is useful for illustrating the PLOT statement and its options.
data reflib.hat;
do x=-5 to 5 by 0.25;
do y=-5 to 5 by 0.25;
z=sin(sqrt(x*x+y*y));
output;
end;
end;
run;
This example rotates the surface plot that is shown in Example 4 on page 1318 and
enhances its axes by adding reference lines and increasing the number of tick marks on
the y and z axes. It also raises the plot above the horizontal x-y plane.
Generate the surface plot. GRID draws reference lines for all x, y, and z axis tick marks.
ROTATE= specifies a rotation angle of 45. CTOP= and CBOTTOM= change the colors of the
plot’s top and bottom surfaces. YTICKNUM= and ZTICKNUM= specify the number of tick
marks for the y and z axes. ZMIN= and ZMAX= specify minimum and maximum values for the
z axis. Data that exceeds the range of ZMIN-to-ZMAX is displayed at the value of ZMIN or
ZMAX. Specifying a ZMIN= value that is below the minimum value in the data effectively raises
the plot above the horizontal plane.
proc g3d data=reflib.hat;
plot y*x=z / grid
rotate=45
ctop=red
cbottom=black
yticknum=5
zticknum=5
zmin=-3
zmax=1;
run;
quit;
This example modifies that shown in Example 1 on page 1314 by tilting the surface
plot 15 toward you and adding a side wall.
Generate the surface plot. SIDE draws a side wall for the graph. TILT= specifies a tilt angle
of 15 for the plot, which doesn’t affect the default rotation of 70.
proc g3d data=work.hat;
plot y*x=z / side
tilt=15;
run;
quit;
This example shows a scatter plot that examines the results of measuring the petal
length, petal width, and sepal length for the flowers of three species of iris. The
SCATTER statement in this example relies entirely on procedure defaults, which scale
the axes to include all data values, label the axes with the names of the axes variables,
divide the axes into three even intervals, rotate the horizontal plane 70 around the z
axis and tilt it 70 toward you, and display the plot with the colors that are defined for
the colors list. The data points are represented by pyramids, which are connected to the
horizontal plane with needles.
Create data set. REFLIB.IRIS contains petal and sepal measurements for the flowers of three
iris species, which are identified by species numbers.
data reflib.iris;
input sepallen sepalwid petallen petalwid spec_no;
datalines;
50 33 14 02 1
64 28 56 22 3
...more data lines...
63 33 60 25 3
53 37 15 02 1
;
1320 Example 5: Using Shapes in Scatter Plots Chapter 46
Other features:
DATA step
LABEL statement
NOTE statement
Data set: REFLIB.IRIS (see Example 4 on page 1318)
Sample library member: GTDSHAPE
The G3D Procedure Example 5: Using Shapes in Scatter Plots 1321
This program modifies that shown in Example 4 on page 1318 to use shape symbols
and color to distinguish information for various iris species. It also uses NOTE
statements to simulate a plot legend.
The program then generates a second plot to modify the first. As shown by the
following output, the second plot request suppresses the needles that connect data
points to the horizontal plane, and adds reference lines to make it easier to interpret
data values. It also labels the plot axes with descriptive text.
Figure 46.15 A Scatter Plot with Reference Lines and Axis Labels
Create data set. REFLIB.IRIS2 uses a DATA step to read and modify the REFLIB.IRIS data
set. The DATA step adds a variable that identifies the iris species. It also adds two additional
variables that store shape and color values for each iris species. These shapes and colors will
distinguish iris species in the plot.
data reflib.iris2;
set reflib.iris;
length species $12. colorval $8. shapeval $8.;
if spec_no=1 then
do;
species=’setosa’;
shapeval=’club’;
colorval=’blue’;
end;
if spec_no=2 then
do;
species=’versicolor’;
shapeval=’diamond’;
colorval=’red’;
end;
if spec_no=3 then
do;
species=’virginica’;
shapeval=’spade’;
colorval=’green’;
end;
run;
Generate the plot. COLOR= specifies the variable that contains color information for the iris
species. SHAPE= specifies the variable that contains shape information for the iris species.
proc g3d data=reflib.iris2;
scatter petallen*petalwid=sepallen
/ color=colorval
shape=shapeval;
The G3D Procedure Example 6: Rotating a Scatter Plot 1323
Create a legend using NOTE statements. The first NOTE statement clears any existing
notes. The second NOTE statement identifies the color key used for the different iris species.
note;
note j=r ’Species: ’ c=green ’Virginica ’
j=r c=red ’Versicolor ’
j=r c=blue ’Setosa ’;
run;
Generate the plot. NONEEDLE suppresses the line drawn from the x-y plane to the plot
point. GRID draws reference lines for x, y, and z axis tick marks.
proc g3d data=reflib.iris2;
scatter petallen*petalwid=sepallen
/ noneedle
grid
color=colorval
shape=shapeval;
Change the axes labels. To improve axes labels, the LABEL statement associates labels with
variable names.
label petallen=’Petal Length’
petalwid=’Petal Width’
sepallen=’Sepal Length’;
run;
quit;
This example produces a scatter plot of humidity data. It uses color to distinguish
air temperature ranges. The plot is rotated -15.
Create data set REFLIB.HUMID. The DATA step varies color according to specified
air-temperature ranges.
data reflib.humid;
length colorval $ 8.;
label wtemp=’Wet-Bulb Temp’;
label relhum=’Rel. Humidity’;
label atemp=’ Air Temp.’;
input atemp wtemp relhum;
if atemp<26 then colorval="blue";
else if atemp>=26 and atemp<+52 then colorval="red";
else if atemp>=52 and atemp<+78 then colorval="green";
else if atemp>=78 and atemp<+104 then colorval="lib";
else if atemp>104 then colorval="pink ";
datalines;
The G3D Procedure References 1325
0 1 67
0 2 33
...more data lines...
130 34 29
130 35 28
;
Generate the plot. CAXIS= specifies a color for the axis lines and tick marks. ROTATE=
specifies a rotation angle for the plot. SIZE= specifies the size of the plot symbols.
XTICKNUM=, YTICKNUM=, and ZTICKNUM= specify the number of tick marks for the x, y,
and z axes. ZMIN= and ZMAX= specify the minimum and maximum values for the z axis. Z-axis
values that exceed the values of the ZMAX= and ZMIN= options will be displayed at the value
of ZMAX= or ZMIN=.
proc g3d data=reflib.humid;
scatter atemp*wtemp=relhum
/ shape=’pillar’
color=colorval
caxis=blue
rotate=-15
size=.5
yticknum=5
xticknum=2
zticknum=4
zmin=0
zmax=100;
run;
quit;
References
Fisher, R.A. (1936), "The Use of Multiple Measurements in Taxonomic Problems,"
Annals of Eugenics, 7, 179–188.
Watkins, S.L. (1974), "Algorithm 483, Masked Three-Dimensional Plot Program with
Rotations (J6)," in Collected Algorithms from ACM, New York: Association for
Computing Machinery.
1326
1327
CHAPTER
47
The G3GRID Procedure
Overview 1327
Concepts 1329
About the Input Data Set 1329
Multiple Vertical Variables 1329
Horizontal Variables Along a Nonlinear Curve 1329
About the Output Data Set 1329
Interpolation Methods 1329
Default Bivariate Interpolation 1330
Spline Interpolation 1330
Spline Smoothing 1331
Procedure Syntax 1331
PROC G3GRID Statement 1332
GRID Statement 1333
Examples 1336
Example 1: Using the Default Interpolation Method 1336
Example 2: Using Spline Interpolation and a Smoothed Spline 1339
Example 3: Using Partial Spline Interpolation 1342
Example 4: Using Spline Interpolation 1343
References 1346
Overview
The G3GRID procedure processes an existing SAS data set to create a data set that
the G3D or GCONTOUR procedure can use to produce three-dimensional surface or
contour plots. The procedure creates a data set whose horizontal (x and y) variable
values form a complete grid, and it interpolates the value of the vertical (z) variables for
each point on the x-y plane.
Using the G3GRID procedure, you can
3 Create a rectangular grid of interpolated or smoothed values from irregularly
spaced observations for use in a three-dimensional surface or contour plot.
3 Complete a rectangular grid of interpolated or smoothed values for an input data
set that has an insufficient number of observations to produce a three-dimensional
surface or contour plot.
3 Interpolate or smooth data for a three-dimensional graph.
The G3GRID procedure does not produce graphics output. Instead, it produces an
output data set that you can use as the input data set for the G3D or GCONTOUR
procedure.
Figure 47.1 on page 1328 and Figure 47.2 on page 1328 illustrate the effect of the
G3GRID procedure on data.
1328 Overview Chapter 47
Figure 47.1 on page 1328 shows a collection of data points, where z=f(x, y). These
points are randomly distributed and cannot be displayed with a G3D surface plot,
although they can be displayed with a scatter plot.
Figure 47.2 on page 1328 shows a surface plot of the data set that is created by a
G3GRID interpolation of the original data set shown in Figure 47.1 on page 1328.
Note: The evenly distributed horizontal (x, y) data points form a grid for the
three-dimensional graph. 4
The G3GRID Procedure Interpolation Methods 1329
Concepts
Interpolation Methods
The G3GRID procedure can use one of three interpolation methods: bivariate
interpolation (the default), spline interpolation, and smoothed spline interpolation.
1330 Interpolation Methods Chapter 47
Spline Interpolation
If you specify the SPLINE option, a method is used that produces an interpolation or
smoothing that is optimally smooth in a certain sense (Harder and Desmarais 1972,
Meinguet 1979). The surface that is generated can be thought of as one that would be
formed if a stiff, thin metal plate were forced through or near the given data points. For
large data sets, this method is substantially more expensive than the default method.
The function u, formed when you specify the SPLINE option, is determined by letting
tj = (x ; y )
j j
t = (x; y)
and
1=2
t tj = (x xj )2 + (y yj )2
where
E (s ) =
;t s t log ( s t ) :
The coefficients c1, c2,..., cn and d1, d2, d3 of this polynomial are determined by these
equations:
(E + n I) c + T d = z
and
Tc=00
where
E
is the n n matrix E(ti, tj )
I
is the n n identity matrix
Spline Smoothing
To produce a smoothed spline, you can use the GRID statement’s SMOOTH= option
with the SPLINE option. The value or values specified in the SMOOTH= option are
substituted for in the equation that is described in “Spline Interpolation” on page
1330. A smoothed spline trades closeness to the original data points for smoothness. To
find a value that produces the best balance between smoothness and fit to the original
data, you can try several values for the SMOOTH= option.
Procedure Syntax
Requirements: Exactly one GRID statement is required.
Reminder: The procedure can include the SAS/GRAPH BY statement.
Supports: Output Delivery System (ODS)
1332 PROC G3GRID Statement Chapter 47
Syntax
PROC G3GRID <DATA=input-data-set>
<OUT=output-data-set>
<OUTTRI=output-data-set>;
Options
DATA=input-data-set
specifies the SAS data set that contains the variables to process. By default, the
procedure uses the most recently created SAS data set.
See also: “SAS Data Sets” on page 29 and “About the Input Data Set” on page 1329
OUT=output-data-set
specifies the output data set. The data set contains any BY variables that you
specify, the interpolated or smoothed values of the vertical variables (z through z-n),
and the coordinates for all grid positions on the horizontal (x-y) plane. If you specify
smoothing, the output data set also contains a variable named _SMTH_, whose value
is a smoothing parameter. The observations in this data set are ordered by any
variables that you specify with a BY statement. By default, the output of PROC
G3GRID creates WORK.DATA1.
Depending on the shape of the original data and the options you use, the output
data set may contain values for the vertical (z through z-n) values that are outside of
the range of the original values in the data set.
Featured in: Example 1 on page 1336
OUTTRI=output-data-set
specifies an additional output data set that contains triangular coordinates. The data
set will contain any BY variables that you specify, the two horizontal variables giving
the horizontal (x -y) plane coordinates of the input points, and a variable named
TRIANGLE that uses integer values to label the triangles. The observations in this
data set are ordered by any variables that you specify with a BY.
The data set contains three observations for each value of the variable
TRIANGLE. The three observations give the coordinates of the three vertices of the
triangle. Points on the convex hull of the input data set of points are also assumed to
lie in degenerate triangles whose other vertices are at infinity. The points in the
convex hull can be recovered by keeping only those triangles with exactly two
missing vertices.
The G3GRID Procedure GRID Statement 1333
By default, no OUTTRI= data set is produced. OUTTRI= is not valid when you
specify the SPLINE option in the GRID statement.
GRID Statement
Specifies the three numeric variables for interpolation or smoothing. Optionally specifies the
number of observations (x and y values) in the output data set; output values for the two horizontal
variables x,y; and the interpolation method for the vertical variables.
Requirements: Exactly one grid request is required.
Syntax
GRID grid-request </option(s)>;
grid-requestmust be:
y*x=z(s)
grid-request must be
y*x=z(s)
option(s) can be one or more options from any or all of the following categories:
3 grid options:
AXIS1=ascending-value-list
AXIS2=ascending-value-list
NAXIS1=n
NAXIS2=n
3 interpolation options:
JOIN
NEAR=n
NOSCALE
PARTIAL
SMOOTH=ascending-value-list
SPLINE
Required Arguments
y*x=z(s)
specifies three or more numeric variables from the input data set:
y
is one of the variables that forms the horizontal (x-y) plane.
x
is another of the variables that forms the horizontal (x-y) plane.
z(s)
is one or more vertical variables for the interpolation.
1334 GRID Statement Chapter 47
Although the GRID statement can specify only two horizontal variables, it can
include multiple vertical variables. Separate vertical variables with blanks:
grid x*y=z w u v;
Options
AXIS1=ascending-value-list
specifies a list of numeric values to assign to the first (y) variable in the grid request
for the output data set. Numbers that you specify with this option determine the
number of values for y and override a value that you specify with the NAXIS1=
option. The ascending-value-list must be arranged in ascending order. It can be an
explicit list of values, a starting and an ending value with an interval increment, or a
combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
Featured in: Example 1 on page 1336 and Example 4 on page 1343
AXIS2=ascending-value-list
specifies a list of numeric values to assign to the second (x) variable in the grid
request for the output data set. Numbers that you specify with this option determine
the number of values for x and override a value that you specify with the NAXIS2=
option. The ascending-value-list must be arranged in ascending order. The value can
be an explicit list, a starting and an ending value with an interval increment, or a
combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
Featured in: Example 1 on page 1336 and Example 4 on page 1343
JOIN
uses a linear interpolation within a set of triangular regions that are formed from
the input data set. This interpolation method creates values in the range of the
initial values of the vertical variable, but the resulting interpolated surface may not
be smooth.
NAXIS1=n
specifies the number of values for the first (y) variable in the grid request for the
output data set. You can determine the actual values used for y by taking the
minimum and maximum values of y and dividing the range into n–1 equal sections.
By default, NAXIS1=11.
A value specified with NAXIS1= is ignored if values are also specified with AXIS1=.
NAXIS2=n
specifies the number of values for the second (x) variable in the grid request for the
output data set. You can determine the actual values that are used for x by taking
the minimum and maximum values of x and dividing the range into n–1 equal
sections. By default, NAXIS2=11.
A value specified with NAXIS2= is ignored if values are also specified with AXIS2=.
NEAR=n
specifies the number of nearest data points to use for computing the estimates of the
first and second derivatives. As NEAR= values become larger, time and computation
The G3GRID Procedure GRID Statement 1335
costs increase significantly. NEAR= is ignored if you specify SPLINE. The value of n
must be greater than or equal to 3. By default, NEAR=3.
If the number of input data points is insufficient for the number that you specify
with NEAR=, a smaller number of data points is used.
Featured in: Example 3 on page 1342
NOSCALE
specifies that the x and y variables not be scaled to the same range before
interpolation. By default, the interpolation is performed after both variables are
similarly scaled because the interpolation methods assume that the scales of x and y
are comparable.
PARTIAL
specifies that a spline be used to estimate the derivatives for the biquintic polynomial
interpolation. A bivariate spline is fit to the nearest neighbors and used to estimate
the needed derivatives. This option produces results that are less smooth than those
produced by the SPLINE option and uses fewer computer resources. However, the
results produced by PARTIAL are smoother than those that are produced by the
default. If you use both PARTIAL and the SPLINE option, PARTIAL is ignored.
Featured in: Example 3 on page 1342
SMOOTH=ascending-value-list
specifies a list of numbers for smoothing parameters. Use this option only when you
also use the SPLINE option. The ascending-value-list must be arranged in ascending
order. The value can be an explicit list, a starting and an ending value with an
interval increment, or a combination of both forms:
n <...n>
n TO n <BY increment>
n <...n> TO n <BY increment > <n <...n> >
For each value of the smoothing parameter, a function u (x, y) is formed that
minimizes
1 12
1 n
6j =1 u xj ; yj 2
zj + 62j =0 dxdy
n
01
where n is the number of data points and the pairs (xj, yj )are the available points,
with corresponding function values zj (Wahba 1979).
The higher the value of the smoothing parameter, the smoother the resulting
interpolation. The lower the smoothing parameter, the closer the resulting surface is
to the original data points. A smoothing parameter of 0 produces the same results as
the SPLINE option without SMOOTH=.
This procedure repeats for each value of the smoothing parameter. The output
data set that you specify in the OUT= option contains the interpolated values, the
values of the grid points, and the values of the smoothing parameter in the variable
_SMTH_. The output data set contains a separate grid for each value of the
smoothing parameter.
Featured in: Example 2 on page 1339
SPLINE
specifies the use of a bivariate spline (Harder and Desmarais 1972, Meinguet 1979)
to interpolate or to form a smoothed estimate if you also use the SMOOTH= option.
3
This option results in the use of an order n algorithm, where n is the number of
1336 Examples Chapter 47
input data points. Consequently, this method can be time-consuming. If you use
more than 100 input points, the procedure may use excessive time.
Featured in: Example 2 on page 1339 and Example 4 on page 1343
AXIS1=, AXIS2= (number of values for AXIS1=) * (number of values for AXIS2=)
AXIS1=, NAXIS1= (number of values for AXIS1=) * 11
Examples
This example demonstrates the default interpolation method that is used by the
GRID statement. The example first generates a scatter plot of random data to show the
concentration of data values before processing with the G3GRID procedure. The
original data do not contain enough combinations of x, y, and z values to generate a
surface plot with the G3D procedure, or a contour plot with the GCONTOUR procedure.
The example then runs the G3GRID procedure to interpolate additional x, y, and z
values. Because no interpolation method is specified, the default interpolation method
is used. The resulting output data set is used as input to the G3D procedure, which
generates the surface plot shown in the following output.
1338 Example 1: Using the Default Interpolation Method Chapter 47
Create data set. REFLIB.NUMS uses a set of randomly sampled points to create the data used
in this and all remaining examples in this chapter.
data reflib.nums;
keep x y z;
do i=1 to 30;
x=10*ranuni(33)-5;
y=10*ranuni(35)-5;
z=sin(sqrt(x*x+y*y));
output;
end;
run;
run;
Process points with PROC G3GRID. OUT= on G3GRID specifies a name for a temporary
output data set. GRID specifies the variables Y*X=Z for the output data set. AXIS@@@ 1
proc g3grid data=reflib.nums out=default;
grid y*x=z / axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
Generate a surface plot. The G3D procedure uses as its input data set the G3GRID
procedure’s output data set.
Process points with PROC G3GRID. SPLINE specifies the bivariate spline method for the
data set interpolation.
Process points with PROC G3GRID. SMOOTH= specifies the smoothing parameter to use
during spline interpolation.
This example specifies a partial spline interpolation method on the GRID statement,
using eight nearest neighbors for computing the estimates of the first and second
derivatives. The output data set, when used in PROC G3D, generates a smoother
surface plot than the surface plot that results from the default interpolation shown in
Example 1 on page 1336, but not as smooth as the surface plot that results from the
spline interpolation shown in Example 2 on page 1339.
Process points with PROC G3GRID. PARTIAL specifies that a spline be used to estimate the
derivatives for the biquintic polynomial interpolation. NEAR= specifies the number of nearest
neighbors to be used for computing the estimates of the first and second derivatives.
proc g3grid data=reflib.nums out=partial;
grid y*x=z / partial
near=8
axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
This example demonstrates the default and spline interpolation methods when used
by the GCONTOUR procedure to generate contour plots from the resulting output data
sets.
axis1 width=3;
Process points with PROC G3GRID. SPLINE specifies the bivariate spline method for the
data set interpolation.
proc g3grid data=reflib.nums out=numspl;
grid y*x=z / spline
axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
References
Akima, Hiroshi (1978), "A Method of Bivariate Interpolation and Smooth Surface
Fitting for Irregularly Distributed Data Points," ACM Transaction on Mathematical
Software, 4, 148–159.
Harder, R.L. and Desmarais, R.N. (1972), "Interpolation Using Surface Splines,"
Journal of Aircraft, 9, 189–191.
Ripley, B.D. (1981), Spatial Statistics, New York: John Wiley & Sons, Inc.
Wahba, Grace (1979), "How to Smooth Curves and Surfaces with Splines and
Cross-validation," in U.S. Army Research Office Report 79–2, Proceedings of the 24th
Conference on the Design of Experiments.
1347
CHAPTER
48
The MAPIMPORT Procedure
Overview 1347
Procedure Syntax 1348
PROC MAPIMPORT Statement 1348
Examples 1349
Example 1: Including All Variables from the SHP Shapefile 1349
Example 2: Including Selected Variables from the SHP Shapefile 1350
Example 3: Excluding a Variable from the SHP Shapefile 1350
Example 4: Including Selected Variables from the DBF Shapefile 1350
Overview
The MAPIMPORT procedure enables you to import ESRI shapefiles (spatial data
formats) and process the SHP files into SAS/GRAPH traditional map data sets. See
“About Traditional Data Sets” on page 999 for more information. The shapefiles file
types are described in the following table:
Procedure Syntax
Requirements: The name and location of an output data set and the complete path for
the input data file.
Reminder: The single quotes surrounding field identifiers are optional when the field
identifiers follow the SAS naming convention. Single quotes are required for field
identifiers that are non-standard SAS names. When field identifiers placed in single
quotes are non-standard SAS names, the field identifiers are converted to a standard
SAS name in the traditional map data set. For more information about the standard
SAS naming convention, see names in the SAS Language in SAS Language Reference:
Concepts. For more information on how invalid field identifiers placed in single quotes
are renamed, see the SAS System option VALIDVARNAME in SAS/ACCESS for
Relational Databases: Reference.
PROC MAPIMPORT
OUT= traditional-map-data-set
DATAFILE= ’path-to-shapefile’
<CONTENTS>;
<CREATE_ID_>;
<SELECT <’>field-identifier-1<’>< ...< ’>field-identifier-n<’>>>;
<EXCLUDE <’>field-identifier-1<’>< ...< ’>field-identifier-n<’>>>;
<RENAME <’>field-identifier-1<’>=SAS-variable-name-1<...< ’>field-identifier-
n< ’>=SAS-variable-name-n>>;
PROC MAPIMPORT
OUT= traditional-map-data-set
DATAFILE= ’path-to-shapefile’
<CONTENTS>;
<CREATE_ID_>;
<SELECT <’>field-identifier-1<’>< ...< ’>field-identifier-n<’>>>;
<EXCLUDE <’>field-identifier-1<’>< ...< ’>field-identifier-n<’>>>;
<RENAME <’>field-identifier-1<’>=SAS-variable-name-1<...< ’>field-identifier-
n< ’>=SAS-variable-name-n>>;
Required Arguments
OUT= traditional-map-data-set
specifies the name of the traditional map data set created.
The MAPIMPORT Procedure Example 1: Including All Variables from the SHP Shapefile 1349
DATAFILE= ’path-to-shapefile’
specifies the path and filename of the shapefile that is read and processed.
Note: By default, all of the fields in a shapefile are included in the traditional map
data set. To only include specific fields in the traditional map data set, use the SELECT
statement. To exclude specific fields from being in the traditional map data set, use the
EXCLUDE statement . 4
Optional Argument
CONTENTS
displays information about the SHAPEFILE, including field identifier names and
types.
CREATE_ID_
creates a map ID variable named _ID_ with a unique value for each polygon in the
map. This variable will be created automatically if the .dbf file is missing.
Optional Statements
SELECT field-identifier-n
selects only the specified fields in the SHAPEFILE to be included in the traditional
map data set.
EXCLUDE field-identifier-n
excludes the specified fields in the SHAPEFILE from being in the traditional map
data set.
RENAME field-identifier-n= SAS-variable-name-1
renames the specified fields in the traditional map data set. By default the field
identifiers in the SHAPEFILE will be the SAS variable names in the traditional map
data set.
Note: Field identifiers that are invalid SAS variable names must be placed in single
quotes. A field identifier placed in single quotes will be automatically renamed to a
valid SAS variable name using the SELECT or EXCLUDE statement. To change the
field identifier to a specific valid SAS variable name, use the RENAME statement. 4
Examples
The following examples use shapefiles with the .shp and .dbf extensions. Replace the
shapefiles locations, filenames, and field-identifiers with information from your
shapefiles to run these examples.
5
P A R T
CHAPTER
49
The DATA Step Graphics
Interface
Overview 1354
Syntax 1355
Requirements 1356
Applications of the DATA Step Graphics Interface 1356
Enhancing Existing Graphs 1356
Creating Custom Graphs 1356
Using the DATA Step Graphics Interface 1357
Summary of Use 1357
Producing and Storing DSGI Graphs 1357
Structure of DSGI Data Sets 1358
Using SAS/GRAPH Global Statements with DSGI 1358
Operating States 1359
The Current Window System 1359
Debugging DSGI Programs 1360
DSGI Graphics Summary 1360
DSGI Functions 1360
DSGI Routines 1364
Creating Simple Graphics with DSGI 1367
Setting Attributes for Graphics Elements 1368
How Operating States Control the Order of DSGI Statements 1370
Functions That Change the Operating State 1370
Order of Functions and Routines 1371
Bundling Attributes 1373
Attributes That Can Be Bundled for Each Graphics Primitive 1373
Assigning Attributes to a Bundle 1374
Selecting a Bundle 1375
Defining Multiple Bundles for a Graphics Primitive 1375
How DSGI Selects the Value of an Attribute to Use 1375
Disassociating an Attribute from a Bundle 1376
Using Viewports and Windows 1376
Defining Viewports 1377
Clipping around Viewports 1377
Defining Windows 1377
Activating Transformations 1378
Inserting Existing Graphs into DSGI Graphics Output 1379
Generating Multiple Graphics Output in One DATA Step 1380
Processing DSGI Statements in Loops 1380
Examples 1381
Vertically Angling Text 1381
Changing the Reading Direction of the Text 1384
Using Viewports in DSGI 1385
1354 Overview Chapter 49
Overview
The DATA Step Graphics Interface (DSGI) enables you to create graphics output
within the DATA step or from within an SCL application. Through DSGI, you can call
the graphics routines used by SAS/GRAPH software to generate an entire custom graph
or to add features to an existing graph. You can use DSGI to write a custom graphics
application in conjunction with all the power of the programming statements accessible
by the DATA step.
DSGI provides many of the same features as the Annotate facility, but it also has
many advantages over the Annotate facility.
3 You can use DSGI functions and routines through SCL.
3 You can save disk space. DSGI graphics can be generated through the DATA step
without creating an output data set. The graphics output is stored as a catalog
entry in the catalog you select and, optionally, is displayed after the DATA step is
submitted.
3 DSGI generates graphics faster than the Annotate facility. With the Annotate
facility, you must first create a data set and then submit a PROC step to display
the graphics output. In DSGI, you eliminate the PROC step because the graphics
output is generated after the DATA step.
3 DSGI supports viewports and windows, which enable you to specify the
dimensions, position, and scale of the graphics output. They also allow you to
include multiple graphs in the same graphics output.
You should consider using the Annotate facility for enhancing procedure output and
using DSGI for creating custom graphics without using a graphics procedure.
DSGI is based upon the Graphics Kernal System (GKS) standard, although it does
not follow a strict interpretation, nor is it implemented on a particular level of GKS.
GKS was used to provide a recognizable interface to the user. Because of its modularity,
the standard allows for enhancements to DSGI without the side effect of converting
programs between versions of SAS/GRAPH software.
This chapter explains the concepts used to create graphics output with DSGI. The
discussion provides an overview of the functions and routines used in DSGI. For
complete details of each function and routine, see Chapter 50, “DATA Step Graphics
Interface Dictionary,” on page 1401.
Display 49.1 on page 1355 shows a pie chart that was created entirely with DSGI
functions. Display 49.2 on page 1355 is an example of a text slide that was created with
DSGI statements.
The DATA Step Graphics Interface Syntax 1355
Syntax
DSGI uses GASK routines and functions to draw graphics elements. These
statements have the following syntax:
CALL GASK(operator, arguments);
return-code-variable=function-name (operator, arguments);
where
arguments are the additional required variables or values for the routine or
function.
1356 Requirements Chapter 49
return-code- is an arbitrary name and can be any numeric variable name. It will
variable hold the return code upon execution of the function.
function-name is the DSGI command you want to execute and must be one of the
following: GDRAW, GINIT, GPRINT, GRAPH, GSET, or GTERM.
operator is a character string that names the function you either want to
submit or for which you want the current settings. When used with
functions, operator can take different values depending on
function-name.
Requirements
When using DSGI statements, the following formats for arguments must be used:
3 All x and y coordinates are expressed in units of the current window system. (See
“The Current Window System” on page 1359 for details.)
3 The arguments used with DSGI functions can be expressed as either constants or
variables. The arguments used with GASK routines must be variable names since
values are returned through them. See Chapter 50, “DATA Step Graphics
Interface Dictionary,” on page 1401 for a complete explanation of each argument
used with DSGI functions and routines.
3 All arguments that are character constants must be enclosed in either single or
double quotation marks.
3 arcs
3 bars
3 ellipses
3 elliptical arcs
3 lines
3 markers
3 pie slices
3 polygons (filled areas)
3 text.
To create custom graphs, you must provide the system with the following information:
3 DSGI statements to draw graphics elements
3 the coordinates of the graphics elements in the output.
In addition, you can specify the color, pattern, size, style, and position of these
graphics elements.
Summary of Use
To generate graphics output using DSGI, you generally follow these steps:
1 On a grid that matches the dimensions of the graphics output, sketch the output
you want to produce.
2 Determine the coordinates of each graphics element.
3 In the DATA step, write the program to generate the graphics output. The basic
steps are to
initialize DSGI
a
open a graphics segment
b
generate graphics elements
c
close the graphics segment
d
end DSGI.
e
4 Submit the DATA step with a final RUN statement to display the output.
Note: The DISPLAY graphics option must be in effect for the graphics output to be
displayed. See Chapter 8, “Graphics Options and Device Parameters Dictionary,” on
page 261 for more information about the DISPLAY graphics option. 4
By default, DSGI uses the name DSGI if you have not specified a name with the
GRAPH(’CLEAR’, . . . )function. By default, the catalog entry is stored in WORK.GSEG
unless you specify another catalog with the GSET(’CATALOG’, . . . )function.
If you generate another graph using a name that matches an existing catalog entry
in the current catalog, DSGI uses the default naming conventions for the catalog entry.
See “Names and Descriptions of Catalog Entries” on page 55 for a description of the
conventions used to name catalog entries.
If you want to store your output in a permanent library or in a different temporary
catalog, you must use the GSET(’CATALOG’, . . . )function. This function allows you to
specify the libref and catalog name for the output catalog. Before you use the
GSET(’CATALOG’, . . . )function, you must allocate the libref using a LIBNAME
statement.
You can redisplay DSGI graphics output stored in catalog entries using the
GREPLAY procedure or the GRAPH window.
Graphics Option
DSGI Function That Is Overridden
GSET(’CBACK’, . . . ) CBACK=
GSET(’COLREP’, . . . ) COLORS=
GSET(’DEVICE’, . . . ) DEVICE=
GSET(’HPOS’, . . . ) HPOS=
GSET(’HSIZE’, . . . ) HSIZE=
GSET(’VPOS’, . . . ) VPOS=
GSET(’VSIZE’, . . . ) VSIZE=
The DATA Step Graphics Interface The Current Window System 1359
Graphics Option
DSGI Function That Is Overridden
GSET(’TEXCOLOR’, . . . ) CTEXT=
GSET(’TEXFONT’, . . . ) FTEXT=
GSET(’TEXHEIGHT’, . . . ) HTEXT=
Operating States
The operating state of DSGI determines which functions and routines may be issued
at any point in the DATA step. You can only submit a function or routine when the
operating state is appropriate for it. See “How Operating States Control the Order of
DSGI Statements” on page 1370 for a discussion of how functions and routines should
be ordered within the operating states.
The operating states defined by DSGI are
GKCL facility closed, the initial state of DSGI. No graphical resources have
been allocated.
GKOP facility open. When DSGI is open, you may check the settings of the
attributes.
Refer to individual functions and routines in Chapter 50, “DATA Step Graphics
Interface Dictionary,” on page 1401 for the operating states from which that function or
routine can be issued.
DSGI Functions
DSGI provides functions that
3 initialize and terminate DSGI
3 generate graphics elements
3 control the appearance of graphics elements by setting attributes
3 control the overall appearance of the graphics output
3 perform management operations for the catalog
3 control messages issued by DSGI.
Table 49.1 on page 1360 summarizes the types of operations available and the
functions used to invoke them. Refer to Chapter 50, “DATA Step Graphics Interface
Dictionary,” on page 1401 for details about each function.
DSGI Function
Operations Associated Function Description
Bundling Attributes (valid values for xxx are FIL, LIN,
MAR, and TEX)
GSET(’ASF’, . . .) sets the aspect
source flag of an
attribute
GSET(’xxxINDEX’, . . . ) selects the bundle
of attributes to use
GSET(’xxxREP’, . . . ) assigns attributes
to a bundle
Setting Attributes That Affect Graphics Elements
The DATA Step Graphics Interface DSGI Functions 1361
DSGI Function
Operations Associated Function Description
color index GSET(’COLREF’), . . .) assigns a color
name to color index
fill area GSET(’FILCOLOR’, . . . ) selects the color of
the fill area
DSGI Function
Operations Associated Function Description
GSET(’CATALOG’, . . . ) selects the catalog
to use
GSET(’CBACK’, . . . ) selects the
background color
DSGI Function
Operations Associated Function Description
line GDRAW(’LINE’, . . . ) draws a single line,
a series of
connected lines, or
a dot
Defining Viewports
GSET(’CLIP’, . . .) turns clipping on or
off
DSGI Function
Operations Associated Function Description
Defining Windows
DSGI Routines
DSGI routines return the values set by some of the DSGI functions. Table 49.2 on
page 1364 summarizes the types of values that the GASK routines can check. Refer to
Chapter 50, “DATA Step Graphics Interface Dictionary,” on page 1401 for details about
each routine.
DSGI
Operations Associated Routine Routine Description
Checking Attribute Bundles (valid values for xxx are FIL,
LIN, MAR, and TEX)
GASK(’ASK’, . . .) returns the aspect
source flag of the
attribute
GASK(’xxxINDEX’, . . . ) returns the index of the
active bundle
GASK(’xxxREP’, . . . ) returns the attributes
assigned to the bundle
Checking Attribute Settings
DSGI
Operations Associated Routine Routine Description
GASK(’HTML’, . . . ) finds the HTML string
that is in effect when
one of the following
graphic elements is
drawn: bar, ellipse, fill,
mark, pie, and text.
DSGI
Operations Associated Routine Routine Description
GASK(’HPOS’, . . . ) returns the number of
columns in the graphics
output area
GASK(’HSIZE’, . . . ) returns the width of the
graphics output area in
units of inches
DSGI
Operations Associated Routine Routine Description
GASK(’VIEWPORT’, . . . ) returns the coordinates
of the viewport assigned
to the transformation
number
Checking Window Definitions
GASK(’WINDOW’, . . .) returns the coordinates
of the window assigned
to the transformation
number
Notice that there are two pairs of functions that work together within a DSGI DATA
step (shown by a and b in Figure 49.1 on page 1368). The first pair, GINIT() and
GTERM(), begin and end DSGI. Within the first pair, the second pair, GRAPH(’CLEAR’,
. . . )and GRAPH(’UPDATE’, . . . )begin and end a graphics segment. You can repeat
these pairs within a single DATA step to produce multiple graphics output; however,
the relative positions of these functions must be maintained within a DATA step. See
“Generating Multiple Graphics Output in One DATA Step” on page 1380 for more
information about producing multiple graphics outputs from one DATA step.
The order of these steps is controlled by DSGI operating states. Before any DSGI
function or routine can be submitted, the operating state in which that function or
routine can be submitted must be active. See “How Operating States Control the Order
of DSGI Statements” on page 1370.
Graphics
Output
Primitive Functions Associated Attributes
Attribute functions must precede the graphics primitive they control. Once an
attribute is set, it controls any associated graphics primitives that follow. If you want to
change the setting, you can issue another GSET(attribute, . . . )function with the new
setting.
1370 Creating Simple Graphics with DSGI Chapter 49
If you do not set an attribute before you submit a graphics primitive, DSGI uses the
default value for the attribute. Refer to Chapter 50, “DATA Step Graphics Interface
Dictionary,” on page 1401 for the default values used for each attribute.
Because these functions change the operating state, you must order all other
functions and routines so that the change in operating state is appropriate for the
functions and routines that follow. The following program statements show how the
operating state changes from step to step in a typical DSGI program. They also
summarize the functions and routines that can be submitted under each operating
state. The functions that change the operating state are included as actual statements.
Refer to “Operating States” on page 1402 for the operating states from which functions
and routines can be submitted.
data dsname;
Functions and routines within each operating state can technically be submitted in
any order; however, once an attribute is set, it remains in effect until the end of the
DATA step or until you change its value. If you are producing multiple graphics output
within the same DATA step, the attributes for one output affect the ones that follow.
Attributes are not reset until after the GTERM() function is submitted.
Notice that you can set attributes for the graphics primitives in several places. As
long as the functions that set the attributes are executed before the graphics primitives,
they will affect the graphics output. If you execute them after a graphics primitive, the
primitive is not affected. See “Setting Attributes for Graphics Elements” on page 1368.
The following program statements illustrate a more complex DSGI program that
produces Display 49.3 on page 1373 when submitted. Notice that all attributes for a
graphics primitive are executed before the graphics primitive. In addition, the GINIT()
and GTERM() pairing and the GRAPH(’CLEAR’) and GRAPH(’UPDATE’) pairing are
maintained within the DATA step. Refer to “Operating States” on page 1402 for the
operating states in which each function and routine can be submitted.
1372 Creating Simple Graphics with DSGI Chapter 49
Bundling Attributes
DSGI allows you to bundle attributes. As a result, you can select a group of attribute
values rather than having to select each one individually. This feature is useful if you
use the same attribute settings over and over within the same DATA step.
To use an attribute bundle, you assign the values of the attributes to a bundle index.
When you want to use those attributes for a graphics primitive, you select the bundle
rather than set each attribute separately.
Table 49.4 Attributes That Can Be Bundled for Each Graphics Primitive
Associated Attributes
Graphics Output Primitive That Can Be Bundled
GDRAW(’ARC’, . . . ) LINCOLOR, LINTYPE,
LINWIDTH
GDRAW(’BAR’, . . . ) FILCOLOR, FILSTYLE,
FILTYPE
Associated Attributes
Graphics Output Primitive That Can Be Bundled
GDRAW(’ELLIPSE’, . . . ) FILCOLOR, FILSTYLE,
FILTYPE
GDRAW(’FILL’, . . . ) FILCOLOR, FILSTYLE,
FILTYPE
GDRAW(’MARK’, . . . ) MARCOLOR,
MARSIZE, MARTYPE
data dsname;
.
. /* other DATA step statements */
.
/* associate the bundle with the index 1 */
rc=gset(’texrep’, 1, 2, ’zapf’);
.
. /* more statements */
.
/* assign the text attributes to a bundle */
rc=gset(’asf’, ’texcolor’, ’bundled’);
rc=gset(’asf’, ’texfont’, ’bundled’);
The bundled attributes are used when an associated GDRAW function is executed. If
the ASF of an attribute is not set to ’BUNDLED’ at the time a GDRAW function is
executed, DSGI searches for a value to use in the following order:
The DATA Step Graphics Interface Bundling Attributes 1375
Selecting a Bundle
Once you have issued the GSET(’ASF’, . . . )and GSET(’xxx REP’, . . . )functions, you
can issue the GSET(’xxx INDEX’, . . . )function to select the bundle. The following
statement selects the bundle defined in the previous example:
/* invoke the bundle of text attributes */
rc=gset(’texindex’, 1);
When you activate the second bundle, the graphics primitives for the text that
follows will use the third color, blue, and the SWISS font.
Note: When using a new bundle, you do not need to reissue the GSET(’ASF’, . . . )
functions for the attributes that will be bundled. Once the ASF of an attribute has been
set, the setting remains in effect until it is changed. 4
In subsequent statements, you activate the bundle, select other attributes for the
line, and then draw a line:
/* activate the bundle */
rc=gset(’linindex’, 3);
The color, type, and width associated with the line bundle are used rather than the
attributes set just before the GDRAW(’LINE’, . . . )function was executed. The line that
1376 Using Viewports and Windows Chapter 49
is drawn is green (the second color from the colors list of the COLORS= graphics
option), 5 units wide, and solid (line type 1).
During processing, DSGI chooses the value of an attribute using the following logic:
1 Get the index of the active line bundle.
2 Check the ASF of the LINCOLOR attribute. If the ASF is ’INDIVIDUAL’, the
value selected with GSET(’LINCOLOR’, . . .) is used; otherwise, the LINCOLOR
associated with the bundle index is used.
3 Check the ASF of the LINTYPE attribute. If the ASF is ’INDIVIDUAL’, the value
selected with GSET(’LINTYPE’, . . .) is used; otherwise, the LINTYPE associated
with the bundle index is used.
4 Check the ASF of the LINWIDTH attribute. If the ASF is ’INDIVIDUAL’, the
value selected with GSET(’LINWIDTH’, . . .) is used; otherwise, the LINWIDTH
associated with the bundle index is used.
5 Draw the line using the appropriate color, type, and width for the line.
Defining Viewports
You can define a viewport with the GSET(’VIEWPORT’, n, . . . )function, where n is
the transformation number of the viewport you are defining. You can also use this
function to define multiple viewports, each containing a portion of the graphics output
area. You can then place a separate graph, part of a graph, or graphics elements within
each viewport.
The following program statements divide the graphics output area into four subareas:
/* define the first viewport, indexed by 1 */
rc=gset(’viewport’, 1, .05, .05, .45, .45);
Once you define the viewports, you can insert existing graphs or draw graphics
elements in each viewport by activating the transformation of that viewport.
Defining Windows
You can define a window by using the GSET(’WINDOW’,n, . . . )function, where n is
the transformation number of the window you are defining. If you are defining a
window for a viewport you have also defined, n must match the transformation number
of the viewport.
You can scale the x and y axes differently for a window. The following program
statements scale the axes for each of the four viewports defined earlier in "Defining
Viewpoints":
/* define the window for viewport 1 */
rc=gset(’window’, 1, 0, 50, 20, 100);
1378 Using Viewports and Windows Chapter 49
See “Scaling Graphs by Using Windows” on page 1388 for an example of using
windows to scale graphs.
Note: When you define a window for a viewport, the transformation numbers in the
GSET(’VIEWPORT’, . . . )and GSET(’WINDOW’, . . . )functions must match in order
for DSGI to activate them simultaneously. 4
Activating Transformations
Once you have defined a viewport or window, you must activate the transformation
in order for DSGI to use the viewport or window. To activate the transformation, use
the GSET(’TRANSNO’,n, . . . )function where n has the same value as n in
GSET(’VIEWPORT’,n, . . . )or GSET(’WINDOW’,n, . . . ).
The following program statements illustrate how to activate the viewports and
windows defined in the previous examples:
/* define the viewports */
.
.
.
/* define the windows */
.
.
.
/* activate the first transformation */
gset(’transno’, 1);
.
. /* graphics primitive functions follow */
.
/* activate the second transformation */
gset(’transno’, 2);
.
. /* graphics primitive functions follow */
.
/* activate the third transformation */
gset(’transno’, 3);
.
. /* graphics primitive functions follow */
.
/* activate the fourth transformation */
gset(’transno’, 4);
.
. /* graphics primitive functions follow */
.
When you activate these transformations, your display is logically divided into four
subareas as shown in Figure 49.2 on page 1379.
The DATA Step Graphics Interface Inserting Existing Graphs into DSGI Graphics Output 1379
Figure 49.2 Graphics Output Area Divided into Four Logical Transformations
If you want to use the default viewport and window after selecting different ones,
execute the GSET(’TRANSNO’, 0) function to reselect the default transformation for
DSGI.
.
.
.
/* select the output catalog to the */
/* catalog that contains ’map’ */
rc=gset(’catalog’, ’local’, ’mapctlg’);
.
.
.
These statements put the existing graph ’MAP’ in the upper half of the graphics
output.
If you use global SAS/GRAPH statements when producing multiple output from one
DATA step, the last definition of the statements is used for all displays.
.
.
.
do j=1 to 5;
rc=gset(’device’, devices{j});
.
.
.
rc=ginit();
.
.
.
do i=1 to 5;
rc=graph(’clear’);
rc=gset(’filcolor’, i);
rc=gdraw(’bar’, 45, 45, 65, 65);
rc=graph(’update’);
end;
.
.
.
rc=gterm();
end;
cards;
tek4105 hp7475 ps qms800 ibm3279
;
run;
The inner loop produces five graphs for each device. Each graphics output produced
by the inner loop consists of a bar. The bar uses a different color for each graph. The
outer loop produces all of the graphs for five different devices. A total of 25 graphs is
generated by these loops.
Examples
The following examples show different applications for DSGI and illustrate some of
its features such as defining viewports and windows, inserting existing graphs, angling
text, using GASK routines, enlarging a segment of a graph, and scaling a graph.
These examples use some additional graphics options that may not be used in other
examples in this book. Because the dimensions of the default window vary across
devices, the TARGETDEVICE=, HSIZE=, and VSIZE= graphics options are used to
make the programs more portable. The COLORS= graphics option provides a standard
colors list.
Refer to Chapter 50, “DATA Step Graphics Interface Dictionary,” on page 1401 for a
complete description of each of the functions used in the examples.
graphics option provides a colors list from which the colors referenced in
GSET(’xxx COLOR’, . . . )functions are selected.
The following program statements produce Display 49.4 on page 1383:
/* set the graphics environment */
goptions reset=global gunit=pct border
ftext=swissb htitle=6 htext=3
colors=(black blue green red)
hsize=7 in vsize=5 in
targetdevice=pscolor;
Display 49.5 Reading Direction of the Text Changed with the GSET(’TEXPATH’, ...) Function
Features not explained earlier in "Vertically Angling Text" are described here:
3 DATA _NULL_ causes the DATA step to be executed, but no data set is created.
3 The GSET(’TEXPATH’, . . . )function changes the direction in which the text reads.
Display 49.7 Pie Chart Inserted into DSGI Graph by Using a Viewport
targetdevice=pscolor;
rc=gset(’filcolor’, 4);
rc=gset(’filtype’, ’solid’);
rc=gdraw(’pie’, 30, 75, 22, 0, 360);
/* end DSGI */
rc=graph(’update’);
rc=gterm();
run;
Output 49.1 Checking the Color Associated with a Particular Color Index
Obs color rc
1 ORANGE 0
full URL. For information on bringing SAS/GRAPH output to the Web, see Chapter 9,
“Introducing SAS/GRAPH Output for the Web,” on page 369. 4
This example also includes a FILENAME statement to allocate an aggregate storage
location for the HTML and GIF files produced by the code. You should replace the term
path-to-Web-server with the location where you want to store the files.
In the example, the ODS HTML statement is used to create a body file named
dsgi.htm. When file dsgi.htm is viewed in a Web browser, it displays a solid pie chart,
as shown in Display 49.12 on page 1397. To drill down to the graph shown in Display
49.13 on page 1398, click anywhere in the pie chart. This example uses PROC GSLIDE
to create the simple graphic that is used for the target output:
/* This is the only line you have to */
/* change to run the program. Specify */
/* a location in your file system. */
*filename odsout ’path-to-Web-server’;
title1;
footnote1;
proc gslide wframe=4
cframe=blue
name=’blue’;
note height=20;
note height=10
justify=center
’Blue Sky’;
run;
quit;
See Also
CHAPTER
50
DATA Step Graphics Interface
Dictionary
Overview 1401
Operating States 1402
Utility Functions 1402
GASK Routines 1404
GDRAW Functions 1446
GRAPH Functions 1457
GSET Functions 1462
Return Codes for DSGI Routines and Functions 1501
See Also 1502
References 1503
Overview
This chapter contains detailed descriptions of each command used in the DATA Step
Graphics Interface (DSGI).
The following commands are associated with DSGI:
1 utility functions
3 GINIT
3 GPRINT
3 GTERM
2 GASK routines
3 GDRAW functions
4 GRAPH functions
5 GSET functions
Operating States
This list summarizes the operating states in DSGI. For a detailed discussion of
operating states, see “Operating States” on page 1359.
GKCL facility closed, initial state of DSGI.
GKOP facility open. DSGI is open. You may check the settings of attributes.
SGOP segment open. Graphics output can be generated.
WSAC workstation active. You can issue DSGI statements.
WSOP workstation open. The graphics catalog is opened or created.
Utility Functions
Utility functions enable you to initialize a session for DSGI, print error messages,
and terminate the session.
GINIT
Initializes DSGI
Operating States: GKCL
Return Codes: 0, 1, 26, 301, 307
Resulting Operating State: WSAC
Syntax
return-code-variable=GINIT();
Description
The GINIT function performs three functions: it readies the library that contains
SAS/GRAPH graphics routines, it opens a workstation, and it activates it. A workstation
is a Graphics Kernel Standard (GKS) concept. GKS allows for multiple workstations to
be open at the same time; however, for DSGI applications, you always use exactly one
workstation. This function moves the operating state from GKCL to WSAC.
See Also
GPRINT
Prints the specified interface error message
DATA Step Graphics Interface Dictionary GTERM 1403
Syntax
return-code-variable=GPRINT(code);
Description
The GPRINT function displays the message that corresponds to the error code entered.
You can use this routine if you have disabled automatic error logging but still want to
display the message associated with a return code you have received.
Argument Definitions
code numeric constant or numeric variable name; should be the value of a
return code received from some previous function.
See Also
GTERM
Terminates DSGI
Operating States: WSAC
Return Codes: 0, 3
Resulting Operating State: GKCL
Syntax
return-code-variable=GTERM();
Description
The GTERM function performs three functions: it deactivates the workstation, closes
the workstation, and closes the library that contains SAS/GRAPHroutines. This
function should be issued to free memory allocated by DSGI. This function moves the
operating state from WSAC to GKCL.
See Also
GASK Routines
When you use GASK routines, remember the following:
3 All arguments are required.
3 Most arguments are expressed as variable names. You can use any valid SAS
variable name.
3 If character arguments are expressed as character strings, they must be enclosed
in quotation marks.
3 All character variable names used as arguments must be declared in a previous
LENGTH statement.
3 GASK routines do not change the operating state.
3 PUT statements display a value returned by a routine in the SAS log.
3 OUTPUT statements write a value that is returned by a routine to a data set.
GASK routines enable you to check these current attribute settings:
ASF
ASPECT
CATALOG
CBACK
CLIP
COLINDEX
COLREP
DEVICE
FILCOLOR
FILINDEX
FILREP
FILSTYLE
FILTYPE
GRAPHLIST
HPOS
HSIZE
HTML
LINCOLOR
LININDEX
LINREP
LINTYPE
LINWIDTH
MARCOLOR
MARINDEX
DATA Step Graphics Interface Dictionary ASF 1405
MARREP
MARSIZE
MARTYPE
MAXDISP
NUMGRAPH
OPENGRAPH
PATREP
STATE
TEXALIGN
TEXCOLOR
TEXEXTENT
TEXFONT
TEXHEIGHT
TEXINDEX
TEXPATH
TEXREP
TEXUP
TRANS
TRANSNO
VIEWPORT
VPOS
VSIZE
WINDOW
WSACTIVE
WSOPEN
ASF
Finds whether an aspect source flag is bundled or separate
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’ASF’, attribute, status, return-code-variable);
Description
The GASK(’ASF’, . . . )routine returns the aspect source flag (ASF) of a particular
attribute. Possible ASF values are BUNDLED (associated with a bundle index) and
1406 ASPECT Chapter 50
Argument Definitions
attribute character string enclosed in quotes or character variable name with
one of the following values:
3 FILCOLOR
3 FILSTYLE
3 FILTYPE
3 LINCOLOR
3 LINTYPE
3 LINWIDTH
3 MARCOLOR
3 MARSIZE
3 MARTYPE
3 TEXCOLOR
3 TEXFONT.
status character variable name; returns either the value BUNDLED or
INDIVIDUAL.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
ASPECT
Finds the aspect ratio
Operating States: All
DATA Step Graphics Interface Dictionary CATALOG 1407
Return Codes: 0
Syntax
CALL GASK(’ASPECT’, aspect, return-code-variable);
Description
The GASK(’ASPECT’, . . . )routine returns the current aspect ratio used to draw
graphics output. GASK(’ASPECT’, . . . )searches for the current aspect ratio in the
following order:
1 the aspect ratio set with the GSET(’ASPECT’, . . . )function
2 the ASPECT= graphics option
3 the device’s default aspect ratio found in the device entry. For more information on
device entries, see Chapter 31, “The GDEVICE Procedure,” on page 915.
Argument Definitions
aspect numeric variable name; returns the aspect ratio.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
CATALOG
Finds the catalog for the graphs
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’CATALOG’, libref, memname, return-code-variable);
Description
The GASK(’CATALOG’, . . . )routine returns the libref and the name of the current
output catalog. GASK(’CATALOG’, . . . )returns the default catalog, WORK.GSEG, if
no other catalog has been specified with the GSET(’CATALOG’, . . . )function.
1408 CBACK Chapter 50
Argument Definitions
libref character variable name; returns the libref of the library in which
the current catalog is stored.
memname character variable name; returns the name of the current output
catalog.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
CBACK
Finds the background color
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’CBACK’, cback, return-code-variable);
Description
The GASK(’CBACK’, . . . )routine returns the current background color.
GASK(’CBACK’, . . . )searches for the current background color in the following order:
1 the background color selected with the GSET(’CBACK’, . . . )function
2 the CBACK= graphics option
3 the default background color for the device found in the device entry. For more
information about device entries, see Chapter 31, “The GDEVICE Procedure,” on
page 915.
Argument Definitions
cback character variable name; returns the background color name.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
CLIP
Finds whether clipping is on or off
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 55, 56
Syntax
CALL GASK(’CLIP’, status);
Description
The GASK(’CLIP’, . . . )routine checks whether clipping outside of viewports is enabled
or disabled. One of the two following messages is displayed when this routine is called:
NOTE: Clipping is ON.
or
NOTE: Clipping is OFF.
Argument Definitions
status numeric variable name; returns the current setting, 55 (ON) or 56
(OFF), for clipping.
See Also
“CLIP” on page 1467
COLINDEX
Finds the color indexes that have colors associated with them
Operating States: SGOP
Return Codes: 0, 4, 86, 87
Syntax
CALL GASK(’COLINDEX’, n, index-array, return-code-variable);
1410 COLREP Chapter 50
Description
The GASK(’COLINDEX’, . . . )routine returns the color indexes that currently have
colors assigned to them.
Argument Definitions
n numeric constant or numeric variable name; tells how many color
indexes you want returned. If n is expressed as a variable, the
variable must be initialized. The variable returns the number of
colors currently assigned. If n is expressed as a constant, it will not
return this value.
index-array list of numeric variables into which the used color index numbers
are returned. The list of variable names can be members of an array
or OF argument lists (where the arguments are variables). If you
are using an array, index-array must have been declared as an
array. The dimension of the array is determined by the number of
color indexes you want returned. Refer to the discussion of ARRAY
in SAS Language Reference: Dictionary for more information about
OF argument lists.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
COLREP
Finds the color name associated with a color index
Operating States: SGOP
Return Codes: 0, 4, 86, 87
Syntax
CALL GASK(’COLREP’, color-index, color, return-code-variable);
Description
The GASK(’COLREP’, . . . )routine returns the predefined SAS color name associated
with a color index. GASK(’COLREP’, . . . )searches for the current color assigned to a
color index in the following order:
1 the color selected by the GSET(’COLREP’, . . . )function.
2 the COLORS= graphics option. If color-index is 2, the routine returns the second
color from the colors list of the COLORS= graphics option.
DATA Step Graphics Interface Dictionary DEVICE 1411
3 the device’s default colors list found in the device entry. If color-index is 2, the
routine returns the second color from the default colors list.
See “SAS Color Names and RGB Values” on page 99 for a list of SAS predefined color
names.
Argument Definitions
color-index numeric constant; indicates the color index for which you want to
check the color. Valid values are 1 to 256, inclusive.
color character variable name; returns the color name associated with
color-index.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
DEVICE
Finds the output graphics device
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’DEVICE’, device, return-code-variable);
Description
The GASK(’DEVICE’, . . . )routine returns the current device driver. This routine
returns the device driver set by one of the following methods:
3 the GSET(’DEVICE’, . . . )function
3 the DEVICE= graphics option
3 the device driver you entered in the DEVICE prompt window
3 the device driver you entered in the OPTIONS window.
There is no default value for a device driver. To use DSGI, you must specify a device
driver. For more information about setting device drivers, see “Selecting a Device
Driver” on page 43.
Argument Definitions
device character variable name; returns the name of the device driver.
1412 FILCOLOR Chapter 50
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
FILCOLOR
Finds the color index of the color to be used to draw fill areas
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’FILCOLOR’, color-index, return-code-variable);
Description
The GASK(’FILCOLOR’, . . . )routine returns the current fill color. If a
GSET(’FILCOLOR’, . . . )function has not been previously submitted,
GASK(’FILCOLOR’, . . . )returns the default value, 1. The color index returned
corresponds to a color specification in the following order:
1 the color assigned to a color name with the GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list found in the device entry.
Argument Definitions
color-index numeric variable name; returns the color index of the fill color
currently selected.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
FILINDEX
Finds the bundle of fill area attributes that is active
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’FILINDEX’, index, return-code-variable);
Description
The GASK(’FILINDEX’, . . . )routine asks which fill bundle is active. If no fill bundles
have been previously defined with GSET(’FILREP’, . . . )or activated with
GSET(’FILINDEX’, . . . ), GASK(’FILINDEX’, . . . )returns the default value, 1.
Argument Definitions
index numeric variable name; returns the index of the fill bundle currently
selected.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
FILREP
Finds the fill area attributes associated with a bundle index
Operating States: GKOP, WSOP, WSAC, SGOP
Return Codes: 0, 8, 75, 76
Syntax
CALL GASK (’FILREP’, index, color-index, interior, style-index, return-code-variable);
Description
The GASK(’FILREP’, . . . )routine returns the color, type of interior, and fill pattern
associated with a specific fill bundle. If the bundle indicated by index has not been
1414 FILSTYLE Chapter 50
previously defined with the GSET(’FILREP’, . . . )function, DSGI issues the following
error message:
ERROR: A representation for the specified fill area index has
not been defined on this workstation.
Argument Definitions
index numeric constant or numeric variable name; indicates the fill bundle
to check. Valid values are 1 to 20, inclusive. If index is expressed as
a variable, the variable must be initialized to a value between 1 and
20.
color-index numeric variable name; returns the color index of the fill color
associated with the bundle. The color index that is returned
corresponds to a color specification in the following order:
1 a color index assigned to a color name with the
GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list found in the
device entry.
interior character variable name; returns the style of the interior associated
with the bundle index – that is, one of the following values:
3 HATCH
3 HOLLOW
3 PATTERN
3 SOLID.
style-index numeric variable name; returns the index of the fill pattern
associated with the bundle. See the “FILSTYLE” on page 1471 for
the fill patterns represented by style-index.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
FILSTYLE
Finds the style of the fill area when FILTYPE is PATTERN or HATCH
Operating States: GKOP, SGOP, WSAC, WSOP
DATA Step Graphics Interface Dictionary FILTYPE 1415
Return Codes: 0, 8
Syntax
CALL GASK(’FILSTYLE’, style-index, return-code-variable);
Description
The GASK(’FILSTYLE’, . . . )routine returns the current fill style of the interior when
FILTYPE is PATTERN or HATCH. If no fill style has been previously selected with the
GSET(’FILSTYLE’, . . . )function, GASK(’FILSTYLE’, . . . )returns the default value, 1.
Argument Definitions
style-index numeric variable name; returns the index of the fill pattern
associated with the bundle. See the “FILSTYLE” on page 1471 for
the interior styles represented by style-index.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
FILTYPE
Finds the type of the interior of the fill area
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’FILTYPE’, interior, return-code-variable);
Description
The GASK(’FILTYPE’, . . . )routine returns the current fill type. If no fill type has been
previously selected with the GSET(’FILTYPE’, . . . )function, GASK(’FILTYPE’, . . .
)returns the default value, HOLLOW.
Argument Definitions
interior character variable name; returns the fill type that is active, that is,
one of the following values:
1416 GRAPHLIST Chapter 50
3 HATCH
3 HOLLOW
3 PATTERN
3 SOLID.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
GRAPHLIST
Finds the names of segments in the current catalog
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’GRAPHLIST’, n, name-array, return-code-variable);
Description
The GASK(’GRAPHLIST’, . . . )routine lists the first n names of the graphs that are in
the current catalog. If a catalog has not been previously specified with the
GRAPH(’CATALOG’, . . . )function, the routine returns names from the default catalog,
WORK.GSEG.
The names returned are any of the following:
3 those specified in the GRAPH(’CLEAR’, . . . )function
3 if the name is omitted from the GRAPH(’CLEAR’ . . . )function, some form of
DSGI: for example, DSGI, DSGI1, or DSGI2.
3 the name specified in the NAME= option of a graphics procedure
3 graphs previously created by other graphics procedures and already in the catalog.
Argument Definitions
n numeric variable name; tells the maximum number of graph names
you want returned. If you express n as a variable, the variable must
be initialized to the maximum number of graph names you want
returned.
name-array list of character variable names into which the graph names will be
returned. The list of variable names can be members of an array or
OF argument lists (where the arguments are variables). If you are
using an array, name-array must be declared as an array. The
DATA Step Graphics Interface Dictionary HPOS 1417
See Also
HPOS
Finds the number of columns
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’HPOS’,hpos, return-code-variable);
Description
The GASK(’HPOS’, . . . )routine returns the number of columns currently in the
graphics output area. GASK(’HPOS’, . . . )searches for the current number of columns
in the following order:
1 the value selected in the GSET(’HPOS’, . . . )function
2 the value of the HPOS= graphics option
3 the device’s default HPOS value found in the device entry.
Argument Definitions
hpos numeric variable name; returns the number of columns in the
graphics output area.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
HSIZE
Finds the horizontal dimension of the graphics output area
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’HSIZE’, hsize, return-code-variable);
Description
The GASK(’HSIZE’, . . . )routine returns the current horizontal dimension, in inches, of
the graphics output area. GASK(’HSIZE’, . . . )searches for the current horizontal
dimension in the following order:
1 the value selected in the GSET(’HSIZE’, . . . )function
2 the value of the HSIZE= graphics option
3 the device’s default HSIZE found in the device entry.
Argument Definitions
hsize numeric variable name; the size of the graphics output area in the x
dimension (in inches).
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
HTML
Finds the HTML string that is in effect when one of the following graphic elements is drawn: bar,
ellipse, fill, mark, pie, and text.
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’HTML’, string, return-code-variable);
DATA Step Graphics Interface Dictionary LINCOLOR 1419
Description
The GASK(’HTML’, . . . )routine returns the current HTML string. If a GSET(’HTML’,
. . . )function has not been previously submitted, GASK(’HTML’, . . . )returns the
default value, null.
Argument Definitions
string the HTML string invoked when an affected DSGI graphic element in
a web page is clicked.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
LINCOLOR
Finds the current setting of the color to be used to draw lines
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’LINCOLOR’, color-index, return-code-variable);
Description
The GASK(’LINCOLOR’, . . . )routine returns the current line color. If a
GSET(’LINCOLOR’, . . . )function has not been previously submitted,
GASK(’LINCOLOR’, . . . )returns the default value, 1. The color index returned
corresponds to a color specification in the following order:
1 the color specified in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
Argument Definitions
color-index numeric variable name; returns the color index of the current line
color.
1420 LININDEX Chapter 50
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
LININDEX
Finds the index of the bundle of line attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’LININDEX’, index, return-code-variable);
Description
The GASK(’LININDEX’, . . . )routine returns the current line bundle. If no line
bundles have been previously defined with GSET(’LINREP’, . . . )or activated with
GSET(’LININDEX’, . . . ), GASK(’LININDEX’, . . . )returns the default value, 1.
Argument Definitions
index numeric variable name; returns the index of the current line bundle.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
LINREP
Finds the bundle of line attributes associated with an index
DATA Step Graphics Interface Dictionary LINTYPE 1421
Syntax
CALL GASK (’LINREP’, index, color-index, width, type, return-code-variable);
Description
The GASK(’LINREP’, . . . )routine returns the color, width, and line type associated
with a specific line bundle. If the bundle indicated by index has not been previously
defined with the GSET(’LINREP’, . . . )function, DSGI issues the following error
message:
ERROR: A representation for the specified line type index has
not been defined on this workstation.
Argument Definitions
index numeric constant or numeric variable name; indicates the fill bundle
to check. Valid values are 1 to 20, inclusive. If index is expressed as
a variable, the variable must be initialized to a value between 1 and
20.
color-index numeric variable name; returns the color index of the fill color
associated with the bundle. The color index returned corresponds to
a color specification in the following order:
1 a color index assigned with the GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
width numeric variable name; returns the line width (in pixels) associated
with the bundle.
type numeric variable name; returns the index of the line type associated
with the bundle. Refer to Figure 7.22 on page 208 for
representations of the line types.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
LINTYPE
Finds the line type
1422 LINWIDTH Chapter 50
Syntax
CALL GASK(’LINTYPE’, type, return-code-variable);
Description
The GASK(’LINTYPE’, . . . )routine returns the current line type. If no line type was
previously selected with the GSET(’LINTYPE’, . . . )function, GASK(’LINTYPE’, . . .
)returns the default value, 1.
Argument Definitions
type numeric variable name; returns the index of the line type currently
selected. Refer to Figure 7.22 on page 208 for representations of the
line types.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
LINWIDTH
Finds the line thickness
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’LINWIDTH’, width, return-code-variable);
Description
The GASK(’LINWIDTH’, . . . )routine returns the current line width. If a line width
has not been previously selected with the GSET(’LINWIDTH’, . . . )function,
GASK(’LINWIDTH’, . . . )returns the default value, 1.
Argument Definitions
width numeric variable name; returns the current line width (in units of
pixels).
DATA Step Graphics Interface Dictionary MARCOLOR 1423
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MARCOLOR
Finds the color index of the color to be used to draw markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’MARCOLOR’, color-index, return-code-variable);
Description
The GASK(’MARCOLOR’, . . . )routine returns the current marker color. If a
GSET(’MARCOLOR’, . . . )function has not been previously submitted,
GASK(’MARCOLOR’, . . . )returns the default value, 1. The color index returned
corresponds to a color specification in the following order:
1 the color selected in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
Argument Definitions
color-index numeric variable name; returns the color index of the current
marker color.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MARINDEX
Finds the index of the bundle of marker attributes currently selected
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’MARINDEX’, index, return-code-variable);
Description
The GASK(’MARINDEX’, . . . )routine returns the current marker bundle. If no marker
bundles have been previously defined with GSET(’MARREP’, . . . )or activated with
GSET(’MARINDEX’, . . . ), GASK(’MARINDEX’, . . . )returns the default value, 1.
Argument Definitions
index numeric variable name; returns the index of the marker bundle
currently selected.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MARREP
Finds the bundle of marker attributes associated with an index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 64, 65
Syntax
CALL GASK(’MARREP’, index, color-index, size, type, return-code-variable);
Description
The GASK(’MARREP’ . . . )routine returns the color, size, and type of marker
associated with a specific marker bundle. If the bundle indicated by index has not been
DATA Step Graphics Interface Dictionary MARSIZE 1425
previously defined with the GSET(’MARREP’, . . . )function, DSGI issues the following
error message:
ERROR: A representation for the specified marker index has
not been defined on this workstation.
Argument Definitions
index numeric constant or numeric variable name; indicates the index of
the fill bundle to check. Valid values are 1 to 20, inclusive. If index
is expressed as a variable, the variable must be initialized to a value
between 1 and 20.
color-index numeric variable name; returns the color index of the fill color
associated with the bundle. The color index returned corresponds to
a color specification in the following order:
1 a color index assigned with the GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
size numeric variable name; returns the marker size in units of the
current window system.
type numeric variable name; the index of the marker type associated
with the bundle. See the “MARTYPE” on page 1483 for an
explanation of the marker indexes.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MARSIZE
Finds the size of markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’MARSIZE’, size, return-code-variable);
1426 MARTYPE Chapter 50
Description
The GASK(’MARSIZE’, . . . )routine returns the current marker size. If no marker size
has been previously selected with the GSET(’MARSIZE’, . . . )function,
GASK(’MARSIZE’, . . . )returns the default value, 1.
Argument Definitions
size numeric variable name; returns the marker size in units of the
current window system.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MARTYPE
Finds the kind of markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’MARTYPE’, type, return-code-variable);
Description
The GASK(’MARTYPE’, . . . )routine returns the current marker type. If no marker
type has been previously selected with the GSET(’MARTYPE’, . . . )function,
GASK(’MARTYPE’, . . . )returns the default value, 1.
Argument Definitions
type numeric variable name; returns the index of the marker type
currently selected. See the function “MARTYPE” on page 1483 for
an explanation of the indexes for markers.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
MAXDISP
Finds the maximum display area size
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK (’MAXDISP’, units, x-dim, y-dim, x-pixels, y-pixels, return-code-variable);
Description
The GASK(’MAXDISP’, . . . )routine returns the dimensions of the maximum display
area for the device. This routine is useful when you need to know the maximum display
area in order to determine the aspect ratio or to scale a graph.
There is a difference between the maximum display size returned when the operating
state is not SGOP and when it is SGOP. The full addressable display area is returned
when the operating state is not SGOP, and the display area minus room for titles and
footnotes is returned when the operating state is SGOP.
Argument Definitions
units numeric variable name; returns a 1 to show that x-dim and y-dim
are in meters.
x-dim numeric variable name; returns the dimension, in meters, in the x
direction.
y-dim numeric variable name; returns the dimension, in meters, in the y
direction.
x-pixels numeric variable name; returns the number of pixels in the x
direction.
y-pixels numeric variable name; returns the number of pixels in the y
direction.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
NUMGRAPH
Finds the number of graphs in the current catalog
1428 OPENGRAPH Chapter 50
Syntax
CALL GASK(’NUMGRAPH’, n, return-code-variable);
Description
The GASK(’NUMGRAPH’, . . . )routine returns how many graphs are in the current
catalog. The catalog checked is the catalog selected in the GSET(’CATALOG’, . . .
)function, if specified; otherwise, it is the default catalog, WORK.GSEG.
Argument Definitions
n numeric variable name; returns the number of graphs in the current
catalog.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
OPENGRAPH
Finds the name of the segment currently open
Operating States: SGOP
Return Codes: 0, 4
Syntax
CALL GASK(’OPENGRAPH’, name, return-code-variable);
Description
The GASK(’OPENGRAPH’, . . . )routine returns the name of the graph that is
currently open.
The name returned is one of the following:
3 the name specified in the GRAPH(’CLEAR’, . . . )function
3 if the name is omitted from the GRAPH(’CLEAR’, . . . )function, some form of
DSGI: for example, DSGI, DSGI1, and DSGI2.
DATA Step Graphics Interface Dictionary PATREP 1429
Argument Definitions
name character variable name; returns the name of the graph that is
currently open.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
PATREP
Finds the pattern name assigned to a style index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8. 79
Syntax
CALL GASK(’PATREP’, index, pattern-name, hatch-name, return-code-variable);
Description
The GASK(’PATREP’, . . . )routine returns the pattern name assigned to a style index.
Argument Definitions
index numeric variable name; returns the index of the pattern currently
selected.
pattern-name character variable name; returns the name of the pattern at the
specified index.
hatch-name character variable name; returns the name of the hatch at the
specified index.
return-code- numeric variable name; returns the return code of the routine call.
variable
1430 STATE Chapter 50
See Also
STATE
Finds the current operating state of DSGI
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’STATE’, status);
Description
The GASK(’STATE’, . . . )routine returns the current operating state of DSGI.
Argument Definitions
status character variable name; returns one of the following values:
3 GKCL
3 GKOP
3 SGOP
3 WSAC
3 WSOP.
See Also
TEXALIGN
Finds the horizontal and vertical alignment of the text string
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXALIGN’, halign, valign, return-code-variable);
DATA Step Graphics Interface Dictionary TEXCOLOR 1431
Description
The GASK(’TEXALIGN’, . . . )routine returns the current horizontal and vertical text
alignment. If no values have been previously selected with the GSET(’TEXALIGN’, . . .
)function, GASK(’TEXALIGN’, . . . )returns the default value NORMAL for both halign
and valign.
Argument Definitions
halign character variable name; indicates the horizontal alignment set by
the GSET(’TEXALIGN’, . . . )function; returns one of the following
values:
3 CENTER
3 LEFT
3 NORMAL
3 RIGHT.
valign character variable name; indicates the vertical alignment set by the
GSET(’TEXALIGN’, . . . )function; returns one of the following
values:
3 BASE
3 BOTTOM
3 HALF
3 NORMAL
3 TOP.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
TEXCOLOR
Finds the color index of the color currently selected to draw text strings
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXCOLOR’, color-index, return-code-variable);
1432 TEXCOLOR Chapter 50
Description
The GASK(’TEXCOLOR’, . . . )routine returns the current text color. If a
GSET(’TEXCOLOR’, . . . )function has not been previously submitted,
GASK(’TEXCOLOR’, . . . )returns the default value, 1. The color index returned
corresponds to a color specification in the following order:
1 the color specified in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
Argument Definitions
color-index numeric variable name; returns the color index of the color used to
draw text.
return-code- numeric variable name; returns the return code of the routine call.
variable
DATA Step Graphics Interface Dictionary TEXEXTENT 1433
See Also
TEXEXTENT
Finds the text extent rectangle and concatenation point for a specified text string
Operating States: SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK (’TEXEXTENT’, x, y, string, x-end, y-end, x1, x2, x3, x4, y1, y2, y3, y4,
return-code-variable);
Description
The GASK(’TEXEXTENT’, . . . )routine returns the text extent rectangle and text
concatenation point for a specified text string. All text extent coordinates returned are
in units of the current window system. If no text string is specified for string,
GASK(’TEXEXTENT’, . . . )does not return values for the other arguments.
The text attributes and bundles affect the values returned by this query. See Figure
50.1 on page 1433 for a diagram of the text extent rectangle (in the figure, x,y is always
the place where the text string starts).
Argument Definitions
x numeric variable name; x coordinates are in units based on the
current window system; returns x coordinate after justification. The
variable used to specify x must be initialized.
y numeric variable name; y coordinates are in units based on the
current window system; returns y coordinate after justification. The
variable used to specify y must be initialized.
1434 TEXFONT Chapter 50
See Also
TEXFONT
Finds the font used to draw text strings
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXFONT’, font, return-code-variable);
Description
The GASK(’TEXFONT’ . . . )routine returns the current text font. GASK(’TEXFONT’, .
. . )searches for the current font in the following order:
1 the value selected in the GSET(’TEXFONT’, . . . )function, if specified
2 the value of the FTEXT= graphics option, if specified
3 the device’s default hardware font if the device supports a hardware font
4 the SIMULATE font.
Argument Definitions
font character variable name; returns the font name.
return-code- numeric variable name; returns the return code of the routine call.
variable
DATA Step Graphics Interface Dictionary TEXHEIGHT 1435
See Also
TEXHEIGHT
Finds the character height of the text strings
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXHEIGHT’, height, return-code-variable);
Description
The GASK(’TEXHEIGHT’, . . . )routine returns the current text height.
GASK(’TEXHEIGHT’, . . . )searches for the current text height in the following order:
1 the value selected in the GSET(’TEXHEIGHT’, . . . )function, if specified
2 the value of the HTEXT= graphics option, if specified
3 the default text height, 1.
Argument Definitions
height numeric variable name; returns the character height in units of the
current window system.
return-code- numeric variable name; returns the return code of the routine call.
variable
1436 TEXINDEX Chapter 50
See Also
TEXINDEX
Finds the index of the bundle of text attributes currently selected
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXINDEX’, index, return-code-variable);
Description
The GASK(’TEXINDEX’, . . . )routine returns the current text bundle. If no text
bundles have been previously defined with GSET(’TEXREP’, . . . )or activated with
GSET(’TEXINDEX’, . . . ), GASK(’TEXINDEX’, . . . )returns the default value, 1.
Argument Definitions
index numeric variable name; returns the text bundle index.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
TEXPATH
Finds the direction of the text string
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
DATA Step Graphics Interface Dictionary TEXREP 1437
Syntax
CALL GASK(’TEXPATH’, path, return-code-variable);
Description
The GASK(’TEXPATH’, . . . )routine returns the current text path (reading direction).
If TEXPATH has not been previously selected with the GSET(’TEXPATH’, . . .
)function, GASK(’TEXPATH’, . . . )returns the default value, RIGHT. See the
“TEXPATH” on page 1491 for an illustration of text paths.
Argument Definitions
path character variable name; returns one of the following values:
3 DOWN
3 LEFT
3 RIGHT
3 UP.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
TEXREP
Finds the attribute settings associated with a text bundle
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 68, 69
Syntax
CALL GASK(’TEXREP’, index, color-index, font, return-code-variable);
Description
The GASK(’TEXREP’, . . . )routine returns the color and font associated with a specific
text bundle. If the bundle indicated by index has not been previously defined with the
GSET(’TEXREP’, . . . )function, DSGI issues the following error message:
ERROR: A representation for the specified text index has
not been defined on this workstation.
1438 TEXUP Chapter 50
Argument Definitions
index numeric constant or numeric variable name; indicates the fill bundle
to check. Valid values are 1 to 20, inclusive. If index is expressed as
a variable, the variable must be initialized to a value between 1 and
20.
color-index numeric variable name; returns the color index of the fill color
associated with the bundle. The color index that is returned
corresponds to a color specification in the following order:
1 a color index assigned with the GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
font character variable name; returns the text font associated with the
bundle.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
TEXUP
Finds the orientation (angle) of the text string
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TEXUP’, up-x, up-y, return-code-variable);
Description
The GASK(’TEXUP’, . . . )routine returns the character up vector values. If TEXUP
has not been previously selected with the GSET(’TEXUP’, . . . )function,
GASK(’TEXUP’, . . . )returns the default values for x and y, 0 and 1. See the “TEXUP”
on page 1493 for an explanation of the vector values.
Argument Definitions
up-x numeric variable name; returns the x component of the vector.
up-y numeric variable name; returns the y component of the vector.
DATA Step Graphics Interface Dictionary TRANS 1439
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
TRANS
Finds the viewport and window coordinates associated with a transformation number
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50
Syntax
CALL GASK (’TRANS’, n, vllx, vlly, vurx, vury, wllx, wlly, wurx, wury,
return-code-variable);
Description
The GASK(’TRANS’, . . . )routine returns the viewport and window coordinates
associated with a particular transformation number. GASK(’TRANS’, . . . )returns the
default coordinates for viewports and windows if other coordinates have not been
defined for the transformation specified.
Argument Definitions
n numeric constant or numeric variable name; indicates the number of
the transformation to check. Valid values are 0 to 20, inclusive. If n
is expressed as a variable, the variable must be initialized to a value
between 0 and 20.
vllx numeric variable name; returns the x coordinate of the lower-left
viewport corner.
vlly numeric variable name; returns the y coordinate of the lower-left
viewport corner.
vurx numeric variable name; returns the x coordinate of the upper-right
viewport corner.
vury numeric variable name; returns the y coordinate of the upper-right
viewport corner.
wllx numeric variable name; returns the x coordinate of the lower-left
window corner.
wlly numeric variable name; returns the y coordinate of the lower-left
window corner.
1440 TRANSNO Chapter 50
See Also
TRANSNO
Finds the number of the transformation to be used
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Syntax
CALL GASK(’TRANSNO’, n, return-code-variable);
Description
The GASK(’TRANSNO’, . . . )routine returns the current transformation. If a
transformation has not been previously selected with the GSET(’TRANSNO’, . . .
)function, GASK(’TRANSNO’, . . . )returns the number of the default transformation, 0.
Argument Definitions
n numeric variable name; returns the number of the current
transformation.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
VIEWPORT
Finds coordinates of the viewport associated with a transformation number
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50
Syntax
CALL GASK(’VIEWPORT’, n, llx, lly, urx, ury, return-code-variable);
Description
The GASK(’VIEWPORT’, . . . )routine returns the coordinates of the viewport
associated with the specified transformation. If a viewport has not been defined with
the GSET(’VIEWPORT’, . . . )function for the specified transformation, n,
GASK(’VIEWPORT’, . . . )returns the default coordinates for the viewport, (0,0) and
(1,1).
Argument Definitions
n numeric constant or numeric variable name; indicates the
transformation number assigned to the viewport to check. Valid
values are 0 to 20, inclusive. If n is expressed as a variable, the
variable must be initialized to a value between 0 and 20.
llx numeric variable name; returns the x coordinate of the lower-left
corner.
lly numeric variable name; returns the y coordinate of the lower-left
corner.
urx numeric variable name; returns the x coordinate of the upper-right
corner.
ury numeric variable name; returns the y coordinate of the upper-right
corner.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
VPOS
Finds the number of rows
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’VPOS’, vpos, return-code-variable);
Description
The GASK(’VPOS’, . . . )routine returns the current number of rows in the graphics
output area. GASK(’VPOS’, . . . )searches for the current number of rows in the
following order:
1 the value selected in the GSET(’VPOS’, . . . )function
2 the value of the VPOS= graphics option
3 the device’s default VPOS value found in the device entry.
Argument Definitions
vpos numeric variable name; returns the number of rows in the graphics
output area.
return-code- numeric variable name; returns the return code of the routine call.
variable
DATA Step Graphics Interface Dictionary VSIZE 1443
See Also
VSIZE
Finds the vertical dimension of the graphics output area
Operating States: All
Return Codes: 0
Syntax
CALL GASK(’VSIZE’, vsize, return-code-variable);
Description
The GASK(’VSIZE’, . . . )routine returns the current vertical dimension, in inches, of
the graphics output area. GASK(’VSIZE’, . . . )searches for the current vertical
dimension in the following order:
1 the value selected in the GSET(’VSIZE’, . . . )function
2 the value of the VSIZE= graphics option
3 the device’s default VSIZE found in the device entry.
Argument Definitions
vsize numeric variable name; returns the size of the graphics output area
in the y dimension (in inches).
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
WINDOW
Finds the coordinates of the window associated with a transformation number
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50
Syntax
CALL GASK(’WINDOW’, n, llx, lly, urx, ury, return-code-variable);
Description
The GASK(’WINDOW’, . . . )routine returns the coordinates of the window associated
with the specified transformation number. If no window has been defined with the
GSET(’WINDOW’, . . . )function for transformation n, GASK(’WINDOW’, . . . )returns
the default window coordinates, which are device dependent.
Argument Definitions
n numeric constant or numeric variable name; indicates the
transformation number of the window to check. Valid values are 0 to
20, inclusive. If n is expressed as a variable, the variable must be
initialized to a value between 0 and 20.
llx numeric variable name; returns the x coordinate of the lower-left
corner.
lly numeric variable name; returns the y coordinate of the lower-left
corner.
urx numeric variable name; returns the x coordinate of the upper-right
corner.
ury numeric variable name; returns the y coordinate of the upper-right
corner.
return-code- numeric variable name; returns the return code of the routine call.
variable
See Also
WSACTIVE
Finds whether the interface is active
Operating States: All
Return Codes: 29, 30
Syntax
CALL GASK(’WSACTIVE’, status);
Description
The GASK(’WSACTIVE’, . . . )routine asks if the workstation is active. When the
workstation is active, you can execute certain DSGI routines and functions.
Argument Definitions
status numeric variable name; returns either 29 (active) or 30 (inactive).
See Also
WSOPEN
Finds whether the interface is open
Operating States: All
Return Codes: 24, 25
Syntax
CALL GASK(’WSOPEN’, status);
Description
The GASK(’WSOPEN’, . . . )routine asks if the workstation is open. If a workstation is
open, the graphics catalog can be accessed.
Argument Definitions
status numeric variable name; returns either 24 (open) or 25 (closed).
1446 GDRAW Functions Chapter 50
See Also
GDRAW Functions
GDRAW functions create graphics elements. Each GDRAW operator is associated
with a set of GSET operators that control its attributes. For example, the color, height,
and font for the GDRAW(’TEXT’, . . . )function are controlled by GSET(’TEXCOLOR’, .
. . ), GSET(’TEXHEIGHT’, . . . ), and GSET(’TEXFONT’, . . . ), respectively. For a
complete list of the attributes associated with each GDRAW function, see Table 49.2 on
page 1364. The complete graph is displayed after the GRAPH(’UPDATE’, . . . )function
is submitted.
When using GDRAW functions, remember the following:
3 All arguments must be specified.
3 All arguments are specified as variables or constants. If you express an argument
as a variable, the variable must be initialized.
3 All character arguments that are expressed as character strings must be enclosed
in quotes.
3 All character variable names used as arguments must be declared in a LENGTH
statement.
3 All character constants must be enclosed in single or double quotes.
GDRAW functions:
3 ARC
3 BAR
3 ELLARC
3 ELLIPSE
3 FILL
3 IMAGE
3 LINE
3 MARK
3 MESSAGE
3 PIE
3 TEXT
ARC
Draws a circular arc
Operating States: SGOP
Return Codes: 0, 4, 61, 86
Syntax
return-code-variable=GDRAW(’ARC’, x, y, radius, start, end);
DATA Step Graphics Interface Dictionary ARC 1447
Description
The GDRAW(’ARC’, . . . )function draws a circular arc. The line attributes and bundles
affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these
attributes. Figure 50.2 on page 1447 illustrates the arguments used with
GDRAW(’ARC’, . . . ).
Argument Definitions
x numeric constant or numeric variable name; specifies the x
coordinate of the position of the arc on the display; x coordinates are
in units based on the current window system.
y numeric constant or numeric variable name; specifies the y
coordinate of the position of the arc on the display; y coordinates are
in units based on the current window system;
radius numeric constant or numeric variable name; the arc radius size is in
units based on the current window system.
start numeric constant or numeric variable name; the starting angle of
the arc is in degrees, with 0 degrees at 3 o’clock.
end numeric constant or numeric variable name; the ending angle of the
arc is in degrees, with 0 degrees at 3 o’clock.
See Also
BAR
Draws a rectangle
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
Syntax
return-code-variable=GDRAW(’BAR’, x1, y1, x2, y2);
Description
The GDRAW(’BAR’, . . . )function draws a rectangular bar whose sides are parallel to
the sides of the display area. The fill attributes and bundles affect the appearance of
this graphics element. See Table 49.2 on page 1364 for a list of these attributes. Figure
50.3 on page 1448 illustrates the arguments used with GDRAW(’BAR’, . . . ).
Argument Definitions
x1 numeric constant or numeric variable name; refers to the x
coordinate of one corner of the bar.
y1 numeric constant or numeric variable name; refers to the y
coordinate of one corner of the bar.
x2 numeric constant or numeric variable name; refers to the x
coordinate of the corner of the bar that is diagonally opposite to the
corner of (x1,y1).
y2 numeric constant or numeric variable name; refers to the y
coordinate of the corner of the bar that is diagonally opposite to the
corner of (x1,y1).
See Also
ELLARC
Draws an elliptical arc
Operating States: SGOP
Return Codes: 0, 4, 61, 86
Syntax
return-code-variable =GDRAW(’ELLARC’, x, y, major, minor, start, end, angle);
Description
The GDRAW(’ELLARC’, . . . )function draws a hollow section of an ellipse. The line
attributes and bundles affect the appearance of this primitive. See Table 49.2 on page
1364 for a list of these attributes. Figure 50.4 on page 1449 illustrates the arguments
used with GDRAW(’ELLARC’, . . . )and GDRAW(’ELLIPSE’, . . . ).
Argument Definitions
x numeric constant or numeric variable name; x coordinates are in
units based on the current window system.
y numeric constant or numeric variable name; y coordinates are in
units based on the current window system.
major numeric constant or numeric variable name; the major axis lengths
for the elliptical arc.
1450 ELLIPSE Chapter 50
minor numeric constant or numeric variable name; the minor axis lengths
for the elliptical arc.
start numeric constant or numeric variable name; the starting angle from
the major axis, in degrees, for the elliptical arc with 0 degrees
beginning at the major axis.
end numeric constant or numeric variable name; the ending angle from
the major axis, in degrees, for the elliptical arc with 0 degrees at 3
o’clock.
angle numeric constant or numeric variable name; the angle that the major
axis of the elliptical arc has to 0 degrees (with 0 degrees at 3 o’clock).
See Also
ELLIPSE
Draws an ellipse
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
Syntax
return-code-variable =GDRAW(’ELLIPSE’, x, y, major, minor, start, end, angle);
Description
The GDRAW(’ELLIPSE’, . . . )function draws a filled section of an ellipse. The fill
attributes and bundles affect the appearance of this primitive. See Table 49.2 on page
1364 for a list of these attributes. Figure 50.4 on page 1449 illustrates the arguments
used with GDRAW(’ELLARC’, . . . )and GDRAW(’ELLIPSE’, . . . ).
Argument Definitions
x numeric constant or numeric variable name; the x coordinate of the
position of the ellipse on the display.
y numeric constant or numeric variable name; the y coordinate of the
position of the ellipse on the display.
DATA Step Graphics Interface Dictionary FILL 1451
major numeric constant or numeric variable name; the major axis length
for the ellipse.
minor numeric constant or numeric variable name; the minor axis length
for the ellipse.
start numeric constant or numeric variable name; the starting angle for
the ellipse from the major axis, with 0 degrees beginning at the
major axis.
end numeric constant or numeric variable name; the ending angle for
the ellipse from the major axis, with 0 degrees at 3 o’clock.
angle numeric constant or numeric variable name; the angle that the
major axis of the ellipse has to 0 degrees, with 0 degrees at 3 o’clock.
See Also
FILL
Draws a filled area
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86, 100, 301
Syntax
return-code-variable=GDRAW(’FILL’, n, x-values, y-values);
Description
The GDRAW(’ILL’ . . . )function draws a filled polygon. The fill attributes and bundles
affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these
attributes.
Note: All of the x coordinates are listed in the function first, followed by the y
coordinates. This primitive takes the first n values and stores them as x coordinates.
The next n values are stored as y coordinates. 4
Argument Definitions
n numeric constant or numeric variable name; the number of vertices
(x and y pairs) in the polygon. You can specify a missing value (.) for
1452 IMAGE Chapter 50
See Also
IMAGE
Displays an image
Operating State: SGOP
Return Codes: 0, 150
Syntax
return-code-variable=GDRAW(’IMAGE’, ’external-file’, x1, y1, x2, y2, ’style’);
Description
The GDRAW(’IMAGE’, . . .) function displays the specified image within opposing pairs
of coordinates. The format of the external image file varies between operating
environments. The (x1, y1) coordinate pair specifies one corner of the image, and the
(x2, y2) coordinate pair specifies the opposite corner of the image. The style parameter
must be either ’TILE’ to copy the image as many times as necessary to fill the area, or
’FIT’ to stretch one instance of the image to fill the area.
LINE
Draws a polyline
DATA Step Graphics Interface Dictionary MARK 1453
Syntax
return-code-variable=GDRAW(’LINE’, n, x-values, y-values);
Description
The GDRAW(’LINE’ . . . )function draws one line, a series of connected lines, or a dot.
The line attributes and bundles affect the appearance of this primitive. See Table 49.2
on page 1364 for a list of these attributes.
Note: All of the x coordinates are listed in the function first, followed by the y
coordinates. This primitive takes the first n values and stores them as x coordinates
and the next n values and stores them as y coordinates. 4
Argument Definitions
n numeric constant or numeric variable name; the number of vertices
(x and y pairs) in the polygon. You can specify a missing value (.) for
n. If n is missing, the number of vertices is computed from the
number of x and y pairs.
x-values list of numeric constants, variables, or OF arguments that describe
the x coordinates for the vertices in units based on the current
window system.
y-values list of numeric constants, variables, or OF argument lists that
describe the y coordinates for the vertices in units based on the
current window system.
See Also
MARK
Draws a polymarker
Operating States: SGOP
Return Codes: 0, 4, 65, 86, 100, 301
1454 MESSAGE Chapter 50
Syntax
return-code-variable=GDRAW (’MARK’, n, x-values, y-values);
Description
The GDRAW(’MARK’, . . . )function draws a series of symbols. The marker attributes
and bundles affect the appearance of this primitive. See Table 49.2 on page 1364 for a
list of these attributes. Refer to the “MARTYPE” on page 1483 for a list of symbols that
you can draw with GDRAW(’MARK’, . . . ).
Note: All of the x coordinates are listed in the function first, followed by the y
coordinates. This primitive takes the first n values and stores them as x coordinates
and the next n values and stores them as y coordinates. 4
Argument Definitions
n numeric constant or numeric variable name; the number of times
the symbol is drawn. You can specify a missing value (.) for n. If n
is missing, the number of vertices is calculated from the number of x
and y pairs.
x-values list of numeric constants, variables, or OF arguments that describe
the x coordinates of the symbols in units based on the current
window system.
y-values list of numeric constants, variables, or OF arguments that describe
the y coordinates of the symbols in units based on the current
window system.
See Also
MESSAGE
Prints a message in the SAS log
Operating States: All
Return Codes: 0
Syntax
return-code-variable=GDRAW(’MESSAGE’, message);
DATA Step Graphics Interface Dictionary PIE 1455
Description
The GDRAW(’MESSAGE’, . . . )function prints a message in the SAS log. This function
may be used for debugging applications or for printing custom messages for your
application.
Argument Definitions
message character string enclosed in quotes or character variable name; the
text to be printed in the log.
See Also
PIE
Draws a filled circle or section of a filled circle
Operating States: SGOP
Return Codes: 0, 4, 76, 79, 80, 86
Syntax
return-code-variable=GDRAW(’PIE’, x, y, radius, start, end);
Description
The GDRAW(’PIE’, . . . )function draws a filled section of a circular arc. The fill
attributes and bundles affect the appearance of this primitive. See Table 49.2 on page
1364 for a list of these attributes.
Argument Definitions
x numeric constant or numeric variable name; x coordinates are in
units based on the current window system.
y numeric constant or numeric variable name; y coordinates are in
units based on the current window system.
radius numeric constant or numeric variable name; the pie radius size in
units based on the current window system.
start numeric constant or numeric variable name; the starting angle of
the pie, with 0 degrees at 3 o’clock on the unit circle.
end numeric constant or numeric variable name; the ending angle of the
pie, with 0 degrees at 3 o’clock on the unit circle.
1456 TEXT Chapter 50
See Also
TEXT
Draws a text string
Operating States: SGOP
Return Codes: 0, 4, 69, 86
Syntax
return-code-variable=GDRAW(’TEXT’, x, y, string);
Description
The GDRAW(’TEXT’, . . . )function draws a text string. The text attributes and bundles
affect the appearance of this primitive. See Table 49.2 on page 1364 for a list of these
attributes.
Argument Definitions
x numeric constant or numeric variable name; x coordinates are in
units based on the current window system.
y numeric constant or numeric variable name; y coordinates are in
units based on the current window system.
string character string enclosed in quotes or character variable name; a set
of characters to be drawn on the output beginning at position (x,y).
See Also
GRAPH Functions
GRAPH functions perform library management tasks from within the DATA Step
Graphics Interface. These functions can only be performed on one catalog at a time.
They cannot be performed across catalogs. For example, you cannot copy a graph from
one catalog to another.
When using GRAPH functions, remember the following:
3 All arguments are specified as variables or constants. If you express an argument
as a variable, the variable must be initialized.
3 All character arguments expressed as character strings must be enclosed in quotes.
3 All character variable names used as arguments must be declared in a LENGTH
statement.
3 All character constants must be enclosed in single or double quotes.
GRAPH functions:
3 CLEAR
3 COPY
3 DELETE
3 INSERT
3 PLAY
3 RENAME
3 UPDATE
CLEAR
Opens a graphics segment for output
Operating States: WSAC
Return Codes: 0, 3, 301, 302
Resulting Operating State: SGOP
Syntax
return-code-variable=GRAPH (’CLEAR’<, name> <, des><, byline>);
Description
The GRAPH(’CLEAR’, . . . )function opens a graphics segment for output in the current
catalog. The first parameter, ’CLEAR’, is the only required one. The values of name,
des, and byline are displayed in catalog listings and in catalog information in the
GREPLAY procedure.
If the name specified is an existing graph, DSGI will suffix the name with a number.
For example, if PIE is chosen for the name and it already exists, DSGI will name the
1458 COPY Chapter 50
output PIE1; the next time the code is submitted, DSGI names the output PIE2, and so
forth.
This function moves the operating state from WSAC to SGOP.
Argument Definitions
name character string enclosed in quotes or character variable name; gives
a name to the graph to be opened. If name is not specified, DSGI
assigns the graph a name that is some form of DSGI: for example,
DSGI, DSGI1, and DSGI2.
des character string enclosed in quotes or character variable name; gives
a description to the graph to be opened. If des is not specified, DSGI
assigns the following description to the catalog entry: Graph from
DATA Step Graphics Interface.
by-line character string enclosed in quotes or character variable name; gives
another line of description for the graph. The byline appears under
the titles on the graph. DSGI does not provide a default byline.
See Also
COPY
Copies a graph
Operating States: GKOP, WSOP, WSAC, SGOP
Return Codes: 0, 8, 307
Syntax
return-code-variable=GRAPH(’COPY’, name, new-name);
Description
The GRAPH(’COPY’, . . . )function copies a graph to another catalog entry. The graph
to be copied must be closed and be in the current catalog. You cannot copy from one
catalog to another. The new graph will also be in the current catalog.
Argument Definitions
name character string enclosed in quotes or character variable name;
name of the graph to be copied.
new-name character string enclosed in quotes or character variable name;
name of the graph to be created.
DATA Step Graphics Interface Dictionary INSERT 1459
See Also
DELETE
Deletes a graph
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 4, 8, 307
Syntax
return-code-variable=GRAPH(’DELETE’, name);
Description
The GRAPH(’DELETE’, . . . )function deletes a graph in the current catalog. The graph
does not have to be closed to be deleted.
Argument Definitions
name character string enclosed in quotes or character variable name; the
name of the graph to delete.
See Also
INSERT
Inserts a previously created segment into the currently open graph
Operating States: SGOP
Return Codes: 0, 4, 302, 307
1460 PLAY Chapter 50
Syntax
return-code-variable=GRAPH(’INSERT’, name);
Description
The GRAPH(’INSERT’, . . . )function inserts a graph into the currently open graph.
The graph to be inserted must be closed and be in the current catalog.
Argument Definitions
name character string enclosed in quotes or character variable name; the
name of a graph to be inserted.
See Also
PLAY
Displays the specfied graph on your output
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 307
Syntax
return-code-variable=GRAPH(’PLAY’, graph-name);
Description
The GRAPH(’PLAY’, . . . )function displays the specified graph on your output.
Argument Definitions
graph-name character variable name; the name of the graph you would like to
play.
See Also
RENAME
Renames a graph
DATA Step Graphics Interface Dictionary UPDATE 1461
Syntax
return-code-variable=GRAPH(’RENAME’, name, new-name);
Description
The GRAPH(’RENAME’, . . . )function renames a graph. The graph to be renamed
must be in the current catalog and be closed.
Argument Definitions
name character string enclosed in quotes or character variable name; the
name of the closed graph that is to be changed.
new-name character string enclosed in quotes or character variable name; the
new name for the graph.
See Also
UPDATE
Completes the currently open graph and (optionally) displays it
Operating States: SGOP
Return Codes: 0, 4
Resulting Operating State: WSAC
Syntax
return-code-variable=GRAPH(’UPDATE’ <, ’show’>);
Description
The GRAPH(’UPDATE’, . . . )function closes the graph currently open and displays it.
DSGI operates in buffered mode, so the picture is never displayed until this function is
called.
This function can be called only once for the currently open graph. Therefore, you
cannot incrementally build a graph; however, you can close the currently open graph
and later insert it into another graph within the same DATA step.
This function moves the operating state from SGOP to WSAC.
1462 GSET Functions Chapter 50
Argument Definitions
show character string, optional; valid values are SHOW and NOSHOW. If
SHOW is specified, the graph is displayed. If NOSHOW is specified,
the graph is closed and not displayed.
See Also
GSET Functions
GSET functions allow you to set attributes for the graphics elements. Some GSET
functions set the attributes for a subset of graphics primitives. For example, attributes
prefixed by FIL control the appearance of the graphics primitives GDRAW(’BAR’, . . . ),
GDRAW(’ELLIPSE’, . . . ), GDRAW(’FILL’, . . . ), and GDRAW(’PIE’, . . . ). See Table
49.2 on page 1364 for a complete list of the attributes that control the appearance of the
graphics primitives.
Some GSET functions affect the appearance of the entire graphics output. For
example, GSET(’HPOS’, . . . )and GSET(’VPOS’, . . . )set the number of columns and
rows for the output. See each GSET function for the aspect of the graphics output that
it controls.
When using GSET functions, remember the following:
3 All arguments must be specified.
3 All arguments are specified as variables or constants. If you express an argument
as a variable, the variable must be initialized.
3 All character arguments that are expressed as character strings must be enclosed
in quotation marks.
3 All character variable names used as arguments must be declared in a LENGTH
statement.
3 All character constants must be enclosed in single or double quotation marks.
GSET functions:
ASF
ASPECT
CATALOG
CBACK
CLIP
COLREP
DEVICE
FILCOLOR
FILINDEX
FILREP
FILSTYLE
FILTYPE
DATA Step Graphics Interface Dictionary ASF 1463
HPOS
HSIZE
HTML
LINCOLOR
LININDEX
LINREP
LINTYPE
LINWIDTH
MARCOLOR
MARINDEX
MARREP
MARSIZE
MARTYPE
MESSAGE
PATREP
TEXALIGN
TEXCOLOR
TEXFONT
TEXHEIGHT
TEXINDEX
TEXPATH
TEXREP
TEXUP
TRANSNO
VIEWPORT
VPOS
VSIZE
WINDOW
ASF
Specifies an aspect source flag to bundle or separate attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Default Value: INDIVIDUAL
1464 ASF Chapter 50
Syntax
return-code-variable=GSET(’ASF’, attribute, status);
Description
The GSET(’ASF’, . . . )function sets an attribute’s aspect source flag (ASF) so that it
can be used in a bundle (BUNDLED) or individually (INDIVIDUAL).
If an attribute’s ASF is set to ’BUNDLED’, it cannot be used outside of a bundle. It
must be defined in a GSET(’xxxREP’, . . . )function and activated with a
GSET(’xxxINDEX’, . . . )function, where xxx can have one of the following values: FIL,
LIN, MAR, TEX.
If an attribute’s ASF is set to ’INDIVIDUAL’, it cannot be used with a bundle. In
this case, the attribute is set with a GSET(’attribute’, . . . ). The values of attribute are
listed in "Argument Definitions."
Argument Definitions
attribute character string enclosed in quotes or character variable name with
one of the following values:
3 FILCOLOR
3 FILSTYLE
3 FILTYPE
3 LINCOLOR
3 LINTYPE
3 LINWIDTH
3 MARCOLOR
3 MARSIZE
3 MARTYPE
3 TEXCOLOR
3 TEXFONT.
See Also
ASPECT
Specifies the aspect ratio
Operating States: GKCL
Return Codes: 0, 1, 90, 307
Default Value: 0.0
Syntax
return-code-variable=GSET(’ASPECT’, aspect);
Description
The GSET(’ASPECT’, . . . )function sets the aspect ratio used to draw graphics output.
GSET(’ASPECT’, . . . )affects only pies, arcs, and software text.
Argument Definitions
aspect numeric constant or numeric variable name; specifies the aspect
ratio and cannot be less than 0.
See Also
CATALOG
Specifies the catalog for the graphs
Operating States: GKCL
Return Codes: 0, 1
Default Values: libref = WORK, catalog-name=GSEG
Syntax
return-code-variable=GSET(’CATALOG’, libref, catalog-name);
Description
The GSET(’CATALOG’, . . . )function makes the specified catalog the current catalog in
which to store graphs generated with DSGI. GSET(’CATALOG’, . . . )creates the catalog
if it does not exist.
1466 CBACK Chapter 50
The values of libref and catalog-name cannot exceed eight characters. The number of
characters allowed for a catalog name varies across operating environments; see the
SAS companion for your operating system. Libref should have been defined through the
LIBNAME statement.
Argument Definitions
libref character string enclosed in quotation marks or character variable
name; points to the library that contains the catalog.
catalog-name character string enclosed in quotation marks or character variable
name; specifies the catalog name to be used.
See Also
CBACK
Specifies the background color
Operating States: GKCL
Return Codes: 0, 1
Default Value: 1. CBACK= graphics option, if specified; 2. device’s default background
color.
Syntax
return-code-variable=GSET(’CBACK’, cback);
Description
The GSET(’CBACK’, . . . )function sets the background color. GSET(’CBACK’, . . . )has
the same effect as the CBACK= graphics option.
Argument Definitions
cback character string enclosed in quotation marks or character variable
name; can contain any predefined SAS color name. See “SAS Color
Names and RGB Values” on page 99 for a list of predefined SAS
color names.
See Also
CLIP
Specifies whether clipping is on or off
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0
Default Value: OFF
Syntax
return-code-variable=GSET(’CLIP’, status);
Description
The GSET(’CLIP’, . . . )function activates or suppresses clipping around the current
viewport.
Argument Definitions
status character string enclosed in quotation marks or character variable
name; valid values are ON and OFF. When ON is used, the graphics
elements outside of the specified viewport are not displayed. If you
turn clipping OFF, the graphics elements outside of the defined
viewport are displayed.
See Also
COLREP
Associates a color name with a certain color index
Operating States: SGOP
Return Codes: 0, 4, 86
Default Values: 1. colors list of COLORS= graphics option; 2. device’s default colors list
1468 DEVICE Chapter 50
Syntax
return-code-variable=GSET(’COLREP’, color-index, color);
Description
The GSET(’COLREP’, . . . )function associates a predefined SAS color name with a color
index. Many of the GASK routines and GSET functions use color-index as an argument.
If this function is not used, DSGI searches for a color specification in the following
order:
1 the nth color in the colors list of the COLORS= graphics option
2 the nth color in the device’s default colors list.
Argument Definitions
color-index numeric constant or numeric variable name; a number from 1 to 256
that identifies a color.
color character string enclosed in quotation marks or character variable
name; a predefined SAS color name. See “SAS Color Names and
RGB Values” on page 99 for a list of predefined SAS color names.
See Also
DEVICE
Specifies the output graphics device
Operating States: GKCL
Return Codes: 0, 1
Default Value: 1. DEVICE= graphics option, if specified; 2. value entered in DEVICE
prompt window; 3. value entered in OPTIONS window
Syntax
return-code-variable=GSET(’DEVICE’, device);
Description
The GSET(’DEVICE’, . . . )function selects the device driver.
Argument Definitions
device character string enclosed in quotation marks or character variable
name; the name of the driver you will be using. Device must match
DATA Step Graphics Interface Dictionary FILCOLOR 1469
See Also
FILCOLOR
Specifies the color index of the color used to draw fill areas
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 85
Default Value: 1
Syntax
return-code-variable=GSET(’FILCOLOR’, color-index);
Description
The GSET(’FILCOLOR’, . . . )function selects the color index of the color used to draw
fill areas. The aspect source flag (ASF) of FILCOLOR must be set to ’INDIVIDUAL’ for
this attribute to be used outside of a fill bundle.
DSGI searches for a color to assign to the index in the following order:
1 the color specified for the index in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list found in the device entry.
Argument Definitions
color-index numeric constant or numeric variable name; indicates the index of
the color to be used. Valid values are 1 to 256, inclusive.
See Also
FILINDEX
Specifies the index of the bundle of fill area attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 75
Default Value: 1
Syntax
return-code-variable=GSET(’FILINDEX’, index);
Description
The GSET(’FILINDEX’, . . . )function activates a particular fill bundle. The aspect
source flag (ASF) for FILCOLOR, FILSTYLE, and FILTYPE must be set to ’BUNDLED’
before the associated GDRAW function is executed if you want the bundled values to be
used when the affected graphics element is drawn.
Argument Definitions
index numeric constant or numeric variable name; specifies the index
number of the fill bundle. Valid values are 1 to 20, inclusive.
See Also
FILREP
Associates a bundle of fill attributes with an index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 75, 78, 85
Default Value: none
Syntax
return-code-variable =GSET(’FILREP’, index, color-index, interior, style-index);
DATA Step Graphics Interface Dictionary FILSTYLE 1471
Description
The GSET(’FILREP’, . . . )function assigns a color, type of interior, and style of the
interior to a specific fill bundle. The aspect source flags for FILCOLOR, FILTYPE, and
FILSTYLE must be set to ’BUNDLED’ before the associated GDRAW function is
executed if you want the bundled values to be used when the affected graphics element
is drawn.
Argument Definitions
index numeric constant or numeric variable name; indicates the index to
be used with the bundle. Valid values are 1 to 20, inclusive. If index
is expressed as a variable, the variable name must be initialized to a
value between 1 and 20.
color-index numeric constant or numeric variable name; indicates the index of
the color to be used. Valid values are 1 to 256, inclusive. The color
index should represent one of the following:
3 a color index assigned with the GSET(’COLREP’, . . . )function
3 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
interior character string enclosed in quotation marks or character variable
name; indicates the type of interior. Valid values are
3 HATCH
3 HOLLOW
3 PATTERN
3 SOLID.
See Also
FILSTYLE
Specifies the style of the interior of the fill area when the FILTYPE is PATTERN or HATCH
1472 FILSTYLE Chapter 50
Syntax
return-code-variable=GSET(’FILSTYLE’, style-index);
Description
The GSET(’FILSTYLE’, . . . )function activates a particular fill pattern when FILTYPE
is specified as either PATTERN or HATCH. The aspect source flag (ASF) must be set to
’INDIVIDUAL’ for this attribute to be used outside of a fill bundle.
1 X1 M1X 31 M3N045
2 X2 M1X030 32 M3N060
3 X3 M1X045 33 M3N090
4 X4 M1X060 34 M3N120
5 X5 M1N 35 M3N135
6 L1 M1N030 36 M3N150
7 L2 M1N045 37 M4X
8 L3 M1N060 38 M4X030
9 L4 M1N090 39 M4X045
10 L5 M1N120 40 M4X060
11 R1 M1N135 41 M4N
12 R2 M1N150 42 M4N030
13 R3 M2X 43 M4N045
14 R4 M2X030 44 M4N060
15 R5 M2X045 45 M4N090
16 M2X060 46 M4N120
17 M2N 47 M4N135
18 M2N030 48 M4N150
19 M2N045 49 M5X
20 M2N060 50 M5X030
21 M2N090 51 M5X045
22 M2N120 52 M5X060
23 M2N135 53 M5N
24 M2N150 54 M5N030
25 M3X 55 M5N045
DATA Step Graphics Interface Dictionary FILTYPE 1473
26 M3X030 56 M5N060
27 M3X045 57 M5N090
28 M3X060 58 M5N120
29 M3N 59 M5N135
30 M3N030 60 M5N150
Argument Definitions
style-index numeric constant or numeric variable name. Valid values are 1 to
15, inclusive, when FILTYPE is PATTERN, or 1 to 60, inclusive,
when FILTYPE is HATCH. See Table 49.1 on page 1360 for value
specifications.
See Also
FILTYPE
Specifies the type of the interior of the fill area
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 78
Default Value: HOLLOW
Syntax
return-code-variable=GSET(’FILTYPE’, interior);
Description
The GSET(’FILTYPE’, . . . )function selects a particular type of interior fill. If FILTYPE
is set to HATCH or PATTERN, the GSET(’FILSTYLE’, . . . )function determines the
type of hatch or pattern fill used. The aspect source flag (ASF) for FILTYPE must be
set to ’INDIVIDUAL’ for this attribute to be used outside of a fill bundle.
Argument Definitions
interior character string or character variable name; indicates the type of
interior fill. Valid values are
3 HATCH
1474 HPOS Chapter 50
3 HOLLOW
3 PATTERN
3 SOLID.
See Also
HPOS
Specifies the number of columns
Operating States: GKCL
Return Codes: 0, 1, 90, 307
Default Value: 1. HPOS= graphics option, if specified; 2. device’s default HPOS setting
Syntax
return-code-variable=GSET(’HPOS’, hpos);
Description
The GSET(’HPOS’, . . . )function sets the number of columns in the graphics output
area. GSET(’HPOS’, . . . )has the same effect as the HPOS= graphics option. See
“HPOS” on page 315 for more information. You can reset the HPOS value by
submitting one of the following statements:
goptions reset=goptions;
goptions reset=all;
goptions hpos=0;
Argument Definitions
hpos numeric constant or numeric variable name; specifies the number of
horizontal columns; must be greater than 0.
See Also
HSIZE
Specifies the horizontal dimension of the graphics output area
Operating States: GKCL
Return Codes: 0, 1, 90, 307
Default Value: 1. HSIZE= graphics option, if specified; 2. HSIZE device parameter
Syntax
return-code-variable=GSET(’HSIZE’, hsize);
Description
The GSET(’HSIZE’, . . . )function sets the horizontal dimension, in inches, of the
graphics output area. GSET(’HSIZE’, . . . )affects the dimensions of the default
window. You can reset the HSIZE value by submitting one of the following statements:
goptions reset=goptions;
goptions reset=all;
goptions hsize=0;
Argument Definitions
hsize numeric constant or numeric variable name; specifies the horizontal
dimension, in inches, of the graphics output area; must be greater
than 0.
See Also
HTML
Specifies the HTML string to invoke when an affected DSGI graphic element in a web page is
clicked
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Default Value: null
1476 LINCOLOR Chapter 50
Syntax
return-code-variable=GSET(’HTML’, ’string’);
Description
The GSET(’HTML’, . . . )function sets the HTML string to invoke when an affected
DSGI graphic element in a web page is clicked. The HTML string is used with ODS
processing to create a drill-down graph. The string value is used as the value for the
HREF= attribute in the image map that implements the drill-down capability.
The value for string must be HREF= followed by a valid URL that is specified in
double quotation marks, as in
rc = GSET(’HTML’, ’HREF="http://www.sas.com/"’);
The HTML string can be used by any of the following graphic element types drawn
in the code: BAR, ELLIPSE, FILL, MARK, PIE, and TEXT. The string applies to all of
these element types that are drawn after the string is set. To change the HTML string,
set a new value. To turn off the HTML string, specify a null string:
rc = GSET(’HTML’, ’’);
For more information on drill-down graphs, see “Adding Drill-Down Links to Web
Presentations” on page 571. For an example of how to use DSGI to generate a
drill-down graph, see “Generating a Drill-down Graph Using DSGI” on page 1395.
Argument Definitions
string the HTML string. The string must be enclosed in single quotation
marks and must begin with HREF= followed by a URL that is
enclosed in double quotation marks.
See Also
LINCOLOR
Specifies the color index of the color used to draw lines
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 85
Default Value: 1
DATA Step Graphics Interface Dictionary LININDEX 1477
Syntax
return-code-variable=GSET(’LINCOLOR’, color-index);
Description
The GSET(’LINCOLOR’, . . . )function selects the index of the color used to draw lines.
The aspect source flag (ASF) for LINCOLOR must be set to ’INDIVIDUAL’ for this
attribute to be used outside of a line bundle.
DSGI searches for a color specification in the following order:
1 the color specified for the index in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list found in the device entry.
Argument Definitions
color-index numeric constant or numeric variable name; indicates the index of
the color to use. Valid values are 1 to 256, inclusive.
See Also
LININDEX
Specifies the index of the bundle of line attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 60
Default Value: 1
Syntax
return-code-variable=GSET(’LININDEX’, index);
Description
The GSET(’LININDEX’, . . . )function activates a particular line bundle. The aspect
source flags (ASF) of LINCOLOR, LINTYPE, and LINWIDTH must be set to
’BUNDLED’ before the associated GDRAW function is executed if you want the bundled
values to be used when the affected graphics element is drawn.
1478 LINREP Chapter 50
Argument Definitions
index numeric constant or numeric variable name; indicates the index of
the bundle to activate. Valid values are 1 to 20, inclusive.
See Also
LINREP
Associates a bundle of line attributes with an index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 60, 62, 85, 90
Default Value: none
Syntax
return-code-variable=GSET (’LINREP’,index, color-index, width, type);
Description
The GSET(’LINREP’, . . . )function assigns a color, width, and line type to a specific
line bundle. The aspect source flags (ASF) for LINCOLOR, LINWIDTH, and LINTYPE
must be set to ’BUNDLED’ before the associated GDRAW function is executed if you
want the bundled values to be used when the affected graphics element is drawn.
Argument Definitions
index numeric constant or numeric variable name; indicates the number
for the bundle to use as an index. Valid values are 1 and 20,
inclusive. If index is expressed as a variable, the variable must be
initialized to a value between 1 and 20.
color-index numeric constant or numeric variable name; specifies the index of
the color to use. Valid values are 1 to 256, inclusive. The color index
should represent one of the following:
3 a color index assigned with the GSET(’COLREP’, . . . )function
3 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
width numeric constant or numeric variable name; indicates the width of
the line; must be greater than 0.
type numeric constant or numeric variable name; indicates the type of
line. Valid values are 1 to 46, inclusive. See Figure 7.22 on page 208
for representations of the different line types.
DATA Step Graphics Interface Dictionary LINWIDTH 1479
See Also
LINTYPE
Specifies the line type
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 62
Default Value: 1
Syntax
return-code-variable=GSET(’LINTYPE’, type);
Description
The GSET(’LINTYPE’, . . . )function selects a line type. See Figure 7.22 on page 208 for
representations of the different line types. The aspect source flag (ASF) for LINTYPE
must be set to ’INDIVIDUAL’ for this attribute to be used outside of a line bundle.
Argument Definitions
type numeric constant or numeric variable name; indicates the type of
line to use. Valid values are 1 to 46, inclusive.
See Also
LINWIDTH
Specifies the thickness of the line
1480 MARCOLOR Chapter 50
Syntax
return-code-variable=GSET(’LINWIDTH’, width);
Description
The GSET(’LINWIDTH’, . . . )function selects a line width in units of pixels. The
aspect source flag (ASF) for LINWIDTH must be set to ’INDIVIDUAL’ for this attribute
to be used outside of a line bundle.
Argument Definitions
width numeric constant or numeric variable name; specifies the width of
the line in pixels; must be greater than 0.
See Also
MARCOLOR
Specifies the color index of the color used to draw markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 85
Default Value: 1
Syntax
return-code-variable=GSET(’MARCOLOR’, color-index);
Description
The GSET(’MARCOLOR’, . . . )function selects the color index of the color used to draw
markers. The aspect source flag (ASF) of MARCOLOR must be set to ’INDIVIDUAL’ for
this attribute to be used outside of a marker bundle.
DSGI searches for a color specification in the following order:
1 the color specified for the index in a GSET(’COLREP’, . . . )function
2 the nth color in the colors list of the COLORS= graphics option
DATA Step Graphics Interface Dictionary MARINDEX 1481
3 the nth color in the device’s default colors list found in the device entry.
Argument Definitions
color-index numeric constant or numeric variable name; indicates the index of
the color to use. Valid values are 1 to 256, inclusive.
See Also
MARINDEX
Specifies the index of the bundle of marker attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 64
Default Value: 1
Syntax
return-code-variable=GSET(’MARINDEX’, index);
Description
The GSET(’MARINDEX’, . . . )function activates the marker bundle indicated by index.
The aspect source flag (ASF) for MARCOLOR, MARTYPE, and MARSIZE must be set
to ’BUNDLED’ before the GDRAW(’MARK’, . . . )function is executed if you want the
bundled values to be used when the marker is drawn.
Argument Definitions
index numeric constant or numeric variable name; the number of the
bundle to activate. Valid values are 1 to 20, inclusive.
See Also
MARREP
Associates a bundle of marker attributes with an index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 64, 66, 85, 90
Default Value: none
Syntax
return-code-variable=GSET (’MARREP’,index, color-index, size, type);
Description
The GSET(’MARREP’, . . . )function assigns a color, size, and type of marker to a
specific marker bundle. The aspect source flag (ASF) of MARCOLOR, MARSIZE, and
MARTYPE must be set to ’BUNDLED’ before the GDRAW(’MARK’, . . . )function is
executed if you want the bundled values to be used when the marker is drawn.
Argument Definitions
index numeric constant or numeric variable name; defines the bundle
index number. Valid values are 1 to 20, inclusive.
color-index numeric constant or numeric variable name; indicates the color
index of the color to use. Valid values are 1 to 256, inclusive. The
color index should represent one of the following:
3 a color index assigned to a color name with the
GSET(’COLREP’, . . . )function
3 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
size numeric constant or numeric variable name; indicates the size of the
marker in units of the current window system; must be greater than
0.
type numeric constant or numeric variable name; specifies the type of
marker to use; valid values are 1 to 67, inclusive. See Table 50.2 on
page 1484 for a table of the symbols used for each marker type.
See Also
MARSIZE
Selects the size of markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 90
Default Value: 1
Syntax
return-code-variable=GSET(’MARSIZE’, size);
Description
The GSET(’MARSIZE’, . . . )function sets the marker size in units of the current
window system. The aspect source flag (ASF) of MARSIZE must be set to
’INDIVIDUAL’ for this attribute to be used outside of a marker bundle.
Argument Definitions
size numeric constant or numeric variable name; indicates the size of the
marker in units of the current window system; must be greater than
0.
See Also
MARTYPE
Selects the kind of markers
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 66
Default Value: 1
Syntax
return-code-variable=GSET(’MARTYPE’, type);
Description
The GSET(’MARTYPE’, . . . )function determines the type of marker drawn. See Figure
7.21 on page 202 for representations of the symbols described in Table 50.2 on page
1484 MARTYPE Chapter 50
1484. The aspect source flag (ASF) of MARTYPE must be set to ’INDIVIDUAL’ for this
attribute to be used outside of a marker bundle.
2 x 25 L 47 lozenge
3 star 26 M 48 spade
4 square 27 N 49 heart
5 diamond 28 O 50 diamond
6 triangle 29 P 51 club
7 hash 30 Q 52 shamrock
8 Y 31 R 53 fleur-de-
lis
9 Z 32 S 54 star
10 paw 33 T 55 sun
11 point 34 U 56 Mercury
12 dot 35 V 57 Venus
13 circle 36 W 58 Earth
14 A 37 0 59 Mars
15 B 38 1 60 Jupiter
16 C 39 2 61 Saturn
17 D 40 3 62 Uranus
18 E 41 4 63 Neptune
19 F 42 5 64 Pluto
20 G 43 6 65 moon
21 H 44 7 66 comet
22 I 45 8 67 asterisk
23 J
Argument Definitions
type numeric constant or numeric variable name; indicates the index of
the marker to draw. Valid values are 1 to 67, inclusive. See Table
50.2 on page 1484 for value specifications.
See Also
MESSAGE
Specifies whether the interface error message system is enabled or disabled
Operating States: All
Return Codes: 0
Default Value: ON
Syntax
return-code-variable=GSET(’MESSAGE’, status);
Description
The GSET(’MESSAGE’, . . . )function activates or suppresses automatic error logging.
Argument Definitions
status character string enclosed in quotation marks or character variable
name; indicates whether messages should be displayed. Valid values
are ON and OFF. When ON is used, messages are automatically
generated by the DSGI based on the return code from the function.
If you set MESSAGE to OFF, no messages are automatically printed.
You may choose to do this if you want to print custom messages for
your application or decide which error message you want printed.
See Also
PATREP
Specifies the pattern name of a style index for a particular fill type.
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 79
Default value: 1
1486 TEXALIGN Chapter 50
Syntax
return-code-variable=CALL GSET(’PATREP’, index, pattern-name, hatch-name);
Description
The GSET(’PATREP’, . . . )function sets a pattern of a style index for a particular fill
type.
Argument Definitions
index numeric variable name; indicates the index of the pattern to be used.
pattern-name character variable name; sets the name of the pattern at the
specified index.
hatch-name character variable name; sets the name of the hatch at the specified
index.
See Also
TEXALIGN
Specifies the horizontal and vertical alignment of the text string
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Default values: halign=NORMAL, valign=NORMAL
Syntax
return-code-variable=GSET(’TEXALIGN’, halign, valign);
Description
The GSET(’TEXALIGN’, . . . )function sets a particular type of horizontal and vertical
alignment for text strings. Figure 50.5 on page 1487 illustrates halign.
DATA Step Graphics Interface Dictionary TEXALIGN 1487
Argument Definitions
halign character string enclosed in quotation marks or character variable
name. Valid values are
CENTER
LEFT
NORMAL (the natural alignment based on the text path);
alignment is chosen according to the following logic:
1 If TEXPATH is ’RIGHT’, then NORMAL is ’LEFT’.
2 Otherwise, if TEXPATH is ’LEFT’, then NORMAL is
’RIGHT’.
3 Otherwise, the text string is centered.
RIGHT.
valign character string enclosed in quotation marks or character variable
name. Valid values are
BASE (alignment based on the baseline of the text string)
BOTTOM (alignment based on the bottom of the text string)
HALF (alignment based on the vertical midpoint of the string)
NORMAL (natural alignment based on the text path); alignment
is chosen according to the following logic:
1488 TEXCOLOR Chapter 50
See Also
TEXCOLOR
Specifies the color index of the color used to draw text strings
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 85
Default Value: 1
Syntax
return-code-variable=GSET(’TEXCOLOR’, color-index);
Description
The GSET(’TEXCOLOR’, . . . )function selects the color for text. The aspect source flag
(ASF) of TEXCOLOR must be set to ’INDIVIDUAL’ for this attribute to be used outside
of a text bundle.
The value of GSET(’TEXCOLOR’, . . . )can be used in a text bundle. See the
“TEXREP” on page 1492 for information on how to define a text bundle.
DSGI searches for a color specification in the following order:
1 the color specified for the index in a GSET(’COLREP’, . . . )function
2 the nth color from the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list found in the device entry.
Argument Definitions
color-index numeric constant or numeric variable name; indicates the color
index of the color to be used. Valid values are 1 to 256, inclusive.
DATA Step Graphics Interface Dictionary TEXFONT 1489
See Also
TEXFONT
Specifies the font used to draw text strings
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8
Default values: 1. FTEXT= graphics option, if specified; 2. hardware font, if possible; 3.
SIMULATE font
Syntax
return-code-variable=GSET(’TEXFONT’, font);
Description
The GSET(’TEXFONT’, . . . )function selects a SAS/GRAPH font for the text. The
aspect source flag (ASF) of TEXFONT must be set to ’INDIVIDUAL’ for this attribute to
be used outside of a text bundle. See “Font Lists” on page 82 for a list of valid
SAS/GRAPH fonts. You may also use fonts you have created using the GFONT
procedure.
Argument Definitions
font character string enclosed in quotation marks or character variable
name; the name of a font that can be accessed by SAS/GRAPH
software. If you want to use the hardware font, submit
rc=gset(’texfont’, ’ ’);
When DSGI is used with long font names, the font name must be in double quotation
marks that are embedded in single quotation marks, as in ’“HW font name”’.
1490 TEXHEIGHT Chapter 50
See Also
TEXHEIGHT
Specifies the character height of the text string
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 73
Default Value: 1. HTEXT= graphics option, if specified; 2. 1 unit
Syntax
return-code-variable=GSET(’TEXHEIGHT’, height);
Description
The GSET(’TEXHEIGHT’, . . . )function sets the height for text. GSET(’TEXHEIGHT’,
. . . )affects text the same way as the HTEXT= graphics option.
Argument Definitions
height numeric constant or numeric variable name; indicates height in
units based on the current window system; must be greater than 0.
See Also
TEXINDEX
Specifies the index of the bundle of text attributes
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 68
Default Value: 1
DATA Step Graphics Interface Dictionary TEXPATH 1491
Syntax
return-code-variable=GSET(’TEXINDEX’, index);
Description
The GSET(’TEXINDEX’, . . . )function activates the text bundle indicated by index.
The aspect source flag (ASF) for TEXCOLOR and TEXFONT must be set to
’BUNDLED’ before the GDRAW(’TEXT’, . . . )function is executed if you want the
bundled values to be used when the text is drawn.
Argument Definitions
index numeric constant or numeric variable name; indicates the number of
the bundle to activate. Valid values are 1 to 20, inclusive.
See Also
TEXPATH
Specifies the direction of the text string
Syntax
return-code-variable=GSET(’TEXPATH’, path);
Description
The GSET(’TEXPATH’, . . . )function selects a particular type of text path. Text path
determines the direction in which the text string reads. Figure 50.7 on page 1492
illustrates the text paths that can be used with DSGI.
1492 TEXREP Chapter 50
Argument Definitions
path character string enclosed in quotation marks or character variable
name; specifies the direction in which the text will read. Valid
values are
3 DOWN
3 LEFT
3 RIGHT
3 UP.
See Also
TEXREP
Associates a bundle of text attributes with an index
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 68, 85
Default Value: none
Syntax
return-code-variable=GSET (’TEXREP’,index, color-index, font);
DATA Step Graphics Interface Dictionary TEXUP 1493
Description
The GSET(’TEXREP’, . . . )function assigns a color and font to a particular text bundle.
The aspect source flags (ASF) of TEXCOLOR and TEXFONT must be set to
’BUNDLED’ before the GDRAW(’TEXT’, . . . )function is executed if you want the
bundled values to be used when the text is drawn.
Argument Definitions
index numeric constant or numeric variable name; specifies the number to
use as an index for the bundle; valid values are 1 to 20, inclusive. If
index is expressed as a variable, the variable must be initialized to a
value between 1 and 20.
color-index numeric constant or numeric variable name; indicates the color to
use; valid values are 1 to 256, inclusive. The color index should
represent one of the following:
3 a color index assigned with the GSET(’COLREP’, . . . )function
3 the nth color in the colors list of the COLORS= graphics option
3 the nth color in the device’s default colors list.
font character string enclosed in quotation marks or character variable
name; names the font to use with the bundle. See “Font Lists” on
page 82 for a list of valid SAS/GRAPH fonts. You may also use fonts
you have created using the GFONT procedure.
See Also
TEXUP
Specifies the orientation (angle) of the text string
Operating States:GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 74
Default Values: upx=0, upy=1
Syntax
return-code-variable=GSET(’TEXUP’,upx, upy);
Description
The GSET(’TEXUP’, . . . )function sets the angle of the text string. DSGI uses the
values of character up vectors to determine the angle of a text string. The character up
1494 TEXUP Chapter 50
vector has two components, upx and upy, that describe the angle at which the text
string is placed. The angle is calculated with the following formula:
angle=atan(upx/upy)
Effectively, when DSGI is calculating the angle for the text, it uses upx and upy as
forces that are pushing the string toward an angle. The natural angle of text in the upx
direction is toward the 6 o’clock position. In the upy direction, text naturally angles at
the 3 o’clock position. If upx is greater than upy, the text is angled toward 6 o’clock. If
upy is greater than upx, the text is angled toward 3 o’clock. Figure 50.8 on page 1494
shows the angle of text when the values for upx and upy are (0.0, 1.0) and (1.0, 0.0).
As you change the values of upx and upy, the coordinate that has the highest value is
taken as the angle, and the lowest value as the offset. Figure 50.9 on page 1495 shows
the angle of text when the character up vector values (+1.0, +0.5) are used.
DATA Step Graphics Interface Dictionary TEXUP 1495
You can use the following macro to convert angles measured in degrees to character
up vectors:
%macro angle(x);
if mod(&x, 180)=90 then do;
if mod(&x,270) = 0 then
xup = 1.0;
else
xup = -1.0;
rc = gset(’texup’, xup, 0.0);
end;
else do;
b = mod(&x, 360);
/* adjust y vector for 2nd and 3rd quadrants */
if b > 90 and b lt 270 then
yup = -1.0;
else
yup = 1.0;
a=&x*1.7453292519943300e-002;
xup = tan(-a);
/* adjust x vector for 3rd quadrant */
if b > 180 and b le 270 then
xup = -xup;
rc = gset(’texup’, xup, yup);
end;
%mend angle;
data _null_;
rc = ginit();
rc = graph(’clear’, ’angle’);
rc = gset(’texalign’, ’left’, ’base’);
rc = gset(’texheight’, 5);
rc = gset(’texfont’, ’swissl’);
%angle(180);
rc = gdraw(’text’, 50, 50, ’180’);
%angle(80);
1496 TRANSNO Chapter 50
Argument Definitions
upx numeric constant or numeric variable name; if upy is 0, upx cannot
be 0.
upy numeric constant or numeric variable name; if upx is 0, upy cannot
be 0.
See Also
TRANSNO
Specifies the number of the transformation to be used
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50
Default Value: 0
Syntax
return-code-variable=GSET(’TRANSNO’, n);
Description
The GSET(’TRANSNO’, . . . )function activates the viewport and/or window you have
defined for the specified transformation number. If you have not defined both a
viewport and window for a transformation, the default is used for the one missing.
You can select 0 as the active transformation, but you cannot define a viewport or
window for that transformation number. A transformation of 0 activates the default
viewport, (0,0) to (1,1), and window, which is device dependent.
Argument Definitions
n numeric constant or numeric variable name; indicates the viewport
and/or window to activate; should correspond to the n used in the
DATA Step Graphics Interface Dictionary VIEWPORT 1497
See Also
VIEWPORT
Associates a viewport with a transformation number
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50, 51, 52
Default Values: llx=0, lly=0, urx=1, ury=1
Syntax
return-code-variable=GSET(’VIEWPORT’, n, llx, lly, urx, ury);
Description
The GSET(’VIEWPORT’, . . . )function defines a viewport and associates it with the
transformation number, n. See the “TRANSNO” on page 1496 for information on how to
activate the viewport. See the “WINDOW” on page 1500 for information on how to
define a window to be used within the viewport.
Argument Definitions
n numeric constant or numeric variable name; specifies the
transformation number of the viewport. Valid values are 1 to 20,
inclusive.
llx numeric constant or numeric variable name; defines the x
component of the lower-left corner of the viewport; must not exceed
the value of urx; cannot be less than 0. Units are based on percent
of the graphics output area.
lly numeric constant or numeric variable name; defines the y
component of the lower-left corner of the viewport; must not exceed
the value of ury; cannot be less than 0. Units are based on percent
of the graphics output area.
1498 VPOS Chapter 50
See Also
VPOS
Specifies the number of rows
Operating States: GKCL
Return Codes: 0, 1, 90, 307
Default Values: 1. VPOS=graphics option, if specified; 2. device’s default VPOS value
Syntax
return-code-variable=GSET(’VPOS’, vpos);
Description
The GSET(’VPOS’, . . . )function sets the number of rows in the graphics output area.
GSET(’VPOS’, . . . )has the same effect on graphics output as the VPOS= graphics
option.
You can reset the VPOS value by submitting one of the following statements:
goptions reset=goptions;
goptions reset=all;
goptions vpos=0;
Argument Definitions
vpos numeric constant or numeric variable name; specifies the number of
rows in the graphics output area; must be greater than 0.
DATA Step Graphics Interface Dictionary VSIZE 1499
See Also
VSIZE
Specifies the vertical dimension of the graphics output area
Syntax
return-code-variable=GSET(’VSIZE’, vsize);
Description
The GSET(’VSIZE’, . . . )function sets the vertical dimension, in inches, of the graphics
output area. GSET(’VSIZE’, . . . )affects the dimensions of the default window.
You can reset the VSIZE value by submitting one of the following statements:
goptions reset=goptions;
goptions reset=all;
goptions vsize=0;
Argument Definitions
vsize numeric constant or numeric variable name; indicates the vertical
dimension for the graph in inches; must be greater than 0.
See Also
WINDOW
Associates a window with a transformation number
Operating States: GKOP, SGOP, WSAC, WSOP
Return Codes: 0, 8, 50, 51
Default Values: llx=0, lly=0; urx and ury are device dependent
Syntax
return-code-variable=GSET (’WINDOW’, n, llx, lly, urx, ury);
Description
The GSET(’WINDOW’, . . . )function defines a window and associates it with a
transformation number. See the “TRANSNO” on page 1496 for information on how to
activate a window. See the “VIEWPORT” on page 1497 for information on how to define
a viewport for a window.
Argument Definitions
n numeric constant or numeric variable name; specifies the
transformation number of the window. Valid values are 1 to 20,
inclusive.
llx numeric constant or numeric variable name; defines the x
component of the lower-left corner of the window; must not exceed
the value of urx. Units are based on percent of the active viewport.
lly numeric constant or numeric variable name; defines the y
component of the lower-left corner of the window; must not exceed
the value of ury. Units are based on percent of the active viewport.
urx numeric constant or numeric variable name; defines the x
component of the upper-right corner of the window. Units are based
on percent of the active viewport.
ury numeric constant or numeric variable name; defines the y
component of the upper-right corner of the window. Units are based
on percent of the active viewport.
See Also
See Also
References
Enderle, G.; Kansy, K.; and Pfaff, G. (1985), Computer Graphics Programming:
GKS–The Graphics Standard Springer-Verlag New York, Inc.
1504
1505
6
P A R T
Appendixes
APPENDIX
1
Summary of ActiveX and Java
Support
Introduction 1508
Global Statements 1508
AXIS Statement 1508
Text Description Suboptions 1509
Tick Mark Description Suboptions 1509
GOPTIONS Statement 1510
LEGEND Statement 1514
LEGEND Statement Text Description Suboptions 1515
PATTERN Statement 1515
SYMBOL Statement 1516
POINTLABEL= Label Description Options 1517
TITLE and FOOTNOTE Statements 1517
PROC GAREABAR 1518
PROC GBARLINE 1519
PROC GCHART 1521
Text Description Suboptions 1525
PROC GCONTOUR 1526
PROC GMAP 1527
PROC GPLOT 1530
PROC GRADAR 1535
PROC G3D 1537
Annotate Functions 1539
BAR 1539
DRAW 1539
DRAW2TXT 1540
FRAME 1540
IMAGE 1540
LABEL 1541
MOVE 1541
PIE 1542
PIECNTR 1542
PIEXY 1543
POINT 1543
POLY 1543
POLYCONT 1544
SYMBOL 1544
1508 Introduction Appendix 1
Introduction
The following tables summarize which options and annotate variables are supported
or partially supported by Java and ActiveX. Partial support for options that refer to
global statements, such as the GAXIS= option, indicates that some but not all AXIS
statement options are supported. Partial support may also indicate that an option
works differently for the server than it does for the Java and ActiveX device drivers, or
that an option works for one or more applets but not for all. For a complete description
of each option or variable, refer to the documentation for the option or variable.
Global Statements
AXIS Statement
Table A1.1 ActiveX and Java Support for the AXIS Statement
LENGTH= No No
LOGBASE= Yes No
LOGSTYLE= Yes No
MAJOR= Yes Yes
REFLABEL= No No
SPLIT= No No
Table A1.2 ActiveX and Java Support for AXIS Text Description Suboptions
TICK= No No
T=
Table A1.3 ActiveX and Java Support for Tick Mark Description Suboptions
HEIGHT= No No
H=
1510 GOPTIONS Statement Appendix 1
GOPTIONS Statement
You must specify the ODS USEGOPT statement for the CTEXT=, CTITLE=, FTEXT=,
FTITLE=, HTEXT=, and HTITLE= options to work for the Java and ActiveX devices.
See “Controlling the Text Font, Size, and Color” on page 493 for more information.
Table A1.4 ActiveX and Java Support for the GOPTIONS Statement
AUTOCOPY No No
NOAUTOCOPY
AUTOFEED No No
NOAUTOFEED
AUTOSIZE= No No
BINDING= No No
BORDER Yes Yes
CELL No No
CHARACTERS No No
NOCHARCTERS
CHARTYPE= No No
CIRCLEARC No No
NOCIRCLEARC
COLLATE No No
NOCOLLATE
COLORS= Yes Yes
CPATTERN= No No
CSYMBOL= No No
DASH No No
NODASH
DASHSCALE= No No
Summary of ActiveX and Java Support GOPTIONS Statement 1511
DELAY= No No
DEVADDR= No No
DISPLAY No No
NODISPLAY
DISPOSAL= No No
DRVINIT= No No
DRVTERM= No No
DUPLEX No No
NODUPLEX
ERASE No No
NOERASE
EXTENSION No No
FASTTEXT No No
NOFASTTEXT
FBY= No No
FCACHE= No No
FILECLOSE= No No
FILEONLY No No
NOFILEONLY
FILL No No
NOFILL
FILLINC= No No
FONTRES= No No
FTEXT= Yes (partial) Yes (partial)
GACCESS= No No
GCLASS= No No
GCOPIES= No No
GDDMCOPY= No No
GDDMNICKNAME= No No
GDDMTOKEN= No No
GDEST= No No
GEND= No No
GEPILOG= No No
GFORMS= No No
GOUTMODE= No No
1512 GOPTIONS Statement Appendix 1
GPROLOG= No No
GPROTOCOL= No No
GRAPHRC No No
NOGRAPHRC
GSFLEN= No No
GSFMODE= No No
GSFNAME= No No
GSFPROMPT No No
NOGSFPROMPT
GSIZE= No No
GSTART= No No
GWRITER= No No
HANDSHAKE= No No
HBY= No No
HORIGIN= No No
HPOS= No No
HSIZE= Yes (partial) Yes (partial)
IMAGESTYLE= Yes No
INTERLACED No No
NOINTERLACED
INTERPOL= No No
ITERATION= No No
KEYMAP= No No
LFACTOR= No No
OFFSHADOW= No No
PAPERDEST= No No
PAPERFEED= No No
PAPERLIMIT= No No
PAPERSIZE= No No
PAPERSOURCE= No No
PAPERTYPE= No No
Summary of ActiveX and Java Support GOPTIONS Statement 1513
PCLIP No No
NOPCLIP
PENMOUNTS= No No
PENSORT No No
NOPENSORT
PIEFILL No No
NOPIEFILL
POLYGONCLIP No No
NOPOLYGONCLIP
POLYGONFILL No No
NOPOLYGONFILL
POSTGEPILOG= No No
POSTGPROLOG= No No
POSTGRAPH= No No
PPDFILE= No No
PREGEPILOG= No No
PREGPROLOG= No No
PREGRAPH= No No
PROMPT No No
NOPROMPT
PROMPTCHARS= No No
RENDER= No No
RENDERLIB= No No
REPAINT= No No
ROTATE= No No
ROTATE No No
NOROTATE
SIMFONT= No No
SPEED= No No
SWAP No No
NOSWAP
SWFONTRENDER No No
NOSWFONTRENDER
SYMBOL No No
NOSYMBOL
TARGETDEVICE= No No
TRANSPARENCY No No
NOTRANSPARENCY
1514 LEGEND Statement Appendix 1
TRANTAB= No No
UCC= No No
USERINPUT No No
NOUSERINPUT
VORIGIN= No No
VPOS= No No
XMAX= No No
XPIXELS= Yes (partial) Yes (partial)
YMAX= No No
YPIXELS= Yes (partial) Yes (partial)
LEGEND Statement
Table A1.5 ActiveX and Java Support for the LEGEND Statement
OFFSET= No No
ORDER= No No
ORIGIN= No No
POSITION= Yes Yes
Summary of ActiveX and Java Support PATTERN Statement 1515
SHAPE= No No
VALUE= Yes (partial) Yes (partial)
Table A1.6 ActiveX and Java Support for LEGEND Text Description Suboptions
ROTATE= No No
TICK= Yes Yes
T=
PATTERN Statement
Table A1.7 ActiveX and Java Support for the PATTERN Statement
SYMBOL Statement
Table A1.8 ActiveX and Java Support for the SYMBOL Statement
STEP= No No
S=
VALUE= Yes (partial for GPLOT) Yes (partial for GPLOT)
V= No (GCONTOUR) No (GCONTOUR)
WIDTH= Yes (partial for GPLOT) Yes (partial for GPLOT)
W= No (GCONTOUR) No (GCONTOUR)
Table A1.9 ActiveX and Java Support for POINTLABEL Description Suboptions
COLOR= Yes No
C=
FONT= Yes No
F=
HEIGHT= Yes No
H=
JUSTIFY= No No
J=
POSITION= No No
Table A1.10 ActiveX and Java Support for TITLE and FOOTNOTE Statements
ANGLE= No No
BOX= No No
BSPACE= No No
MOVE= No No
ROTATE= No No
PROC GAREABAR
RSTAT= Yes No
RESPSTAT=
RESPONSESTAT=
SUBGROUP= Yes No
SUMVAR= Yes No
WSTAT= Yes No
WIDTHSTAT=
Summary of ActiveX and Java Support PROC GBARLINE 1519
PROC GBARLINE
DATA= Yes No
IMAGEMAP= No No
ASCENDING Yes No
AUTOREF Yes No
AXIS= Yes No
CAUTOREF= Yes No
CAXIS= Yes No
CERROR= Yes No
CFRAME= Yes No
CFR=
CFREQ Yes No
CLIPREF Yes No
CLM= Yes No
COUTLINE= Yes No
CPERCENT Yes No
CPCT
CREF= Yes No
CTEXT= Yes No
DESCENDING Yes No
DESCRIPTION= Yes No
DES=
DISCRETE Yes No
ERRORBAR= Yes No
FRAME Yes No
NOFRAME
FR
NOFR
FREQ Yes No
FREQ=numeric- No No
variable
FRONTREF Yes No
1520 PROC GBARLINE Appendix 1
HTML= Yes No
INSIDE= Yes No
LAUTOREF= Yes No
LEVELS= Yes No
LREF= Yes No
LR=
MIDPOINTS=value- Yes No
list
MIDPOINTS=OLD Yes No
MINOR= Yes No
MISSING Yes No
NAME= Yes No
NOAXIS Yes No
NOBASEREF Yes No
NOZERO Yes No
OUTSIDE= Yes No
PATTERNID= Yes No
PERCENT Yes No
PCT
RANGE Yes No
RAXIS= Yes (partial) No
AXIS=
REF= Yes No
SPACE= Yes No
SUM Yes No
SUMVAR= Yes No
TYPE= Yes No
WIDTH= Yes No
WOUTLINE= Yes No
PLOT ASCENDING Yes No
AXIS= Yes No
FREQ=numeric- No No
variable
HTML= No No
MINOR= Yes No
NOLINE Yes No
Summary of ActiveX and Java Support PROC GCHART 1521
NOMARKER Yes No
RAXIS= Yes No
AXIS=
SUMVAR= Yes No
TYPE= Yes No
PROC GCHART
BLOCKMAX= No No
HTML_LEGEND= No No
LEGEND= Yes (partial) Yes (partial)
CFREQLABEL= No No
CLIPREF Yes Yes
HTML_LEGEND= No No
IFRAME= Yes No
MEANLABEL= No No
MIDPOINTS=value- Yes Yes
list
MIDPOINTS=OLD Yes Yes
NOZERO Yes No
OUTSIDE= Yes Yes
SUMLABEL= No No
SUMVAR= Yes Yes
WOUTLINE= Yes No
PIE, PIE3D, and ACROSS= Yes Yes
DONUT
HTML_LEGEND= No No
INVISIBLE= Yes Yes
Summary of ActiveX and Java Support Text Description Suboptions 1525
NOHEADING No No
NOLEGEND Yes Yes
STAR No No
Table A1.14 ActiveX and Java Support for LABEL Text Description Suboptions
JUSTIFY= No No
J=
ROTATE= Yes No
R=
PROC GCONTOUR
INCOMPLETE No No
PLOT ANNOTATE= Yes Yes
ANNO=
AUTOHREF Yes No
AUTOLABEL= No No
AUTOVREF Yes No
CAUTOHREF= Yes No
CAUTOVREF= Yes No
CHREF= Yes No
CH=
GRID Yes No
HAXIS= Yes (partial) Yes (partial)
Summary of ActiveX and Java Support PROC GMAP 1527
HREF= Yes No
HREVERSE= Yes No
LAUTOVREF= Yes No
LEGEND= Yes (partial) Yes (partial)
LLEVELS= Yes No
LVREF= Yes (partial) Yes (partial)
LV=
NAME= Yes Yes
VREF= Yes No
VREVERSE Yes No
PROC GMAP
IMAGEMAP= No No
ID Yes Yes
XSIZE= No No
YSIZE=
XVIEW= Yes Yes (partial)
YVIEW=
ZVIEW=
HTML_LEGEND= No No
LEGEND= Yes (partial) Yes (partial)
XSIZE= No No
YSIZE=
WOUTLINE= No No
XLIGHT= No No
YLIGHT=
XSIZE= No No
YSIZE=
1530 PROC GPLOT Appendix 1
PROC GPLOT
When used with the JAVA or JAVAMETA device driver, the BUBBLE statement must
have at least one axis that is assigned to a numeric variable.
UNIFORM No No
BUBBLE ANNOTATE= Yes Yes
ANNO=
AUTOHREF Yes Yes
BFONT= No No
BLABEL Yes Yes
BSCALE= No No
BSIZE= Yes (partial) Yes (partial)
IFRAME= Yes No
IMAGESTYLE= Yes No
LAUTOHREF= Yes Yes
BFONT= No No
BLABEL Yes Yes
BSCALE= No No
BSIZE= Yes (partial) Yes (partial)
COUTLINE= Yes No
CTEXT= Yes Yes
C=
CVREF= Yes (partial) Yes (partial)
CV=
Summary of ActiveX and Java Support PROC GPLOT 1533
HTML_LEGEND= No No
IMAGESTYLE= Yes No
LAUTOHREF= Yes Yes
REGEQN No No
SKIPMISS Yes Yes
COUTLINE= Yes No
CTEXT= Yes Yes
C=
CVREF= Yes Yes
CV=
HTML_LEGEND= No No
PROC GRADAR
GOUT= Yes No
CHART ACROSS= Yes No
ACROSSVAR=
ANNOTATE= No No
ANNO=
CAXIS= No No
CAXES=
CA=
CFRAME= Yes No
CFR=
CFRAMESIDE= Yes No
CFRAMETOP= Yes No
CSPOKES= Yes No
CSPOKE=
CSTARCIRCLES= Yes No
CSTARCIRCLE=
CSTARFILL= Yes No
CSTARS= Yes No
CSTAR=
CTEXT= Yes No
CTILES= No No
CTILE=
DESCRIPTION= Yes No
DES=
DOWN= Yes No
DOWNVAR=
FONT= Yes No
FREQ= Yes No
FRAME No No
NOFRAME
1536 PROC GRADAR Appendix 1
HEIGHT= Yes No
HLABEL=
HTML= Yes No
HTML_LEGEND= Yes No
IFRAME= No No
IMAGESTYLE= Yes No
INBORDER No No
INHEIGHT= No No
INTERTILE= Yes No
INTERCHART=
LAST= No No
LSPOKE= Yes No
LSTARCIRCLES= Yes No
LSTARCIRCLE=
LSTARS= Yes No
LSTAR=
MAXNVERT= Yes No
MAXVERT=
MISSING No No
MODE= Yes No
NAME= Yes No
NCOLS= No No
NCOL=
NOZEROREF Yes No
NROWS= No No
NROW=
ORDERACROSS= No No
OTHER= Yes No
OVERLAY= Yes No
OVERLAYVAR=
SPIDERWEB Yes No
SPIDER
SPKLABEL= Yes No
STARAXIS= No No
STARAXES=
STARCIRCLES= Yes No
STARCIRCLE=
STARFILL= Yes No
STARINRADIUS= No No
STAROUTRADIUS=
STARLEGEND= Yes No
Summary of ActiveX and Java Support PROC G3D 1537
STARLEGENDLAB= No No
STARSTART= Yes No
STARTYPE= Yes No
SUMVAR= Yes No
TILELEGEND= No No
TILEGLABEL= No No
WAXIS= No No
WEIGHT= No No
WSPOKES= Yes No
WSPOKE=
WSTARCIRCLES= Yes No
WSTARCIRCLE=
WSTARS= Yes No
WSTAR=
PROC G3D
CTEXT= No No
CTOP= No No
XYTYPE= Yes No
ZMAX= Yes No
ZMIN=
SCATTER ANNOTATE= Yes Yes
ANNO=
CAXIS= Yes Yes
TILT= Yes No
XTICKNUM= Yes Yes
YTICKNUM=
ZTICKNUM=
Annotate Functions
BAR
Table A1.20 ActiveX and Java Support for the BAR Function
DRAW
Table A1.21 ActiveX and Java Support for the DRAW Function
HSYS No Yes
LINE Yes Yes
X, Y, Z Yes Yes
1540 DRAW2TXT Appendix 1
DRAW2TXT
Table A1.22 ActiveX and Java Support for the DRAW2TXT Function
FRAME
Table A1.23 ActiveX and Java Support for the FRAME Function
HSYS No No
HTML Yes No
LINE Yes No
SIZE Yes No
STYLE Yes No
WHEN Yes No
IMAGE
Table A1.24 ActiveX and Java Support for the IMAGE Function
IMGPATH Yes No
STYLE Yes No
Summary of ActiveX and Java Support MOVE 1541
WHEN Yes No
X, Y Yes No
LABEL
Table A1.25 ActiveX and Java Support for the LABEL Function
HTML Yes No
MIDPOINT Yes Yes
SIZE No Yes
STYLE Yes (Partial) No
MOVE
Table A1.26 ActiveX and Java Support for the MOVE Function
PIE
Table A1.27 ActiveX and Java Support for the PIE Function
HSYS No Yes
HTML Yes No
PIECNTR
Table A1.28 ActiveX and Java Support for the PIECNTR Function
HSYS No Yes
MIDPOINT Yes Yes
PIEXY
Table A1.29 ActiveX and Java Support for the PIEXY Function
POINT
Table A1.30 ActiveX and Java Support for the POINT Function
POLY
Table A1.31 ActiveX and Java Support for the POLY Function
LINE Yes No
MIDPOINT Yes Yes
X, Y, Z Yes Yes
XC, YC Yes Yes
POLYCONT
Table A1.32 ActiveX and Java Support for the POLYCONT Function
SYMBOL
Table A1.33 ActiveX and Java Support for the SYMBOL Function
CBOX No No
CBORDER No No
COLOR Yes Yes
HSYS No Yes
HTML Yes No
Summary of ActiveX and Java Support SYMBOL 1545
APPENDIX
2
Recommended Reading
Recommended Reading
Customers outside the United States should contact their local SAS office.
1548
1549
Glossary
absolute coordinates
coordinates measured from the origin of the coordinate system. In two-dimensional
graphs, the origin is (0,0). In three-dimensional graphs, the origin is (0,0,0). See also
relative coordinates.
aspect ratio
the ratio of width to height (that is, width divided by height) in an output area such
as a display, plotter, or film recorder. In SAS/GRAPH software, the ASPECT=
graphics option simulates a change in the aspect ratio of the display, causing fonts
and circles to be compressed horizontally or vertically or both.
axis
a one-dimensional line representing the zero point on a scale used to plot values of
x,y, or z coordinates. In SAS/GRAPH software, in two dimensions, the X axis
represents the horizontal plane, and the Y axis represents the vertical plane. In
three dimensions, the X axis represents width, the Y axis represents depth, and the
Z axis represents height. See also Cartesian coordinate system. The term axis may
also refer collectively to the axis line, the major and minor tick marks, the major tick
mark values, and the axis label.
axis area
an area bounded by axes. In SAS/GRAPH software, this area may be enclosed by an
axis frame. See also frame.
baseline
in a font, the imaginary line upon which the characters rest.
block map
a three-dimensional map that uses blocks of varying heights to represent the value of
a variable for each map area.
border
in SAS/GRAPH software, the line drawn around the entire graphics output area.
This area includes the title and footnote areas as well as the procedure output area.
See also frame.
boundary
in the GMAP procedure, a separating line or point that distinguishes between two or
more unit areas or segments.
1550 Glossary
BY group
all observations with the same values for all BY variables.
BY-group processing
the process of using the BY statement to process observations that are ordered,
grouped, or indexed according to the values of one or more variables. Many SAS
procedures and the DATA step support BY-group processing.
BY variable
a variable named in a BY statement whose values define groups of observations to
process.
Cartesian coordinate system
the two- or three-dimensional coordinate system in which perpendicular axes meet at
the origin (0,0) or (0,0,0). Typically, Cartesian coordinate axes are called X, Y, and Z.
See also axis.
Cartesian coordinates
values that locate a point in two- or three-dimensional space. Each value represents
units measured along an X, Y, or Z axis. See also Cartesian coordinate system.
capline
the highest point of a normal uppercase letter. In some fonts, the capline may be
above the top of the letter to allow room for an accent.
catalog
See SAS catalog.
catalog entry
See entry type and SAS catalog entry.
cell
a unit of measure defined by the number of rows and the number of columns in the
graphics output area. See also aspect ratio.
CGM
an abbreviation for computer graphics metafile. A CGM is a graphics output file
written in the internationally recognized format for describing computer graphics
images. This standardization allows any image in a CGM to be imported and
exported among different systems without error or distortion.
character string
one or more alphanumeric or other keyboard characters or both.
character value
a value that can contain alphabetic characters, numeric characters 0 through 9, and
other special characters. See also character variable.
character variable
a variable whose values can consist of alphabetic and special characters as well as
numeric characters.
chart
a graph in which graphics elements (bars, pie slices, and so on) show the magnitude
of a statistic. The graphics elements can represent one data value or a range of data
values.
chart statistic
the statistical value calculated for the chart variable: frequency, cumulative
frequency, percentage, cumulative percentage, sum, or mean.
Glossary 1551
chart variable
a variable in the input data set whose values are categories of data represented by
bars, blocks, slices, or spines.
choropleth map
a two-dimensional map that uses color and fill pattern combinations to represent
different categories or levels of magnitude.
class variable
in some SAS procedures, a variable used to group, or classify, data. Class variables
can be character or numeric. Class variables can have continuous values, but they
typically have a few discrete values that define the classifications of the variable.
classification variable
See class variable.
CMYK
a color-coding scheme that specifies a color in terms of levels of cyan, magenta,
yellow, and black components. The levels of each component range from 0 to 255. See
also HLS, HSV, and RGB.
color map
a table that is used to translate the original colors in graphics output to different
colors when replaying graphics output using the GREPLAY procedure. The table is
contained in a catalog entry.
color, predefined
one of the set of colors for which SAS/GRAPH software defines and recognizes names,
for example, BLACK, BLUE, and CYAN.
color, user-defined
a color expressed in CMYK, HLS, HSV, RGB, or gray-scale format. See also CMYK,
HLS, HSV, RGB, and gray scale.
colors list
the list of foreground colors available for the graphics output. The colors list is either
the default list established from the device entry or the list established from the
colors specified with the COLORS= graphics option.
confidence limits
the upper and lower values of a confidence interval. There is a percentage of
confidence (typically 95%) that the true value of the parameter being estimated lies
within the interval.
contour plot
a three-variable plot that uses line styles or patterns to represent levels of magnitude
of z corresponding to x and y coordinates.
coordinate system
the context in which to interpret coordinates. Coordinate systems vary according to
their origin, limits, and units. See also Cartesian coordinate system.
coordinates
the values representing the location of a data point or a graphics element along the
X, Y, and Z axes. Coordinate values are measured from the origin of the coordinate
system.
1552 Glossary
data area
the portion of the graphics output area in which data values are displayed. In the
Annotate facility, the data area defines a coordinate system. In plots and bar charts,
the data area is bounded by axes; in choropleth maps, the data area is bounded by
the edge of the unit areas. See also graphics output area, procedure output area, and
coordinate system.
data value
a unit of character or numeric information in a SAS data set. A data value
represents one variable in an observation. In the rectangular structure of a SAS data
set, intersection of a row and a column.
date value
See SAS date value.
default
(1) The setting of a value, parameter, or argument used by the SAS System if the
user does not specify a setting.
(2) the value, parameter, or option setting used by the SAS System if the user
specifies no particular setting.
density value
a value assigned to each observation in a map data set reflecting the amount of detail
(resolution) contributed by the observation.
dependent variable
a variable whose value is determined by the value of another variable or set of
variables.
device driver
a routine that generates the specific machine-language commands needed to display
graphics output on a particular device. SAS/GRAPH device drivers take
device-independent graphics information produced by SAS/GRAPH procedures and
create the commands required to produce the graph on the particular device.
device entry
a SAS catalog entry that stores the values of device parameters (or the
characteristics) that are used with a particular output device.
device map
a catalog entry used to convert the SAS/GRAPH internal encoding for one or more
characters to the device-specific encoding needed to display the character(s) in
hardware text on a particular graphics output device. See also hardware character
set.
device parameter
a value in a device entry that defines a default behavior or characteristic of a device
driver. Some device parameters can be overridden by graphics options. See also
graphics option.
display
the area of the monitor that displays what the software presents to you.
display manager
See SAS Display Manager System.
entry type
a characteristic of a SAS catalog entry that identifies its structure and attributes to
the SAS System. When you create an entry, the SAS System automatically assigns
the entry type as part of the name.
Glossary 1553
export
to put a SAS catalog entry containing graphics output into a format that can be
moved to another software product.
feature table
a SAS data set that uses the $GEOREF format to store geometric coordinates for
each unique map area in a single variable value. See also $GEOREF format,
geo-variable, map area, map data set, and traditional map data set.
fileref
a name temporarily assigned to an external file or to an aggregate storage location
that identifies it to the SAS System. You assign a fileref with a FILENAME
statement or with an operating system command.
fill pattern
a design of parallel or crosshatched lines, solid colors, or empty space used to fill an
area in a graph.
font
a complete set of all the characters of the same design and style. The characters in a
font can be figures or symbols as well as alphanumeric characters. See also type style.
font maximum
in the GFONT procedure, the highest vertical coordinate in a font.
font minimum
in the GFONT procedure, the lowest vertical coordinate in a font.
font units
in the GFONT procedure, units defined by the range of coordinates specified in the
font data set. For example, a font in which the vertical coordinates range from 10 to
100 has 90 font units.
font, hardware
a font stored in an output device. See also font, software.
font, software
a font in which the characters are drawn by graphics software. See also font,
hardware.
format
an instruction the SAS System uses to display or write each value of a variable. Some
formats are supplied by SAS software. Other formats can be written by the user with
the FORMAT procedure in base SAS software or with SAS/TOOLKIT software.
frame
a box enclosing a group of graphics elements. In GSLIDE procedure output, the
frame encloses the procedure output area. In GPLOT, GCHART, and GCONTOUR
procedure output, the frame encloses the axis area. In a legend, the frame encloses
the legend label and entries. See also border.
geo-variable
the $GEOREF formatted variable in a feature table that stores the spatial
information as a geometry object. When a feature table is used, this variable is
specified in the ID statement of the GMAP procedure. See also $GEOREF variable,
identification variable, and feature table.
$GEOREF format
a geometric coordinate data arrangement that stores all the spatial information as a
geometry object contained in a single variable. This format, which is used by feature
tables, references to the geometry objects that encapsulate the points, lines, and
polygons necessary to render a map. See also geo-variable and feature table.
1554 Glossary
global statement
a SAS statement that you can specify anywhere in a SAS program.
graph
a visual representation of data showing the variation of a variable in comparison to
one or more other variables.
graphics element
a discrete visual part of a picture. For example, a bar in a chart and a plot’s axis
label are both graphics elements.
graphics device
See graphics output device.
graphics option
a value specified in a GOPTIONS statement that controls some attribute of the
graphics output. The values specified remain in effect only for the duration of the
SAS session. Some graphics options override device parameters.
graphics output
output from a graphics program that can be stored as a catalog entry of type GRSEG,
or as a graphics stream file. Graphics output can be displayed or printed on a
graphics output device. See also graphics output device and graphics stream file
(GSF).
graphics output area
the area of a graphics output device where the graphics output is displayed or drawn.
Typically, the graphics output area occupies the full drawing area of the device, but
the dimensions of the graphics output area can be changed with graphics options or
device parameters. See also procedure output area and graphics output device.
graphics output device
any terminal, printer, or other output device capable of displaying or producing
graphics output. See also graphics output.
graphics stream file (GSF)
a file containing device-dependent graphics commands from a SAS/GRAPH device
driver. This file can be sent to a graphics device or to other software packages.
gray scale
a color-coding scheme that specifies a color in terms of gray components. Gray-scale
color codes are commonly used with some laser printers and PostScript devices.
grid request
in the G3GRID procedure, the request specified in a GRID statement that identifies
the horizontal variables that identify the x-y plane and one or more z variables for
the interpolation.
group variable
a variable in the input data set used to categorize chart variable values into groups.
GSF
See graphics stream file (GSF).
HLS
a color-coding scheme that specifies a color in terms of its hue, lightness, and
saturation components. Hue is the color, lightness is the percentage of white, and
saturation is the attribute of a color that determines its relative strength and its
departure from gray. Lightness and saturation added to the hue produce a specific
shade. See also CMYK, HSV, and RGB.
Glossary 1555
longitude of 0, and other longitude values are measured from there in appropriate
angular units (degrees or radians, for example).
major tick marks
the points on an axis that mark the major divisions of the axis scale. See also minor
tick marks.
map
a graphic representation of an area, often a geographic area, but also any other area
of any size. See also device map and key map.
map area
a polygon or group of polygons on a map, for example, a state, province, or country.
In a traditional map data set, a map area consists of all the observations with the
same values for the identification variable or variables. In a feature table, each
unique geo-variable value is a map area. Map areas are also called unit areas. See
also geo-variable, identification variable, map data set, feature table, and traditional
map data set.
map data set
a SAS data set that contains the spatial information the GMAP procedure uses to
draw a map. See also feature table and traditional map data set.
meridian
an imaginary circle of constant longitude around the surface of the earth
perpendicular to the equator. See also parallel.
midpoint
a value that represents one data value or the middle of a range of data values. When
a midpoint represents a range of values, the algorithm used to calculate it depends
on the procedure.
minor tick marks
the divisions of the axis scale that fall between major tick marks. See also major tick
marks.
needle plot
a plot in which a vertical line connects each data point to the horizontal axis (two
dimensions) or the horizontal plane (three dimensions).
numeric variable
a variable that can contain only numeric values. By default, the SAS System stores
all numeric variables in floating-point representation.
observation
a row in a SAS data set. An observation is a collection of data values associated with
a single entity, such as a customer or state. Each observation contains one data value
for each variable. See also variable.
offset
(1) in a legend, the distance between the edge of the legend or the edge of the legend
frame and the axis frame or the border surrounding the graphics output area. (2) on
an axis, the distance from the origin to either the first major tick mark or the
midpoint of the first bar, or the distance from the last major tickmark or the
midpoint of the last bar to the end of the axis.
origin
(1) in a three-dimensional coordinate system, the point at which the X, Y, and Z axes
intersect, defined by the coordinates (0,0,0). In a two-dimensional coordinate system,
the point at which the X and Y axes intersect, defined by the coordinates (0,0). (2) in
the AXIS statement, the origin is the point at which the axis line begins (the left end
Glossary 1557
of the horizontal axis or the bottom of the vertical axis). In the LEGEND statement,
the origin is the location of the lower-left corner of the legend. (3) in the graphics
output area, the lower-left corner.
palette
the range of colors that can be generated on a graphics device. See also colors list.
panel
in the GREPLAY procedure, a part of the template in which one or more pictures can
be displayed. A template can contain one or more panels.
parallel
an imaginary circle of constant latitude around the surface of the earth parallel to
the equator. See also meridian.
pattern type
the set of fill patterns that are valid for a particular type of graph. The PATTERN
statement supports three pattern types: bar and block patterns, map and plot
patterns, and pie and star patterns. See also fill pattern.
pen mounts
on a pen plotter, the holders for the drawing pens.
pie chart
a chart made up of a circle divided by radial lines used to display the relative
contribution of each part to the whole.
plot
a graph showing the relationship between variables. The coordinates of each point on
the graph represent the values you plot. See also coordinates.
plot line
the line joining the data points in a plot.
plotter
a class of graphics devices that typically use pens to draw hardcopy output.
polygon
a closed, geometric figure bounded by lines or arcs. Polygons can be filled in to
represent a surface.
polygon font
a font in which the characters are drawn with enclosed areas that can be filled or
empty. See also stroked font.
prism map
a three-dimensional map that uses prisms (polyhedrons with two parallel surfaces) of
varying height to indicate the ordinal magnitude of a response variable.
procedure output area
the portion of the graphics output area where the output from a graphics procedure
is displayed. See also graphics output area and data area.
projection
a two-dimensional map representation of unit areas on the surface of a sphere, for
example, geographic regions on the surface of the Earth.
regression analysis
an analysis of the nature of the relationship between two or more variables,
expressed as a mathematical function. On a scatter plot, this relationship is
diagrammed as a line drawn through data points. A straight line indicates simple
regression; a curve indicates a higher-order regression.
1558 Glossary
relative coordinates
the coordinates measured from a point other than the origin, usually the endpoint of
the last graphics element drawn. See also absolute coordinates.
relative move
a move that repositions the graphics element by a specified distance from its current
location. See also absolute move.
replay
to display graphics output that is stored in a catalog entry.
response data set
a SAS data set the GMAP procedure uses that contains data values associated with
map areas and one or more identification variables. See also identification variable,
response values, and response variable.
response levels
the individual values or ranges of values into which the GMAP or GCHART
procedure divides the response variable. See also midpoint.
response values
values of a response variable that the GMAP procedure represents on a map as
different pattern/color combinations, or as raised map areas (prisms), spikes, or
blocks of different heights. The GCHART procedure represents response values as
bars, slices, spines, or blocks. See also midpoint.
response variable
the SAS data set variable in a response data set the GMAP procedure uses that
contains data values associated with a map area. Response variables used by the
GCHART procedure contain data values associated with bars, slices, spines, or blocks.
See also chart variable, response data set, response levels, and response values.
RGB
a color-coding scheme that specifies a color in terms of levels of red, green, and blue
components. The levels of each component range from 0 to 255. See also CMYK,
HLS, and HSV.
rotate
in the graphics editor, to turn a graphics object about its axis.
RUN group
in SAS procedures, a set of statements ending with a RUN statement.
SAS catalog
a SAS file that stores many different kinds of information in smaller units called
catalog entries. A single SAS catalog can contain several different types of catalog
entries.
SAS catalog entry
a separate storage unit within a SAS catalog. Each entry has an entry type that
identifies its purpose to the SAS System. See also entry type.
SAS data library
a collection of one or more SAS files that are recognized by the SAS System and that
are referenced and stored as a unit. Each file is a member of the library.
SAS data set
descriptor information and its related data values organized as a table of
observations and variables that can be processed by the SAS System. A SAS data set
can be either a SAS data file or a SAS data view.
Glossary 1559
template
in the GREPLAY procedure, a framework that enables you to display one or more
pictures on a page.
text string
See character string.
tilt angle
the measure in degrees from the horizontal axis to the major axis of an object.
traditional map data set
a SAS data set that contains variables whose values are x, y coordinates that define
points that are the boundaries of map areas, such as states or counties. Each
observation also contains an identification variable whose value identifies the map
area to which the point belongs. See also identification variable, map area, map data
set, and feature table.
type style
a typeface design and its variations, for example, Swiss, Swiss Bold, and Swiss Italic.
See also font.
unit area
See map area.
user-definable colors
the colors that can be defined using SAS color names, or CMYK (cyan, magenta,
yellow, black), RGB (red, green, blue), HLS (hue, lightness, saturation), HSV (hue,
saturation, value), or gray-scale color equivalents.
value
the text that labels a major tick mark on an axis. Also, in a legend, a value is a line,
bar, or shape that the legend explains.
variable
a column in a SAS data set. A variable is a set of data values that describe a given
characteristic across all observations. See also macro variable.
variable type
the classification of a variable as either numeric or character. Type is an attribute of
SAS variables.
WORK data library
the SAS data library automatically defined by the SAS System at the beginning of
each SAS session or SAS job. It contains SAS files that are temporary by default.
When the libref USER is not defined, the SAS System uses WORK as the default
library for SAS files created with one-level names.
X axis
in a two-dimensional plot, the horizontal axis. In a three-dimensional plot, the X axis
is the axis perpendicular to the Y-Z plane.
Y axis
in a two-dimensional plot, the vertical axis. In a three-dimensional plot, the Y axis is
the axis perpendicular to the X-Z plane.
Z axis
in a three-dimensional plot, the axis perpendicular to the X-Y plane.
Index 1561
Index
# (pound sign), variables as plot point labels 198 GAREABAR procedure 1518 landscape orientation of graphics output
? statement, GREPLAY procedure 1246 GBARLINE procedure 1519 area 34, 322, 323, 349
GCHART procedure 1521 orientation of graphics output area 34
GCONTOUR procedure 1526 portrait orientation of graphics output
GMAP procedure 1527 area 34, 332, 344, 349
Numbers GOPTIONS statement 1510 print orientation 349
3D charts GPLOT procedure 1530 printing orientation 349
3D bar charts 130 GRADAR procedure 1535 rotating and tilting surface map 1068
3D pie charts 6 LEGEND statement 1514 surface and scatter plots 1299, 1316, 1323
PATTERN statement 1515 text in graphics output 213, 219, 222
SYMBOL statement 1516 text in pie charts 1381
TITLE and FOOTNOTE statements 1517 ANGLE= macro argument 546
A ACTXIMG device driver 377, 381, 388 ANGLE= option
A= option data tips for 568 AXIS statement 136, 225
AXIS statement 136, 225 drill-down links in images 571 LABEL= option, DONUT statement 829
LABEL= option, DONUT statement 829 GIF, JPEG, PNG vs. 440 PIE and DONUT statements 820
TITLE, FOOTNOTE, and NOTE state- ODS with 447 STAR statement 835
ments 213, 225 Web presentations, developing 442 TITLE, FOOTNOTE, and NOTE state-
A option, GOPTIONS procedure 1077 ADD statement, GDEVICE procedure 921 ments 213, 225
access permissions, browsers 582 ADMGDF option 262 ANGLE variable, Annotate facility 642
accuracy of color representation 105 Africa, creating outline map of 1232 animation 378, 457
ACROSS= option AFTER option, MOVE statement 1255 creating sequences of 458
CHART statement, GRADAR proce- AHUNITS= macro argument 536 delay between graphs 278
dure 1187, 1201 Albers’ projections 1165 graphics options for 459
LEGEND statement options 152 clipping map areas 1178 repeating as loop 321
PIE and DONUT statements 820 default projection specifications 1174 sample programs 459, 463
STAR statement 835 projection criteria 1172 ANNO= option
ACROSSVAR= option, CHART statement 1187 when to use 1172 BAR statement 753
ACTION= macro argument 546 ALIGN= macro argument 536 BLOCK statement, GCHART procedure 788
action statements 26 alignment BLOCK statement, GMAP procedure 1011
ActiveX Control 370, 385, 387 axis labels 127, 133, 135, 137 BUBBLE statement 1092
authentication 583 axis values 137 CHART statement, GRADAR procedure 1187
drill-down links 392 character cells 268 CHORO statement 1018
drill-down tags 412 legend labels 153 G3D procedure 1300
embedded graphics in Microsoft Word 393, legend text 158, 159 GANNO procedure 708
395 legend values 157 GBARLINE procedure 750
generating output for 391 legends 155, 162 GCHART procedure 786
installing and uninstalling 389 plot print labels 197 GCONTOUR procedure 888
interactive contour plots 394 text in graphics output 218 GMAP procedure 1008
internationalization 392 ALL option, GMAP procedure 1008 GPLOT procedure 1088
ActiveX control file (.exe file) ALL option, GMAP statement 144 GPRINT procedure 1149
location of 422 ALT= macro argument 536 GRADAR procedure 1185
ACTIVEX device driver 381, 388 alternative hardware fonts 80 GSLIDE procedure 1279, 1283
data tips for 568 AMBIENT= parameter, JAVA and ActiveX 427 HBAR and VBAR statements 799
drill-down links in presentations 571 anchors 168, 259 PIE and DONUT statements 820
ActiveX parameters and attributes 421 angle, rotation PLOT statement, G3D procedure 1302
ActiveX support 1508 angling text in pie charts 1381 PLOT statement, GCONTOUR procedure 891
Annotate functions 1539 axis labels 127, 133, 135, 136 PLOT statement, GPLOT procedure 1104
AXIS statement 1508 donut chart labels 829, 830 PRISM statement 1024
G3D procedure 1537 hardware text rotation 330 SCATTER statement, G3D procedure 1307
1562 Index
STAR statement 835 ARC function (DSGI) 1446 colors, CAXIS= option for 753, 789, 799,
SURFACE statement 1031 ARCHIVE= macro argument 536 892,,
%ANNOMAC macro, Annotate facility 679 ARCHIVE= option 422 contour plots 886, 901
Annotate data sets 587, 599 arcs labels 127, 133
applying to web output 500 drawing with Annotate facility 631, 632 line type 134
missing values 601 drawing with DSGI 1446 logarithmic 127, 229, 815, 1087
observation and structure of 589 writing in, DSGI for 1455 offset 130
producing graphics output 601 area bar charts 725 origins 133
annotate facility ActiveX and Java support for 1518 plots with two vertical axes 1084, 1119, 1124
examples 597 chart with numeric category variable 731 scatter plots, reversing 1312
Annotate facility 14, 588, 614 chart with subgrouping 733 splines in star charts 1193, 1210
ActiveX and Java support for 1539 chart with subgrouping and variable percent- suppressing, NOAXES option for 897, 1097,
Annotate graphics in drill-down graphs 719 ages 735 1111, 130
coordinates 596 simple area bar chart 729 suppressing, NOAXIS option for 760, 810,
debugging 604 syntax and options 727 897, 1097,
drill-down links, generating 500 area boundaries, unmatched surface and scatter plots 1299
DSGI vs. 1354 GREDUCE procedure and 1215 tick marks 129
error messages, list of 699 GREMOVE procedure and 1215 tick marks, ordering 226
functions 594, 615 AREA element (HTML) 260 AXIS= option
graphic elements and formatting 595 AREA= option BAR statement 753, 761
images, displaying 118 BLOCK statement 1011 HBAR and VBAR statements 812
in text slides 1278, 1283 PRISM statement 1024 PLOT statement 766, 767
internal coordinates 678 AXIS option, GOPTIONS procedure 1077
areas, Annotate graphics 596
macro data sets 23 AXIS statement 27, 123, 124
AREAS= option, PLOT statement 1104, 1134
macros, how to use 697 ActiveX and Java support for 1508
array of arguments, callback method 408
macros for 679, 697 GCONTOUR procedure 886
ASCENDING option
processing details 602 logarithmic axes 229
BAR statement 753
producing multiple graphs 715 ordering datetime tick marks 226
HBAR and VBAR statements 799
projecting an Annotate data set 1180 AXIS1= and AXIS2= options, GRID state-
PIE and DONUT statements 820
scaling data-dependent output 710 ment 1334, 1336
PLOT statement 766
scaling graphs 710
ASCII-to-EBCDIC translation 358
storing Annotate graphics 713
ASF function (DSGI) 1405, 1464
variables 591, 599, 602, 642 B
ASIS option, GPROJECT procedure 1168
Web output, generating 499
ASPECT function (DSGI) 1407, 1465
Annotate macros 600 B= option, GFONT procedure 947
ASPECT= option 263
ANNOTATE= option 500, 601 BACKCOLOR= parameter, JAVA 427
aspect ratio 263
BAR statement 753 background color
maintaining for cells 1152
BLOCK statement, GCHART procedure 788 graphics output area 266
asymmetrical keymaps and device maps 986
BLOCK statement, GMAP procedure 1011 image transparency 357
BUBBLE statement 1092 attributes, JAVA and ActiveX parameters and at-
legends 152
CHART statement, GRADAR procedure 1187 tributes 421
text in graphics output 215
CHORO statement 1018 ATTRIBUTES= option, ODS statements 421
background images 113, 318, 319
G3D procedure 1300 audience for presentations, considering 380
BACKGROUNDCOLOR= parameter, Metaview
GANNO procedure 708 AUTOCOPY option 263
Applet 475
GBARLINE procedure 750 AUTOFEED option 264 backplane images 115
GCHART procedure 786 AUTOHREF option %BAR, %BAR2 macro, Annotate facility 680
GCONTOUR procedure 888 BUBBLE statement 1092 bar charts 5
GMAP procedure 1008 PLOT statement, GCONTOUR procedure 891 3D plane 130
GPLOT procedure 1088 PLOT statement, GPLOT procedure 1105 basics 775
GPRINT procedure 1149 AUTOLABEL and AUTOLABEL= options, drill-down functionality in 856
GRADAR procedure 1185 PLOT statement 891, 903, 906 error bars in horizontal bar chart 854
GSLIDE procedure 1279, 1283 automatic paper feed 264, 327 group brackets on axis 130
HBAR and VBAR statements 799 AUTOREF option images on bars of 116
PIE and DONUT statements 820 BAR statement 753 midpoints and statistics in horizontal bar
PLOT statement, G3D procedure 1302 HBAR and VBAR statements 799 chart 851
PLOT statement, GCONTOUR procedure 891 AUTOREF= option, AXIS statement op- patterns, outlines, and colors 171, 816
PLOT statement, GPLOT procedure 1104 tions 136 subgroup labels 607
PRISM statement 1024 AUTOSIZE= graphics option 265 subgrouping in pie or donut chart 848
PROC statement 145 AUTOVREF option subgrouping in vertical bar chart 848
SCATTER statement, G3D procedure 1307 BUBBLE statement 1092 sum statistic, specifying (example) 846
STAR statement 835 PLOT statement, GCONTOUR procedure 891 vocabulary of 778
SURFACE statement 1031 PLOT statement, GPLOT procedure 1105 with Web drill-down (example) 255
Any mode drill-down mode, Java 401 AWUNITS= macro argument 541 BAR function, Annotate facility 616, 1539
APPLET element (HTML), macro arguments axes 124 BAR function, DSGI 1448
for 536 axis definitions 1193 bar line charts 739, 796
APPLETLOC= system option 399, 423 colors, bar line charts 765 ActiveX and Java support for 1519
arc-drawing capability, device 270 colors, block charts 795 BAR statement, GBARLINE procedure 751
Index 1563
basic graph with styles (example) 768 specifying response levels (example) 1047 coordinating with BUBBLE statements 1100
colors and images 764 syntax and options 1010 bundling attributes, DSGI 1373
interpolation methods 740 BLOCK statement, GCHART procedure BWIDTH= option, SYMBOL statement 185
missing values 747 ActiveX and Java support for 1521 BY lines 143
parts of 741 block chart with sum statistic (example) 842 BY statement 26, 124, 141
patterns and outlines 748, 764 syntax and options 787 Annotate facility with 603
plot overlays 765 BLOCK statement, GMAP procedure 1010 color of BY lines 267
PLOT statement, GBARLINE procedure 765 ActiveX and Java support for 1527 displaying with (suppressing from) catalog en-
statistics in, displaying 763 assigning formats to response variables (exam- tries 1247, 1256
SYMBOL statement, GBARLINE proce- ple) 1049 fonts FOR BY lines 289
dure 768 drill-down functionality in maps (exam- generating chart series (example) 240
symbols 768 ple) 1054 GREMOVE procedure 1227
syntax and options 749 producing simple block map (example) 1045 height of BY lines 312
BAR statement, GBARLINE procedure 751, specifying response levels (example) 1047 RUN-group processing 33
1519 BLOCKMAX= option, BLOCK statement 144, #BYLINE option, text string specifications 222
bar statistics 741, 763 789 BYLINE statement, GREPLAY procedure 1243,
bar variables 741, 742, 745 BLOCKSIZE= option, BLOCK statement 1012 1247
bars, drawing with DSGI 1448 BO= option, TITLE, FOOTNOTE, and NOTE #BYVAL option, text string specifications 223
baseline, font 940, 947 statements 215, 225 #BYVAR option, text string specifications 223,
baseline, text in graphics output 213, 219 body, animation 458 226
rotating characters from 222 BODY= argument, ODS HTML statement 165
underlining 223 body files for graphics output 491
BASELINE= option, GFONT procedure 947 BODY= option, ODS HTML statement 491
batch environment, GDEVICE procedure in 918 BORDER= graphics option 266
C
switching to 925, 1252 BORDER= macro argument 546 C= option
batch mode 32 BORDER option, GSLIDE procedure 1279, AXIS statement options 126, 136, 139
BC= option, TITLE, FOOTNOTE, and NOTE 1281 BUBBLE statement 1094
statements 215, 225 borders GFONT procedure 947
BCOLOR= option Annotate facility to draw 622 LABEL= option, DONUT statement 829
BUBBLE statement 1092 graphics output area 266, 1281 LEGEND statement options 158
TITLE, FOOTNOTE, and NOTE state- legends 152 PLOT statement, GPLOT procedure 1106
ments 215, 225 BOX= option, TITLE, FOOTNOTE, and NOTE POINTLABEL= specification 197
BDCLASS= macro argument 552 statements 215, 225 SYMBOL statement 185, 206
BEFORE option, MOVE statement 1255 box plots 185, 187 TITLE, FOOTNOTE, and NOTE state-
BFONT= option, BUBBLE statement 1092 creating and modifying (example) 233 ments 216
BG= macro argument 552 line width 201 CA= option
BGTYPE= macro argument 552 boxes around graphics output text 215, 216 BUBBLE statement 1093
BINDING= option 265 brackets, bar charts 130 CHART statement, GRADAR procedure 1187
Bitstream fonts, rendering 82, 293, 346 BROWSE option, GDEVICE procedure 920 PLOT statement, GPLOT procedure 1106
spacing between letters 295 browser permissions 582 callback method, JavaScript 407
bivariate interpolation 1330 BRTITLE= macro argument 553 Canada
BL= option, TITLE, FOOTNOTE, and NOTE BS= option, TITLE, FOOTNOTE, and NOTE census division data 1003, 1033
statements 225 statements 216, 225 reducing map of (example) 1220
BLABEL option, BUBBLE statement 1092 BSCALE= option, BUBBLE statement 1092 capline, font 940, 947
black and white, reversing 353 BSIZE= option, BUBBLE statement 1093 CAPLINE= option, GFONT procedure 947
BLANK= option, TITLE, FOOTNOTE, and BSPACE= option, TITLE, FOOTNOTE, and CAPTURE= argument, META2HTM macro 564
NOTE statements 215, 225 NOTE statements 216, 225 carriage return at record ends 300
blank spaces, removing from data values 414 bubble plots 8, 1083, 1090 Cartesian coordinates, projecting spherical coordi-
block charts 4 adding right vertical axis (example) 1124 nates into 1161
basics 774 controlling bubble display 1098 basic usage of GPROJECT procedure 1172
BLOCK statement syntax 787 coordinating BUBBLE and BUBBLE2 plots re- clipping map areas (example) 1178
grouping and subgrouping in (example) 844 quests 1100 default projection specifications, using (exam-
negative and zero values 795 generating simple bubble plots (exam- ple) 1174
patterns, outlines, and colors 794 ple) 1121 emphasizing map areas (example) 1177
sum statistic, specifying (example) 842 labeling and sizing plot bubbles (exam- ID statement, GPROJECT procedure 1172
text in 795 ple) 1122 input map data sets 1163
block effects for legends 152, 163 BUBBLE statement, GPLOT procedure 1090 projecting an Annotate data set (exam-
block maps 11, 996 ActiveX and Java support for 1530 ple) 1180
assigning formats to response variables (exam- controlling bubble display 1098 syntax and options, GPROJECT proce-
ple) 1049 coordinating with BUBBLE2 statements 1100 dure 1168
drill-down functionality in maps (exam- generating simple bubble plots (exam- types of map projections 1165
ple) 1054 ple) 1121 Cartographic font 87
identification variables 1005 labeling and sizing plot bubbles (exam- CAT command 55
patterns 1016 ple) 1122 catalog entries 1239
predefined formats for 1035 BUBBLE2 statement, GPLOT procedure 1098 BY line 143
producing simple block map (example) 1045 ActiveX and Java support for 1530 changing information about 1254
response levels 1004 adding right vertical axis (example) 1124 copying or duplicating 1251, 1263
1564 Index
deleting from catalogs 1251 census division data, Canada 1003, 1033 basics of 983
displaying BY statement information CENTER= macro argument 553 creating and using 990
with 1247 CENTIMETERS option, GOPTIONS proce- GKEYMAP data sets 987
duplicate entry names 1240 dure 1077 GKEYMAP data sets, generating 990
grouping 1253 %CENTROID macro, Annotate facility 680 ignoring 945, 949
managing 1267 CERROR= option modifying (example) 990
names for 63 BAR statement 753 CHARACTERS option 268
names for image output files 445 HBAR and VBAR statements 800 CHARREC= option, GODEVICE proce-
printing 1254 CFILL= option dure 269
replacing 70 PIE and DONUT statements 821 CHARSET= macro argument 561
replaying 1268 STAR statement 835 CHARSPACETYPE= option, GFONT proce-
selecting for replay 1257 CFR= option dure 948
CATALOG function (DSGI) 1407, 1465 BAR statement 754 CHART statement, GRADAR procedure
CATALOG= option, GDEVICE procedure 921 CHART statement, GRADAR procedure 1187 ActiveX and Java support for 1535
category variables 726 HBAR and VBAR statements 728, 800 assigning axis definitions to axis spokes (exam-
CATEXT= macro argument 546 PLOT statement, GCONTOUR procedure 892 ple) 1210
CAUTOHREF= option PLOT statement, GPLOT procedure 1106 changing star type in radar charts (exam-
BUBBLE statement 1093 CFRAME= option ple) 1207
PLOT statement, GCONTOUR procedure 891 BAR statement 754 color and line styles in radar charts (exam-
PLOT statement, GPLOT procedure 1106 CHART statement, GRADAR proce- ple) 1208
CAUTOREF= option dure 1187, 1208 filling stars in radar charts (example) 1204
BAR statement 753 GSLIDE procedure 1279, 1281 images in radar charts (example) 1205
HBAR and VBAR statements 799 HBAR and VBAR statements 800 multiple classification variables in radar charts
CAUTOVREF= option LEGEND statement options 152 (example) 1202
BUBBLE statement 1093 PLOT statement, GCONTOUR procedure 892 overlaying radar charts (example) 1199
PLOT statement, GCONTOUR procedure 892 PLOT statement, GPLOT procedure 1106 producing basic radar chart (example) 1198
PLOT statement, GPLOT procedure 1106 CFRAMESIZE= option, CHART state- specifying mode for radar charts (exam-
CAXES= option, CHART statement 1187 ment 1187 ple) 1209
CAXIS= option CFRAMETOP= option, CHART statement 1188 syntax and options 1185
BAR statement 753 CFREQ option tiling radar charts (example) 1201
BLOCK statement 789 BAR statement 754 chart statistics
BUBBLE statement 1093 HBAR and VBAR statements 800 GBARLINE procedure 745, 778
CHART statement 1187 CFREQLABEL= option, HBAR and VBAR state- GCHART procedure 782, 815
HBAR and VBAR statements 799 ments 800 horizontal bar chart (example) 851
PLOT statement, G3D procedure 1302 CGMs (computer graphics metafiles) chart variables 778, 779, 780
PLOT statement, GCONTOUR procedure 892 adjusting graphics output (example) 979 charts 4
PLOT statement, GPLOT procedure 1106 creating and importing (example) 977 drill-down functionality, ActiveX 392
SCATTER statement, G3D procedure 1307 elements not supported 971 CHARTYPE= graphics option 79, 270
CBACK= argument, META2HTM macro 565 font substitutions 974 CHARTYPE variable (GKEYMAP data set) 987
CBACK function (DSGI) 1408, 1466 CH= option Chartype window (GDEVICE) 931
CBACK= macro argument 546, 562 BUBBLE statement 1093 CHECK= suboption, AUTOLABEL= op-
CBACK= option 266 PLOT statement, GCONTOUR procedure 892 tion 898
CBLKOUT= option, BLOCK statement 1012 PLOT statement, GPLOT procedure 1106 CHORO statement, GMAP procedure 1017
CBLOCK= option, LEGEND statement 152, CHANDLE= macro argument 546 ActiveX and Java support for 1527
163 CHAR variable (font data sets) 952 creating maps using feature tables (exam-
CBODY= option, SURFACE statement 1031 CHAR1, CHAR2 variables (kern data sets) 959 ple) 1069
CBORDER= option, LEGEND statement op- character bar variables 742 drill-down functionality in maps (exam-
tions 152 character cells 36 ple) 1054
CBORDER variable, Annotate facility 643 alignment 268 labeling U.S. states in choropleth map (exam-
CBOTTOM= option, PLOT statement 1302 as units of measurement 38 ple) 1061
CBOX variable, Annotate facility 644 aspect ratio of 1152 producing simple choropleth map (exam-
CBY= graphics option 267 size of 265 ple) 1053
CC option character chart variables 780 projecting an Annotate data set (exam-
? statement, GREPLAY procedure 1246 character codes 81 ple) 1180
LIST statement, GREPLAY procedure 1254 character codes, displaying 946, 950, 962 choropleth maps 11, 997
CC= option, GREPLAY procedure 1243 character transcoding 561 creating maps using feature tables (exam-
CC statement, GREPLAY procedure 1247 characters ple) 1069
CCOPY statement, GREPLAY procedure 1248 adjusting character size in output (exam- drill-down functionality in maps (exam-
CDEF statement, GREPLAY procedure 1249, ple) 1156 ple) 1054
1274 as axis values 131 identification variables 1005
CDELETE statement, GREPLAY proce- as legend values 155 labeling U.S. states in choropleth map (exam-
dure 1250 HTML entities 582 ple) 1061
CELL option 268 prefixing output records 309 predefined formats for 1035
CEMPTY= option prompts 343 producing simple choropleth map (exam-
BLOCK statement 1012 special plot symbols 200 ple) 1053
CHORO statement 1019 characters, mapping to keyboard 983 response levels 1004
PRISM statement 1025 asymmetrical 986 syntax and options 1017
Index 1565
contour plots 10, 885 PIE and DONUT statements 821 PRISM statement 1025
ActiveX and Java support for 1526 PLOT statement, GCONTOUR procedure 892 SCATTER statement, G3D procedure 1307
axes 886, 901 PLOT statement, GPLOT procedure 1106 STAR statement 836
AXIS statement, GCONTOUR procedure 886 PRISM statement 1025 CTEXT= options, GOPTIONS statement 225,
contour levels, specifying 895, 899, 908 STAR statement 835 276
contour levels, specifying (example) 908 CPATTERN= graphics option 171, 274 CTILE= and CTILES= options, CHART state-
interactive, with ActiveX (example) 394 patterns 179 ment 1189
interpolation methods 887 patterns and 180 CTIPHILT= argument, META2HTM macro 565
labels for contour lines (example) 906 CPCT option CTITLE= graphics option 225, 276
missing values 887, 889 BAR statement 754 CTOP= option, PLOT statement 1302
modifying lines and labels with SYMBOL HBAR and VBAR statements 801 cumulative frequency statistic 745, 782
statement 903 CPERCENT option cumulative percentage statistic 746, 783
PATTERN statement, GCONTOUR proce- BAR statement 754 current window system, DSGI 1359
dure 169 HBAR and VBAR statements 801 curve-drawing capability, device 270
patterns 173 CPERCENTLABEL= option, HBAR and VBAR custom graphs, creating with DSGI 1356
patterns and joins in contour plots (exam- statements 801 CUTOFF= macro argument 547
ple) 910 CPORT procedure 56 CV= option
patterns and joins in (example) 910 CR= option BUBBLE statement 1094
PLOT statement, GCONTOUR procedure 889 BAR statement 754 PLOT statement, GCONTOUR procedure 893
simple, generating (example) 904 HBAR and VBAR statements 801 PLOT statement, GPLOT procedure 1107
simple contour plot, generating (example) 904 CREATE_ID_, MAPIMPORT procedure 1349 SYMBOL statement 186, 206
spline interpolation (example) 1343 creating graphs interactively 395 CVALUE= macro argument, DS2CSF
contour variables 885 CREF= option macro 563
control characters, device 359 BAR statement 754 CVREF= option
converting HBAR and VBAR statements 801 BUBBLE statement 1094
between RGB and HLS colors 103 critical success factor (CSF) diagrams PLOT statement, GCONTOUR procedure 893
graphics output 56, 59 drill-down functionality 573 PLOT statement, GPLOT procedure 1107
coordinates, projecting from spherical to Carte- DS2CSF macro 527, 528
sian 1161 hotspots 532
basic usage of GPROJECT procedure 1172 sample diagrams 530
clipping map areas (example) 1178
D
CSELECT= macro argument 547
default projection specifications, using (exam- CSF diagrams D= option, TITLE, FOOTNOTE, and NOTE
ple) 1174 drill-down functionality 573 statements 217
emphasizing map areas (example) 1177 DS2CSF macro 527, 528 DASH option 277
ID statement, GPROJECT procedure 1172 hotspots 532 dashed lines
input map data sets 1163 sample diagrams 530 hardware-generated 277
projecting an Annotate data set (exam- CSFTYPE= macro argument, DS2CSF lengths of dashes, scaling 278
ple) 1180 macro 562 DASHLINE= option, GDEVICE procedure 277
syntax and options, GPROJECT proce- CSHADOW= option, LEGEND statement op- DASHSCALE= graphics option 278
dure 1168 tions 153, 163 data-dependent coordinates with GSLIDE proce-
types of map projections 1165 CSP= option, GFONT procedure 948 dure 1281
coordinates and coordinate systems CSPOKE= and CSPOKES= options, CHART data library for rendered fonts 347
Annotate facility 596 statement 1188 DATA= macro argument, DS2CSF macro 561
data-dependent, GSLIDE with 1281 CSTAR= option, CHART statement 1188 DATA= option
longitude and latitude 1164 CSTARCIRCLE= and CSTARCIRCLES= op- G3D procedure 1300
templates, changing 1259 tions, CHART statement 1188 G3GRID procedure 1332
COPY function (DSGI) 1458 CSTARFILL= option, CHART statement 1188, GBARLINE procedure 750
COPY= option, TDEF statement 1260 1204 GCHART procedure 786
COPY statement CSTARS= option, CHART statement 1188, GCONTOUR procedure 888
custom device entry, creating (example) 936 1208 GFONT procedure 946
GDEVICE procedure 924 CSYMBOL= graphics option 207, 275 GKEYMAP procedure 989
GREPLAY procedure 1251 CT=, GFONT procedure 944 GMAP procedure 1001, 1007
copying CTEXT= macro argument 553 GPLOT procedure 1089
catalog entries 1251, 1263 CTEXT= option GPROJECT procedure 1168
color maps 1248 BAR statement 755 GRADAR procedure 1185
numbers of print copies 298 BLOCK statement, GCHART procedure 789 GREDUCE procedure 1216
templates 1258 BLOCK statement, GMAP procedure 1013 GREMOVE procedure 1226
country formats for maps 1035 BUBBLE statement 1094 data sets 29
COUTLINE= macro argument, DS2CSF CHART statement, GRADAR procedure 1189 contour plots, input for 887
macro 562 CHORO statement 1019 DSGI data sets 1358
COUTLINE= option GFONT procedure 944 font data sets 951, 952, 958
BAR statement 754 GPRINT procedure 1149, 1153 generating for radar/star charts (exam-
BLOCK statement, GCHART procedure 789 HBAR and VBAR statements 728, 801 ple) 1196
BLOCK statement, GMAP procedure 1012 PIE and DONUT statements 821 GKEYMAP data sets 987
CHORO statement 1019 PLOT statement, G3D procedure 1302 kern data sets 949, 958, 959
HBAR and VBAR statements 800 PLOT statement, GCONTOUR procedure 893 locking, automatic 31
patterns 180 PLOT statement, GPLOT procedure 1106 space data sets 960
Index 1567
three-dimensional graphs 1298 TREPLAY statement, GREPLAY proce- device maps 983
DATA step 27 dure 1263 asymmetrical 986
Annotate data sets 600 DES option, BAR statement 755 basics of 986
data tips in Web presentations 568 DESCENDING option creating and using 990
data values, formatting 413 BAR statement 755 GKEYMAP data sets 987
DATAFILE= option, MAPIMPORT proce- BY statement 142, 1227 GKEYMAP data sets, generating 990
dure 1349 HBAR and VBAR statements 802 specifying 280
DATASYS option, GANNO procedure 708, 710 PIE and DONUT statements 821 DEVICE option, ? statement 1246
DATATIPHIGHLIGHTCOLOR= parameter, PLOT statement 766 DEVICE= option, GKEYMAP procedure 989
Metaview Applet 475 DESCRIPTION= option device parameters 42, 261
DATATIPSTYLE= parameter, Metaview Ap- BAR statement 755 complete list of, alphabetical 262
plet 475 BLOCK statement, GCHART procedure 789 modifying 45
DATATYPE= macro argument 538 BLOCK statement, GMAP procedure 1013 DEVICE statement, GREPLAY procedure 1251
date-time information BUBBLE statement 1094 devices
as axis values, ordering 131 CHART statement, GRADAR procedure 1189 capabilities of, listing 281
ordering axis tick marks (example) 226 CHORO statement 1019 colors list, default 94
%DCLANNO macro, Annotate facility 683 GANNO procedure 709 external dimensions, display 34
DDLEVEL# applet parameter 405 GDEVICE procedure 279 hardware patterns 176, 181
DDLEVEL= parameter, JAVA and ActiveX 428 GPRINT procedure 1149 how output is written to 306
DEBUG function, Annotate facility 620 GSLIDE procedure 1280 identifying type of 283
debugging HBAR and VBAR statements 802 location of, for output 279
Annotate facility 604 ODS statements 496 model numbers 324
DSGI programs 1360 PIE and DONUT statements 822 nicknames for 299
DEF option, TDEF statement 1260 PLOT statement, G3D procedure 1303 portability between 40
DEFAULTTARGET= graphics option 476 PLOT statement, GCONTOUR procedure 893 sending strings to 301, 303
DEFINE STYLE statement, TEMPLATE proce- PLOT statement, GPLOT procedure 1107 specifying type of 358
dure 489
PRISM statement 1025 user input, enabling 360
DEG option, GPROJECT procedure 1169
SCATTER statement, G3D procedure 1307 DEVMAP= graphics option 280, 986
DEGREE option, GPROJECT procedure 1169
STAR statement 836 DEVMAP= option, GDEVICE procedure 280
DEL option, TDEF statement 1260
SURFACE statement 1032 DEVMAP option, GKEYMAP procedure 989
delay between displayed graphs 278, 310
descriptions of catalog entries 55 DEVOPTS= option, GDEVICE procedure 281
DELAY= graphics option 459
destinations, ODS 489 DEVTYPE= option, GDEVICE procedure 283
DELETE function (DSGI) 1459
DETAIL= option, PIE and DONUT state- diagnostic messages, Annotate facility 699
DELETE option, TDEF statement 1260
ments 822, 883 diagrams, CSF
DELETE statement, GDEVICE procedure 925
DETAIL_= options, PIE and DONUT state- drill-down functionality 573
DELETE statement, GREPLAY procedure 1251
ments 822, 883 DS2CSF macro 527, 528
deleting
DEV option, ? statement 1246 hotspots 532
blanks from data values 414
DEVADDR= GOPTIONS statement 279 sample diagrams 530
catalog entries 1251
device catalogs 916, 917 direct display 50
color maps 1250
device drivers 41 DIRECT= parameter, JAVA and ActiveX 428
graphics output, after display 285, 287
assigning 43 DIRECTORY window (GDEVICE) 929
polygon overlap 331, 335
replacing/overwriting files 70 comparisons between 440 DIRECTORY window (GREPLAY) 1265
templates 1262 controlling output with 45 DISABLE DRILLDOWN applet parameter 414
density values, map data sets 1218 entries and catalogs 916 disabling drill-down functionality 414
DENSITY variable (map data sets) 1039, 1213 Listing available 44 DISCRETE option
DEPTH= macro argument 547, 563 managing colors list of (example) 1292 BAR statement 743, 756
DES= option selecting 43 BLOCK statement, GCHART procedure 790
BLOCK statement, GCHART procedure 789 Web output 369 BLOCK statement, GMAP procedure 1013
BLOCK statement, GMAP procedure 1013 device drivers, specifying 1251 CHORO statement 1019
BUBBLE statement 1094 device entries 42, 916 GCHART procedure statements 780
CDEF statement, GREPLAY procedure 1249 browsing contents of 44 HBAR and VBAR statements 728, 802
CHART statement, GRADAR procedure 1189 creating or modifying 72, 934 PIE and DONUT statements 823
CHORO statement 1019 custom, creating (example) 936 PRISM statement 1026
GANNO procedure 709 transporting 58 STAR statement 836
GPRINT procedure 1149 DEVICE function (DSGI) 1411, 1468 discrete variables
GSLIDE procedure 1280 device-generated graphics bar variables 742, 743
HBAR and VBAR statements 802 circles and arcs 271 chart variables 779, 780
PIE and DONUT statements 822 dashed lines 277 charting in star chart (example) 881
PLOT statement, G3D procedure 1303 line thickness 323 map variables 1004
PLOT statement, GCONTOUR procedure 893 pie filling 334 DISPLAY environment variable, batch mode 32
PLOT statement, GPLOT procedure 1107 plot symbols 354 display size (lines) 308
PRISM statement 1025 polygon-fill 336 DISPLAY statement 284
SCATTER statement, G3D procedure 1307 rectangle-fill 345 displaying fonts 940, 943
STAR statement 836 vertices, maximum drawn 324 DISPOSAL= graphics option 459
SURFACE statement 1032 DEVICE= graphics option 52, 72, 280 DISPOSAL statement 285
TDEF statement, GREPLAY procedure 1260 static graphics 439 DOCTYPE= macro argument 553
1568 Index
documentation, SAS/GRAPH DRILURL= macro argument, DS2CSF GSET functions, list of 1462
online help, locations for 385 macro 563 how to use 1357
donut charts 6 DRILURL= option 573 images, displaying 119
basics 776 driver modules 325 inserting graphs into DSGI output 1379
labels 829 driver termination 286 operating states 1359, 1370, 1402
slice labels and formatting 830 drivers, initializing 285 processing statements in loops 1380
statistic and group headings 827, 832 drop shadows, legends 153, 163 return codes, list of 1501
subgrouping in (example) 848 DRVINIT1= and DRVINIT2= options, GDEVICE syntax 1355
terms used with 778 procedure 285 utility functions, list of 1402
DONUT statement, GCHART procedure DRVINIT1= and DRVINIT2= options, GOP- viewports and windows 1376, 1385
ActiveX and Java support for 1521 TIONS statement 285 DUPCHECK= macro argument 547
subgrouping in pie or donut chart (exam- DRVQRY= option, GDEVICE procedure, execut- duplex printing 265, 287
ple) 848 ing before driver initialization 286 DUPLICATEVALUES= parameter, JAVA 429
syntax and options 818 DRVTERM1= and DRVTERM2= options, GDE- DUPOK option, GPROJECT procedure 1168
DONUTPCT= option, DONUT statement 823 VICE procedure 286
DOWN= option DRVTERM1= and DRVTERM2= options, GOP-
CHART statement, GRADAR procedure 1190 TIONS statement 286
LEGEND statement options 153 DS2CONST macro 383, 515
E
PIE and DONUT statements 823 arguments of 518, 535 E1=, ..., E5= options, GREDUCE proce-
STAR statement 837 arguments of, character transcoding 561 dure 1216
DOWNVAR= option, CHART statement 1190 arguments of, data definition 537 EAST option, GPROJECT procedure 1169
DRAW function, Annotate facility 620, 1539 arguments of, diagram appearance 545 EASTLONG option, GPROJECT proce-
%DRAW macro, Annotate facility 683 arguments of, file generation 544 dure 1169
DRAW= option, TITLE, FOOTNOTE, and NOTE arguments of, page formatting 552 EBCDIC-to-ASCII translation 358
statements 217 arguments of, titles and footnotes format- editable output 296
DRAW2TXT function, Annotate facility 622, ting 556 editing
1540 chart with simple arcs (example) 518 device entries 72
%DRAW2TXT macro, Annotate facility 684 chart with weighted arcs (example) 520 graphics output 55
DRAWIMAGE= parameter, JAVA 428 enhancing presentations for 517 Electronic font 87
drawing areas, Annotate graphics 596 hotspots 524 ELLARC function (DSGI) 1449
DRAWMISSING= parameter, JAVA 428 stylesheets, macro arguments for 554 ELLIPSE function (DSGI) 1450
DRAWSIDES= parameter, JAVA 428 XML written to external file (example) 522 ellipses, drawing with DSGI 1449, 1450
drill-down functionality 571 DS2CSF macro 383 EMPTY variable, Annotate facility 662
Annotate facility for 500 arguments of 530, 535 ENCODE= macro argument 553
Annotate graphics in drill-down graphs (exam- arguments of, character transcoding 561 engines 31
ple) 719 arguments of, data definition 561 enhancement variables in Web presentations 574
bar charts with (example) 255, 856 arguments of, diagram appearance 562 Enterprise Guide 2.0 395
choropleth map (example) 1054 arguments of, page formatting 552 equal-area map (Albers__##APOSTROPHE##__)
constellation charts 524 arguments of, titles and footnotes format- projections 1165
creating plots with (example) 1141 ting 556 clipping map areas (example) 1178
critical success factor diagrams 532 drill-down functionality 573 default projection specifications, using (exam-
generating drill-down graphs using DSGI (ex- enhancing presentations for 529 ple) 1174
ample) 1395 hotspots 532 projection criteria 1172
GIF output hotspots (example) 452 sample diagrams 530 when to use 1172
treeview diagrams 510 stylesheets, macro arguments for 554 ERASE= graphics option 287
drill-down links DS2TREE macro 383 ERASE= option, GDEVICE procedure 287
ActiveX 392 arguments of 507, 535 erasing
disabling 414 arguments of, character transcoding 561 blanks from data values 414
Java applets 400 arguments of, data definition 537 graphics output, after display 285, 287
levels for, customizing 405 arguments of, diagram appearance 545 replacing/overwriting files 70
drill-down tags 411, 412 arguments of, file generation 544 ERRORBAR= option
DRILLDOWN= parameter, JAVA and Ac- arguments of, page formatting 552 BAR statement 756
tiveX 428 arguments of, titles and footnotes format- HBAR and VBAR statements 803
DRILLDOWNMODE applet parameter 401, ting 556 horizontal bar charts (example) 854
408 enhancing presentations for 506 errors, sizing 40
DRILLDOWNMODE parameter 571 stylesheets, macro arguments for 554 errors and error messages, Annotate facility 699
DRILLDOWNMODE= parameter, JAVA and Ac- DSGI (DATA Step Graphics Interface) 15, ESRI files, importing as map data sets 1347,
tiveX 429 1354, 1401 1348
DRILLFUNC= parameter, JAVA and Ac- Annotate facility vs. 1354 examples 1349
tiveX 428 attributes for graphics elements 1368, 1373 example programs 21
DRILLPATTERN= parameter, JAVA and Ac- creating simple graphics 1367 examples 19
tiveX 429 examples of using 1381 EXCLUDE statement, MAPIMPORT proce-
DRILLTARGET applet parameter 410, 413 functions and routines 1360 dure 1349
DRILLTARGET= parameter, JAVA and Ac- GASK routines 1394, 1404 executable driver modules 325
tiveX 429 GDRAW functions, list of 1446 executable module 42
DRILTARG= macro argument 547, 563 global statements with 1358 EXPLODE= option, PIE and DONUT state-
DRILTARG= option 573 GRAPH functions, list of 1457 ments 823
Index 1569
exporting graphics output 59 files, converting text to graphics output 1147 full names for 80
interactively 62 adjusting character size in output (exam- GFONT0 library 941
modified device entries for 72 ple) 1156 GPRINT procedure and 1152
program statements for 62 adjusting output size 1150 graphics output text 294
exporting output interactively 62 external text files, about 1148 Java and 400
EXTENSION= graphics option 288 fonts 1152 kern data sets 949, 958, 959
external dimensions, device 34 specifying color text in output (exam- legend label 153
external files 1148 ple) 1153 legend text 158
file extensions for 288 syntax and options, GPRINT procedure 1149 legend values 157
names for 63 FILETYPE= option, GIMPORT procedure 973 listing available 76
replacing 70 FILINDEX function (DSGI) 1413, 1470 listing available characters 987
external files, converting text to graphics out- filing images 114 mapping 972
put 1147 FILL function (DSGI) 1451 maximum and minimum 940
adjusting character size in output (exam- FILL= graphics option 292 open at one time 290
ple) 1156 FILL= option plot point label 197
adjusting output size 1150 PIE and DONUT statements 823 plot symbols 186
external text files, about 1148 STAR statement 837 rendering 82, 289, 295, 346, 3
fonts 1152 FILL= option, GDEVICE procedure 292 rendering, data library for 347
specifying color text in output (exam- filled fonts 941 resolution 293
ple) 1153 FILLED option, GFONT procedure 949 scaling in graphics output 274, 350, 351
syntax and options, GPRINT procedure 1149 FILLINC= graphics option 292 space data sets 960
FILLINC= option, GDEVICE procedure 292 specifications for 76
FILLPOLYGONEDGES= parameters, JAVA and substituting for imported CGMs 974
ActiveX 430 text in graphics output 217
F FILREP function (DSGI) 1470 titles and footnotes 295, 493
FILSTYLE function (DSGI) 1415, 1472 transporting 58
F option
FILTYPE function (DSGI) 1415, 1471 troubleshooting 583
GFONT procedure 949
FIPS codes 1003, 1033 where stored 77, 82
GOPTIONS procedure 1077
labeling U.S. states in choropleth map (exam- FOOTNOTE element (HTML), macro arguments
AXIS statement options 136
ple) 1061 for 556
LABEL= option, DONUT statement 829
FISHEYE= macro argument 548 FOOTNOTE option, GOPTIONS proce-
LEGEND statement options 158
fixed-length output records 296 dure 1077, 1079
POINTLABEL= specification 197
flow control, device 311 FOOTNOTE statement 27, 123, 210, 224
SYMBOL statement 186
FNTNAME= macro argument 548 ActiveX and Java support for 1517
TITLE, FOOTNOTE, and NOTE state-
FNTSIZE= macro argument 548 BY statement with 145
ments 217
FNTSTYL= macro argument 548 displaying with GOPTIONS procedure (exam-
FACHE= graphics option 290
font data sets 951 ple) 1079
FACTOR= macro argument 548
creating 958 footnotes 211, 224
FASTTEXT= graphics option 288
variables for, list of 952 angle of rotation 213, 219, 222
FBY= graphics option 289 boxes around 215, 216
FONT= option 158
FCLASS= macro argument 556 AXIS statement options 136 colors for 215, 216, 276
FCOLOR= macro argument 556 CHART statement, GRADAR procedure 1190 default characteristics, setting 225
feature tables 1001 LABEL= option, DONUT statement 829 defining text of 222, 226
creating maps using (example) 1069 POINTLABEL= specification 197 fonts for 217
merging map data sets with 1001, 1069 SYMBOL statement 186, 904 hyperlinks for 220
FFACE= macro argument 556 TITLE, FOOTNOTE, and NOTE state- justification 218
FILCOLOR function (DSGI) 1412, 1469 ments 217 ODS output 492, 493
FILE= argument, ODS HTML statement 165 FONT= specification 76 positioning 39, 221
file extensions 288 FONTLIST command 76 size of 218, 316
file specifications for data sets 30 FONTRES= graphics option 293 spacing around 221
FILECLOSE= graphics option 290 fonts 75 text breaks 225
FILECLOSE= option, GDEVICE procedure 290 ActiveX and 392 underlining 223
filename extensions 63 axis labels 127, 133, 136 footnotes macro, arguments for 556
FILENAME statement 444 axis values 136 foreground colors
storing in device entry 314 basics about 940 default, defining 272
FILENAME statements 27, 28 bubble plots 1092 reversing black and white 353
FILEONLY= graphics option 291 BY lines 143, 289 FORMAT= attribute 108, 113
FILEREF= option complete list of 82 FORMAT= option, GDEVICE procedure 294
GIMPORT procedure 973 contour plot labels 903 FORMAT= option, GIMPORT procedure 973
GPRINT procedure 1149 creating and storing 940, 946, 951 FORMAT statement 27
filerefs 970 creating figures for symbols font (exam- formatting
FILEREP function (DSGI) 1413 ple) 964 axis labels 127, 133, 135
files default 77, 78, 268, 270 axis tick marks 129, 139
image file types 106 displaying 940, 943 axis values 135
replacing/overwriting 70 displaying with character codes (exam- BY lines 143
sending strings to 301, 303 ple) 962 contour plot lines and labels 903
storing graphics output as 291 donut chart labels 829 donut chart labels 829
1570 Index
legend label 153 GOPTIONS statement 225, 294 GANNO procedure 601, 707
legend values 157 FTITLE= graphics option 225, 295 Annotate graphics in drill-down graphs (exam-
legends 150 FTRACK= graphics option 295 ple) 719
maps 1035 FUNCTION variable, Annotate facility 595, 646 producing multiple graphs (example) 715
pie and donut chart slice labels 830, 873 functions, Annotate 594, 615 scaling data-dependent output (example) 710
Web output 488 FWIDTH= option, LEGEND statement op- scaling graphs with DATASYS option 710
FR option tions 153 storing Annotate graphics (example) 713
BAR statement 757 syntax and options 708
BUBBLE statement 1095 Web output, generating 500
HBAR and VBAR statements 804 GAREABAR procedure 725
PLOT statement, GPLOT procedure 1108 G ActiveX and Java support for 1518
FRAME= argument, ODS HTML statement 166 G_ COLOR= parameters, JAVA and Ac- chart with numeric category variable (exam-
FRAME function, Annotate facility 1540 tiveX 430 ple) 731
frame. legend 153 chart with subgrouping and variable percent-
G_ COLORV= parameters, JAVA and Ac-
%FRAME macro, Annotate facility 684 ages (example) 735
tiveX 430
FRAME option chart with subgrouping (example) 733
G_ DEP= parameters, JAVA and ActiveX 430
BAR statement 757 simple area bar chart (example) 729
G_ DEPTH= parameters, JAVA and Ac-
BUBBLE statement 1095 syntax and options 727
tiveX 430
CHART statement, GRADAR procedure 1190 GASK routines
G_ DEPTHV= parameters, JAVA and Ac-
GSLIDE procedure 1280 DSGI 1394
tiveX 430
HBAR and VBAR statements 728, 804 list of, reference 1404
G_ DEPV= parameters, JAVA and ActiveX 430
PLOT statement, GPLOT procedure 1108 GAXIS= option, HBAR and VBAR state-
FRAME= option, LEGEND statement op- G_ GROUP= parameters, JAVA and Ac- ments 805
tions 153 tiveX 431 GBARLINE procedure 739, 796
FRAME= option, ODS statements 498 G_ GROUPV= parameters, JAVA and Ac- ActiveX and Java support for 1519
frames tiveX 431 BAR statement 751
backplane images 115 G_ INDEP= parameters, JAVA and ActiveX 431 basic graph with styles (example) 768
images on 115, 806, 1096, 1110 G_ INDEPV= parameters, JAVA and Ac- interpolation methods 740
ODS output 497 tiveX 431 missing values 747
frames, drawing 1281 G_ LABEL= parameters, JAVA and Ac- patterns and outlines 748
FREQ and FREQ= options tiveX 431 PLOT statement 765
BAR statement 757 G_ LABELV= parameters, JAVA and Ac- SYMBOL statement 768
BLOCK statement 790 tiveX 431 syntax and options 749
CHART statement, GRADAR procedure 1190 G_ SUBGR= parameters, JAVA and Ac- V6COMP graphics option 749
GCHART procedure statements 783 tiveX 431 weighted statistics, calculating (example) 770
HBAR and VBAR statements 804, 805 G100 option GCHART procedure 785
PIE and DONUT statements 823 BLOCK statement 790 ActiveX and Java support for 1521
PLOT statement 746, 766 HBAR and VBAR statements 805 bar chart with sum statistic (example) 846
STAR statement 837 G3D procedure 1295 block chart with sum statistic (example) 842
weighted statistics, bar line chart (exam- ActiveX and Java support for 1537 BLOCK statement 787
ple) 770 generating default surface plot (exam- BY-group processing with (example) 240
FREQLABEL= option, HBAR and VBAR state- ple) 1314 BY statement 144
ments 804 generating simple scatter plot (example) 1318 discrete numeric variables, in star chart (exam-
FREQNAME= parameters, JAVA and Ac- input data sets 1298 ple) 881
tiveX 430 PLOT statement 1301 DONUT statement 818
frequency statistic 745, 782 rotating scatter plot (example) 1323 drill-down functionality in bar chart (exam-
frequency variable, specifying rotating surface plot (example) 1316 ple) 856
BAR statement 757 SCATTER statement 1305 DSGI viewport with (example) 1385
BLOCK statement 790 error bars in horizontal bar chart (exam-
shapes in (example) 1320
CHART statement, GRADAR procedure 1190 ple) 854
syntax and options 1300
GCHART procedure statements 783 grouping and subgrouping in block chart (ex-
tilting surface plots (example) 1317
HBAR and VBAR statements 804, 805 ample) 844
G3GRID procedure 887, 1327
PIE and DONUT statements 823 HBAR and VBAR statements 796
controlling observations in output data
PLOT statement 746, 766 legends for pie chart patterns and midpoints
set 1336
STAR statement 837 (example) 875
weighted statistics, bar line chart (exam- GRID statement, G3GRID procedure 1333 midpoints and statistics in horizontal bar chart
ple) 770 interpolation methods 1329 (example) 851
FROM variable (GKEYMAP data set) 987 simple contour plot, generating (example) 905 missing values 779
FRONTREF option spline interpolation, partial (example) 1342 PATTERN statement 169
BAR statement 758 spline interpolation, with smoothed spline (ex- patterns 171
HBAR and VBAR statements 805 ample) 1339 patterns and outlines 174, 784
FS option, GREPLAY procedure 1244 spline interpolation (example) 1343 pie and donut chart slice labels (example) 873
FS statement, GDEVICE procedure 925 syntax and options 1332 PIE and PIE3D statements 818
FS statement, GREPLAY procedure 1252 using default interpolation method (exam- pie chart with sum statistic (example) 842
FSIZE= macro argument 556 ple) 1337 star chart with sum statistic (example) 879
FTEXT= option GACCESS= graphics option 72, 296 STAR statement 833
GIMPORT procedure 972 GACCESS= option, GDEVICE procedure 296 subgroup labels (example) 607
Index 1571
subgrouping in pie or donut chart (exam- GFOOTNOTE= option, ODS HTML state- projection criteria 1172
ple) 848 ment 492 when to use 1172
subgrouping in vertical bar chart (exam- GFORMS= graphics option 302 GOPTIONS procedure 1075
ple) 848 GIF device driver 382 displaying graphics options without descrip-
syntax and options 785, 888 ACTXIMG, JAVAIMG vs. 440 tions (example) 1079
V6COMP graphics option 785 data tips for 568 displaying TITLE and FOOTNOTE statements
GCLASS= graphics option 298 developing web presentations 443 (example) 1079
Gcolors window (GDEVICE) 931 drill-down links in images 571 syntax and options 1077
GCONTOUR procedure 885 HTML files, generating 445 using with GOPTIONS statement 1075
ActiveX and Java support for 1526 names for image output files 445 GOPTIONS statement 27, 123, 146, 261, 2
AXIS statement 886 GIF output ActiveX and Java support for 1510
contour levels, specifying (example) 908 generating with ODS (example) 450 resetting options 348
missing values 887, 889 hyperlinks in (example) 452 testing with GTESTIT procedure (exam-
PATTERN statement 169 GIF presentations 377 ple) 1291
patterns 173 GIFANIM device driver 378, 457 using with GOPTIONS procedure 1075
patterns and joins in contour plots (exam- graphics options for presentations 459 GOUT= option
ple) 910 sample programs 459, 463 GANNO procedure 709
PLOT statement 889 GIMPORT procedure 969 GCHART procedure 786
simple contour plot, generating (example) 904 adjusting graphics output (example) 979 GCONTOUR procedure 888
spline interpolation (example) 1343 basics of importing graphics 970 GFONT procedure 944
GCOPIES= graphics option 298 creating and importing CGM (example) 977 GIMPORT procedure 974
GCOPIES= option, GDEVICE procedure 298 MAP statement 974 GMAP procedure 1008
GDDM device driver mapping colors 971 GPLOT procedure 1089
device nicknames 299 SCALE statement 975, 979 GPRINT procedure 1149
patterns 181 syntax and options 973 GRADAR procedure 1185
writing ADMGDF or GDF files 262 TRANSLATE statement 976, 979 GREPLAY procedure 1244
GDDMCOPY= graphics option 299 GINIT function (DSGI) 1402 GSLIDE procedure 1280
GDDMTOKEN= graphics option 299 GKEYMAP data sets 987, 990 GTESTIT procedure 1290
GDEST= graphics option 300 GKEYMAP procedure 983 PROC statement 54
GDEVICE procedure 42, 916 asymmetrical maps 986 GOUT option, ? statement 1246
ADD statement 921 creating maps 990 GOUT statement, GREPLAY procedure 1252
COPY statement 924 modifying keymaps (example) 990 GOUTMODE= graphics option 302
creating or modifying device entries 934 syntax and options 989 GPLOT procedure 169, 1081
custom device entry, creating (example) 936 global statements 14, 27, 33, 123, 135 ActiveX and Java support for 1530
default hardware fonts 79 GMAP procedure 169, 996, 1006 adding right vertical axis (example) 1124
DELETE statement 925 ActiveX and Java support for 1527 BUBBLE statement 1090
FS statement 925 assigning formats to response variables (exam- BUBBLE2 statement 1098
LIST statement 926 ple) 1049 BY statement 144
Listing available drivers 44 BLOCK statement 1010 connecting plot data points (example) 1129
MODIFY statement 926 BY statement 144 different scales of values (example) 1138
QUIT statement 927 CHORO statement 1017 filling areas in overlay plot (example) 1134
RENAME statement 928 creating maps using feature tables (exam- generating overlay plot (example) 1131
syntax and options 920 ple) 1069 generating simple bubble plots (exam-
windowing and program modes 917 drill-down functionality in maps (exam- ple) 1121
windowing mode, using 928 ple) 1054 input data set 1086
GDEVICE windows 261 ID statement 1009 labeling and sizing plot bubbles (exam-
GDF files, writing with GDM driver 262 labeling U.S. states in choropleth map (exam- ple) 1122
GDRAW function, DSGI 119, 1446 ple) 1061 PATTERN statement 1120
G_drill-down tags 412 midpoints in prism map, specifying (exam- plot basics 1085
GEND= graphics option 300 ple) 1065 PLOT statement 1101, 1117
GEND= option, GDEVICE procedure 300 PRISM statement 1023 PLOT2 statement 1115
Gend window (GDEVICE) 933 projecting an Annotate data set (exam- plots with drill-down for Web (example) 1141
$GEOREF format 1001 ple) 1180 plotting three variables (example) 1135
Gepilog field, device entries 336, 338, 339 response levels 1004 plotting two variables (example) 1126
GEPILOG= graphics option 301 response levels in block map, specifying (ex- scaling graphs with DSGI windows (exam-
GEPILOG= option, GDEVICE procedure 301 ample) 1047 ple) 1388
Gepilog window (GDEVICE) 933 rotating and tilting surface map (exam- SYMBOL statement 204, 1114, 1120
Geprolog field, device entries 337 ple) 1068 syntax and options 1088
GFONT procedure 939 simple block map (example) 1045 GPRINT function (DSGI) 1403
creating figures for symbols font (exam- simple choropleth map (example) 1053 GPRINT procedure 1147
ple) 964 simple prism map (example) 1063 adjusting character size in output (exam-
creating fonts 940, 946, 951 simple surface map (example) 1066 ple) 1156
displaying fonts 940, 943 specialty map data sets 1003 adjusting output size 1150
displaying fonts and character codes (exam- SURFACE statement 1030 external text files, about 1148
ple) 962 syntax and options 1007 fonts 1152
syntax and options 942 gnomonic projections 1167 specifying color text in output (exam-
GFONT0 library 941 emphasizing map areas (example) 1177 ple) 1153
1572 Index
syntax and options 1149 TRANSLATE statement, GIMPORT proce- graphics output, importing 969
GPROJECT procedure 1161 dure 976, 979 adjusting graphics output (example) 979
basic usage 1172 graphics catalogs 53 basics of importing graphics 970
clipping map areas (example) 1178 accessing 53 creating and importing CGM (example) 977
default projection specifications, using (exam- converting 59 MAP statement, GIMPORT procedure 974
ple) 1174 duplicate entry names 1240 mapping colors 971
emphasizing map areas (example) 1177 listing and managing entries 55 SCALE statement 979
ID statement 1172 replacing 70 SCALE statement, GIMPORT procedure 975
input map data sets 1163 specifying/assigning 1252, 1253 syntax and options 973
projecting an Annotate data set (exam- graphics editor 55 TRANSLATE statement, GIMPORT proce-
ple) 1180 Graphics Editor window, printing from 52 dure 976, 979
syntax and options 1168 graphics elements, creating DSGI 119, 1446 graphics output area 34
types of map projections 1165 graphics files, saving and printing 51 Annotate facility 598
GPROLOG= graphics option 303 graphics options 14, 146, 261 border around 266
GPROLOG= option, GDEVICE procedure 303 animations, configuring 459 columns in 36, 274, 322, 332
Gprolog window (GDEVICE) 932 complete list of, alphabetical 262 maximum colors allowed 93, 324
GPROTOCOL= graphics option 303 displaying without description (exam- multiple device output 40
GPROTOCOL= option, GDEVICE proce- ple) 1079 offset between graphs and 314, 360
dure 303 ODS output with 493 rows in 3, 36, 323, 344, 350,
GRADAR procedure 1183 overriding device parameters 46 size of 316, 361, 363, 364,
ActiveX and Java support for 1535 resetting 348 graphics output names 63
assigning axis definitions to axis spokes (exam- graphics output 34, 48, 584 graphics output text
ple) 1210 adjusting character size in output (exam- colors for 276
changing star type in radar charts (exam- ple) 1156 fonts 294
ple) 1207 Annotate data sets 601 size of 316
CHART statement 1185 Annotate graphics with 601 GRAPHLIST function (DSGI) 1416
color and line styles in radar charts (exam- appending strings to records 300 GRAPHRC= graphics option 305
ple) 1208 appending to or replacing catalogs 302 graphs 4
filling stars in radar charts (example) 1204 background images 318
background images 318, 319
box plots 185, 187, 201, 233
generating data set for (example) 1196 body files 491
BY lines 143
images in radar charts (example) 1205 controlling with device drivers 45
client vs. server rendering 584
multiple classification variables in radar charts default destinations for 291
creating interactively 395
(example) 1202 destination for 307
displaying in timed series 310
overlaying radar charts (example) 1199 display size, in lines 308
enhancing with DSGI 1356
producing basic radar chart (example) 1198 displaying 49
positioning 39
specifying mode for radar charts (exam- displaying images in 319
redrawing (overdrawing) 348
ple) 1209 editing 55
saving to files 66, 68
syntax and options 1184 erasing after display 285, 287
suppressing display of 284
tiling radar charts (example) 1201 exporting 59, 62
gray scale color scheme 96, 99
GRADIENTBACKGROUND= parameters, JAVA file formats 60 GREDUCE procedure 1039, 1213
and ActiveX 431 generating for ActiveX 391 ID statement 1218
GRADIENTENDCOLOR= parameters, JAVA and generating output for Java 398 reducing map of Canada (example) 1220
ActiveX 431 how written, specifying 306 specifying density levels 1218
GRADIENTSTARTCOLOR= parameters, JAVA positioning 39 syntax and options 1216
and ActiveX 431 prefixing records 309 unmatched area boundaries 1215
Graph applet 372 previewing as if on different device 52, 356 GREMOVE procedure 1223
disabling drill-down functionality 414 protocol module, specifying 303 BY statement 1227
drill-down tags 412 queuing for log messages 345 ID statement 1228
Local drill-down example 415 relaying graphics output in templates 1272 outline map of Africa, creating (exam-
Local drill-down mode 400, 401, 402, 405,, replaying in templates 1270 ple) 1232
parameters for, list of 424 resizing 975 removing U.S. state boundaries (exam-
Script drill-down example 416 reversing black and white 353 ple) 1228
GRAPH functions, DSGI 1456 size 1150 syntax and options 1226
Graph-N-Go 15 specifying color text in output (exam- GREPLAY procedure 55, 1238
GRAPH window 49, 62 ple) 1153 catalog entries, about 1239
printing from 52 suppressing display of 284 creating templates and color maps 1268,
size of 50 transporting and converting 56 1270, 1274
graphics, importing 969 graphics output, converting text files to 1147 device color limitations 105
adjusting graphics output (example) 979 adjusting character size in output (exam- how to use 1241
basics of importing graphics 970 ple) 1156 managing catalog entries 1267
creating and importing CGM (example) 977 adjusting output size 1150 relaying graphics output in templates 1270,
MAP statement, GIMPORT procedure 974 external text files, about 1148 1272
mapping colors 971 fonts 1152 replaying catalog entries 1268
SCALE statement 979 specifying color text in output (exam- switching between line more and procedure
SCALE statement, GIMPORT procedure 975 ple) 1153 windows 1252
syntax and options 973 syntax and options, GPRINT procedure 1149 syntax and options 1243
Index 1573
before graph production 339 hyperlinks displaying with Annotate facility 118
Host Commands window (GDEVICE) 934 drill-down, ActiveX 392 displaying with DSGI 119, 1452
Host File Options window (GDEVICE) 933 drill-down, Java 400 file types, list of 106
HOSTSPEC= option, GDEVICE procedure 314 GIF output hotspots (example) 452 in star charts (example) 1205
HPLJxxxx drives, patterns 181 tables of contents 495 in text slides 1281
HPOS function (DSGI) 1417, 1474 tables of pages 496 interlacing 320
HPOS= graphics option 36, 315, 1151 titles and footnotes as 220 on chart bars 116
aspect ratio 1152 HZERO option reading 107
HREF attribute 259 BUBBLE statement 1096 transparent 357
HREF= option PLOT statement, GPLOT procedure 1110 writing 107, 110
BUBBLE statement 1095 IMAGESTYLE= graphics option 114, 319
PLOT statement, GCONTOUR procedure 894 IMAGESTYLE= option
BUBBLE statement 1096
PLOT statement, GPLOT procedure 1109 I CHART statement, GRADAR proce-
HREVERSE option
BUBBLE statement 1096 I= option, SYMBOL statement 187 dure 1191, 1205
PLOT statement, GCONTOUR procedure 894 IBACK= graphics option 113, 318 GSLIDE procedure 1280
PLOT statement, GPLOT procedure 1029 images in radar charts (example) 1205 HBAR and VBAR statements 806
HSIZE device parameter 35 IBACKLOG= macro argument 548 PATTERN statement 171
HSIZE function (DSGI) 1418, 1475 IBACKPOS= macro argument 548 PLOT statement, GPLOT procedure 1110
HSIZE= graphics option 35, 316, 1150 IBACKURL= macro argument 549 IMGPATH variable, Annotate facility 652, 662
HSIZE= option, GDEVICE procedure 316 IBACKX=, IVBACKY= macro arguments 549 importing graphics 969
%HSL macro 101 IBM printers adjusting graphics output (example) 979
HSPACE 537 external writes with 311 basics of 970
HSV color scheme 96, 98 JES form name 302 creating and importing CGM (example) 977
%HSV macro 102 JES SYSOUT destination 300 mapping colors 971
HSYS variable, Annotate facility 650 output class 297 resizing graphics 975
ID= option, GDEVICE procedure 318 INBORDER option, CHART statement 1191
HTEXT= graphics option 316
ID statement INCOMPLETE option, GCONTOUR proce-
HTITLE= graphics option 225, 317
GMAP procedure 1009, 1527 dure 887, 889
HTML character entities 582
GPROJECT procedure 1172 INDICTYP= macro argument, DS2CSF
HTML destination, ODS 489
GREDUCE procedure 1218 macro 563
HTML drill-down mode, Java 401, 410, 419,
GREMOVE procedure 1228 INHEIGHT= option, CHART statement 1191
572
identification variables 1005 initializing drivers, executing before 285
HTML files, creating with ODS HTML (exam-
IFRAME= option 115 input (user), enabling 360
ple) 245
BUBBLE statement 1096 INSERT function (DSGI) 1460
HTML function (DSGI) 1419, 1476
CHART statement, GRADAR procedure 1190 INSIDE= option
HTML= option
GSLIDE procedure 1280 BAR statement 758
BAR statement 758
HBAR and VBAR statements 806 HBAR and VBAR statements 807
BLOCK statement, GCHART procedure 791
PLOT statement, GPLOT procedure 1110 installation of SAS/GRAPH software, test-
BLOCK statement, GMAP procedure 1013
IGOUT option ing 1285
CHART statement, GRADAR procedure 1190
? statement, GREPLAY procedure 1246 managing colors list for device driver (exam-
CHORO statement 1020
LIST statement, GREPLAY procedure 1254 ple) 1291
data tips, adding 570 testing GOPTIONS statement (example) 1291
IGOUT= option, GREPLAY procedure 1244
drop-down links 574 installing ActiveX controls 389
IGOUT statement, GREPLAY procedure 1253
GCHART procedure 259 installing Java plug-in 424
IMAGE function, Annotate facility 1540
HBAR and VBAR statements 806 IMAGE function, DSGI 1452 integer-based font rendering 289
PIE and DONUT statements 824 image maps 259 interactive Metagraphics output 357, 469
PLOT statement 766 IMAGE= option, PATTERN statement 116, 171 character rotation angle 350
PLOT statement, GPLOT procedure 1109 IMAGEMAP= option description string 318
PRISM statement 1026 GANNO procedure 709, 719 enhancing Web presentations for 474
STAR statement 837 GBARLINE procedure 750 hardware text rotation angle 330
HTML pages GCHART procedure 786 interactivity of 320
bar chart with drill-down (example) 255 GMAP procedure 1008 META2HTM macro with 471
combining graphs and reports (example) 248 GPLOT procedure 1089 negative handshaking response 325
HTML variable, Annotate facility 651 GREPLAY procedure 1244 ODS with 470
HTMLFILE= macro argument 544 GSLIDE procedure 1280 run-time controls 471
HTMLFREF= macro argument 544, 564 IMAGEPOSX= parameter, JAVA 432 sample programs 478
HTML_LEGEND= option IMAGEPRINT GOPTIONS statement 319 TRAILER records 356
BLOCK statement, GCHART procedure 791 images 106 translating metafile into device com-
BLOCK statement, GMAP procedure 1013 Annotate facility to draw 625 mands 339
CHART statement, GRADAR procedure 1190 as graph background 318, 319 user-written part, files for 340, 341
CHORO statement 1020 as pattern fills 171 INTERACTIVE= option, GDEVICE proce-
drop-down links 574 background 113 dure 320
HBAR and VBAR statements 806 backplane 115 INTERCHART= option, CHART state-
PIE and DONUT statements 824 bar charts 817 ment 1191
PLOT statement, GPLOT procedure 1109 bar line charts 748, 765 interface drivers 42
PRISM statement 1026 disabling as output 319 INTERLACED GDEVICE procedure 321
Index 1575
LAT variable (map data sets) 1000 PLOT statement, GCONTOUR proce- Local drill-down mode, Java 400, 401, 572
latitude coordinates 1164 dure 895, 899, 908 default behavior 402
LATMAX= option, GPROJECT procedure 1169 PRISM statement 1026 example 415
LATMIN= option, GPROJECT procedure 1169 STAR statement 838 levels of, customizing 405
LAUTOHREF= option LFACTOR= graphics option 323 local fonts 78
BUBBLE statement 1096 LFACTOR= option, GDEVICE procedure 323 local statements, RUN-group processing 33
PLOT statement, GCONTOUR procedure 894 LFRAME= option, GSLIDE procedure 1280, LOCALE= parameter, JAVA 433
PLOT statement, GPLOT procedure 1110 1281 locking data sets automatically 31
LAUTOREF= option LFROM= macro argument 539 LODCOUNT= parameter, JAVA 433
BAR statement 758 LH= option log, writing in (DSGI) 1454
HBAR and VBAR statements 807 BUBBLE statement 1096
log messages, waiting to display 345
LAUTOVREF= option PLOT statement, GCONTOUR procedure 895
LOG window, GTESTIT procedure 1289
BUBBLE statement 1096 PLOT statement, GPLOT procedure 1111
logarithmic axes 127, 229
PLOT statement, GCONTOUR procedure 894 LHREF= option
block charts 815
PLOT statement, GPLOT procedure 1110 BUBBLE statement 1096
plots 1087
LAYOUT= macro argument 538 PLOT statement, GCONTOUR procedure 895
LOGBASE= option, AXIS statement 127, 128,
LCOLFMT= macro argument 538 PLOT statement, GPLOT procedure 1111
229
LCOLOR= macro argument 538 LIBNAME statements 28, 29, 30
librefs 30 LOGRESOURCES= graphics option 476
LCOLS device parameter 36, 1151
LCOLS= option, GDEVICE procedure 322 LIFO stack 603, 639 LOGRESOURCES parameter, Metaview Ap-
light source coordinates, prism maps 1028 plet 475
LCOLVAL= macro argument 538
LDATA= macro argument 538 LIGHTING= parameter, JAVA 433 LOGSTYLE= option, TITLE, FOOTNOTE, and
LEFTMARGIN GDEVICE procedure 316 LINCOLOR function (DSGI) 1419, 1477 NOTE statements 229
LEFTMARGIN GOPTIONS statement 316 LINE function (DSGI) 1453 LONG variable (map data sets) 1000
LEGEND and LEGEND= options %LINE macro, Annotate facility 686 longitude coordinates 1164
BLOCK statement, GCHART procedure 791 LINE= option, SYMBOL statement 196, 207 LONGMAX= option, GPROJECT proce-
BLOCK statement, GMAP procedure 1013 line plots 7 dure 1169
CHORO statement 1020 line segments for drawing fonts 941, 956 LONGMIN= option, GPROJECT proce-
GOPTIONS procedure 1078 line smoothing 190 dure 1169
HBAR and VBAR statements 807 language, interpolation 190 looping animation 321
PIE and DONUT statements 825 spline interpolation 194, 205, 1330 LP variable (font data sets) 953
PLOT statement, GCONTOUR procedure 894 spline interpolation, example 1339, 1342, LPT= macro argument 539
PLOT statement, GPLOT procedure 1110 1343 LR= option
PRISM statement 1026 line types BAR statement 758
LEGEND statement 27, 124, 151, 318 axis 134 HBAR and VBAR statements 808
ActiveX and Java support for 1514 default line thickness 323 LREF= option
filling areas in overlay plot (example) 1134 plots 196, 207 BAR statement 758
generating overlay plot (example) 1131 spokes in star charts 1191, 1208 HBAR and VBAR statements 808
legends for patterns and midpoints (exam- LINE variable, Annotate facility 653 LROWS device parameter 36, 1151
ple) 875 lines LROWS= option, GDEVICE procedure 323
LEGENDFONT= parameter, JAVA 432 dashed, hardware-generated 277 LRX= and LRY= options, TDEF statement 1260
LEGENDHEIGHTPERCENT= parameter, dashed, length of 278 LS= option, TITLE, FOOTNOTE, and NOTE
JAVA 432 displaying with DSGI 1453 statements 221
LEGENDIT= parameter, JAVA 432 in graphics output area 217 LSPACE= option, TITLE, FOOTNOTE, and
LEGENDPERCENT= parameter, JAVA 432 testing ability to draw 1286 NOTE statements 221
legends 39 lines, drawing with Annotate facility 622 text break and 225
drop shadows 326 LINESIZE= option 1150, 1151 LSPOKE= option, CHART statement 1191
formatting 150 LININDEX function (DSGI) 1420, 1477 LSTAR= and LSTARS= options, CHART state-
offset 154, 163 LINK element (HTML) 555 ment 1191, 1208
origins 155, 163 LINK= option, TITLE, FOOTNOTE, and NOTE LSTIP= macro argument 539
pie chart patterns and midpoints (exam- statements 220
LSTIPFAC= macro argument 539
ple) 875 link variables in Web presentations 574
LTIP= macro argument 539
plots with three variables 1118 linking to output
LTIPFMT= macro argument 539
spacing around 154, 163 Tables of Contents 495
LTO= macro argument 539
LEGENDWIDTHPERCENT= parameter, Tables of Pages 496
LV= option
JAVA 432 LINKTYPE= macro argument 539
LENGTH= option, AXIS statement options 127 LINREP function (DSGI) 1421, 1478 BUBBLE statement 1096
LEVELOFDETAIL= parameter, JAVA 432 LINTYPE function (DSGI) 1422, 1479 PLOT statement, GCONTOUR procedure 896
LEVELS= option LINWIDTH function (DSGI) 1422, 1480 PLOT statement, GPLOT procedure 1111
BAR statement 758 LIST statement, GDEVICE procedure 926 LVALUE= macro argument 540
BLOCK statement, GCHART procedure 791 LIST statement, GREPLAY procedure 1254 LVREF= option
BLOCK statement, GMAP procedure 1014, listing destination, ODS 489 BUBBLE statement 1096
1047 LLEVELS= option, PLOT statement 895, 903, PLOT statement, GCONTOUR procedure 896
CHORO statement 1020 908 PLOT statement, GPLOT procedure 1111
HBAR and VBAR statements 808 LLX= and LLY= options, TDEF statement 1260 LWHERE= macro argument 540
PIE and DONUT statements 825 LOADFUNC= parameter, JAVA 433 LWIDTH= macro argument 540
Index 1577
midpoints, chart variables 778, 780 multiple classification variables in radar charts ND option, GFONT procedure 949
horizontal bar chart (example) 851 (example) 1202 NDATA= macro argument 541
pie charts (example) 875 Music font 88 NEAR= option, GRID statement 1334
selecting and ordering 781, 816 MWIDTH= option, GFONT procedure 949 needle plots 191
MIDPOINTS= option negative values, block charts 795
BAR statement 759 Netscape colors, troubleshooting 583
BLOCK statement, GCHART procedure 791 NEWFILE= option, ODS HTML statement 492
BLOCK statement, GMAP procedure 1014
N NEWNAME= option, RENAME statement 928
CHORO statement 1021 N= option NFNTNAME= macro argument 541
GCHART procedure statements 782 AXIS statement options 140 NFNTSIZE= macro argument 541
HBAR and VBAR statements 809, 816 GFONT procedure 943, 946 NFNTSTYL= macro argument 541
PIE and DONUT statements 826 SURFACE statement 1032 NID= macro argument 541
PRISM statement 1027 N option, GOPTIONS procedure 1078 NLABEL= macro argument 541
STAR statement 838 N1=, ..., N5= options, GREDUCE proce- NLEVELS= option, PLOT statement 896
MINILEGENDFONTSIZE= parameter, dure 1217 NLINES option, SURFACE statement 1032
JAVA 433 NACTION= macro argument 540 NOADMGDF option 262
minimum, font 940 NAK= option, GDEVICE procedure 325 NOAUTOCOPY option 263
MINLNKWT= macro argument 540 NAME= macro argument 537 NOAUTOFEED option 264
MINOR= option NAME= option 63 NOAXES option
AXIS statement 129, 1509 BLOCK statement, GCHART procedure 792 BUBBLE statement 1097
BAR statement 760 BLOCK statement, GMAP procedure 1015 PLOT statement, G3D procedure 1303
HBAR and VBAR statements 810 BUBBLE statement 1097 PLOT statement, GCONTOUR procedure 897
PLOT statement 767 CHART statement, GRADAR procedure 1192 PLOT statement, GPLOT procedure 1111
minor tick marks 129, 138 CHORO statement 1021 SCATTER statement, G3D procedure 1307
formatting 139 GANNO procedure 709, 715 NOAXIS option
suboptions, list of 1509 GFONT procedure 943, 946 BAR statement 760
with datetime values (example) 226 GKEYMAP procedure 989 BUBBLE statement 1097
MISSING option GPRINT procedure 1149 HBAR and VBAR statements 810
BAR statement 747, 760 GSLIDE procedure 1280 PLOT statement, G3D procedure 1303
BLOCK statement, GCHART procedure 792 HBAR and VBAR statements 729, 810 PLOT statement, GCONTOUR procedure 897
BLOCK statement, GMAP procedure 1015 PIE and DONUT statements 826 PLOT statement, GPLOT procedure 1111
CHART statement, GRADAR procedure 1192 PLOT statement, G3D procedure 1303 SCATTER statement, G3D procedure 1307
CHORO statement 1021 PLOT statement, GCONTOUR procedure 896 NOBASEREF option
GCHART procedure statements 779 PLOT statement, GPLOT procedure 1111 BAR statement 760
HBAR and VBAR statements 810 PRISM statement 1027 HBAR and VBAR statements 810
PIE and DONUT statements 826 SCATTER statement, G3D procedure 1307 NOBOT= option, ODS HTML statement 167
PRISM statement 1027 STAR statement 838 NO_BOTTOM_MATTER= option, ODS HTML
STAR statement 838 SURFACE statement 1032 statement 167
missing values TREPLAY statement, GREPLAY proce- NOBRACKETS option, AXIS statement op-
GBARLINE procedure 747 dure 1263 tions 130
GCHART procedure 779 NAME= parameter, JAVA 434 NOBUILD option, GFONT procedure 944
GCONTOUR procedure 887, 889 names NOBYLINE option, GREPLAY proce-
in Annotate data sets 601 anchors 168 dure 1244, 1256
plot data sets 1087, 1112 Annotate facility 591, 599, 602 NOCC option, GPRINT procedure 1150
star charts 1192 BY line catalog entries 143 NOCELL option 268
MISSINGCOLOR= parameter, JAVA 434 catalog entries 55 NOCHARACTERS option 268
MODE= option colors 95, 99 NOCIRCLEARC option 270
CHART statement, GRADAR proce- data sets 30 NOCOLLATE option 271
dure 1192, 1209 device entries 928 NOCONNECT option, STAR statement 839
LEGEND statement 154, 163 device nicknames 299 NODASH option 277
SYMBOL statement 197 executable driver modules 325 node-link diagrams 373, 503, 513
model number, output device 324 filename extensions 63, 288 chart with simple arcs (example) 518
MODEL= option, GDEVICE procedure 324 fonts 76, 80, 81 chart with weighted arcs (example) 520
MODIFY statement graphics output 63 data tips with 569
custom device entry, creating (example) 936 image output files 445 drill-down functionality 572, 573
GDEVICE procedure 926 macro variables 566 DS2CONST macro with 515
GREPLAY procedure 1254 paper type 330 hotspots 524
MODULE= option, GDEVICE procedure 325 predefined graph styles (ODS) 489 when to use 514
MOVE function, Annotate facility 627, 1541 natural device drivers 42 XML written to external file (example) 522
%MOVE macro, Annotate facility 687 NAVIGATERENDERMODE= parameter, NODEBDR= macro argument 549
MOVE= option, TITLE, FOOTNOTE, and NOTE JAVA 434 NODESEP= macro argument 549
statements 221, 225 NAXIS1= and NAXIS2= options, GRID state- NODESHAP= macro argument 549
MOVE statement, GREPLAY procedure 1255 ment 1334, 1336 NODISPLAY option, GFONT procedure 949
MULTFONT option, GKEYMAP procedure 990 NB option, GFONT procedure 944 NODISPLAY statement 284
multiline NCOL= and NCOLS= options, CHART state- NODRVQRY= option, GDEVICE procedure, exe-
axis values 134 ment 1192 cuting before driver initialization 286
legend labels 159 NCOLVAL= macro argument 541 NOERASE= graphics option 287
Index 1579
NOERASE= option, GDEVICE procedure 287 NOROMHEX option, GFONT procedure 945 OBJECT element (HTML) 421
NOFASTTEXT= graphics option 288 NOSCALE option, GRID statement 1335 observations
NOFILEONLY= graphics option 291 NOSTATS option, HBAR and HBAR3D state- in Annotate data sets 589
NOFILL= graphics option 292 ments 810 ordering for input map data sets 1227
NOFILL= option, GDEVICE procedure 292 NOTE statement 26, 124, 210, 224 ODS destinations 489
NOFR option BY statement with 145 ODS HTML statement 124, 164, 167
BAR statement 757 RUN-group processing 33 bar chart with drill-down (example) 255
BUBBLE statement 1095 notes 211, 224 destination, specifying 168
HBAR and VBAR statements 804 angle of rotation 213, 219, 222 multiple graphs and reports in Web page (ex-
PLOT statement, GPLOT procedure 1108 boxes around 215, 216 ample) 248
NOFRAME option colors for 215, 216, 276 Web page, creating (example) 245
BAR statement 757 default characteristics, setting 225 ODS output 487
BUBBLE statement 1095 defining text of 222, 226 ACTXIMG device driver with (example) 447
CHART statement, GRADAR proce- fonts for 217 body files 491
dure 1190, 1192 justification 218 frames for 497
HBAR and VBAR statements 728, 804 positioning 221 GIF output, generating (example) 450
PLOT statement, GCONTOUR procedure 897 size of 218, 316 graphic options with 493
PLOT statement, GPLOT procedure 1108 spacing around 221 JAVAMETA driver with 470
NOFS option text breaks 225 metacodes (example) 478
GDEVICE procedure 921 underlining 223 non-graphics output on Web pages 494
GREPLAY procedure 1241, 1244 NOTOP= option, ODS HTML statement 167 RUN-group processing 490
NOGFOOTNOTE= option, ODS HTML state- NO_TOP_MATTER= option, ODS HTML state- static graphics 440
ment 492 ment 167 Table of Contents 495
NOGRAPHRC= graphics option 305 NOTRANSPARENCY GOPTIONS state- Tables of Pages 496
NOGROUPHEADING option ment 357 titles and footnotes, controlling 492
PIE and DONUT statements 826, 833 NOTRANSPARENCY= graphics option 459 ODS statements 28
STAR statement 839, 842 NOTSORTED= option, BY statement 142, 1227 generating presentations 382
NOGTITLE= option, ODS HTML state- NOUSERINPUT= graphics option 459 JAVA and ActiveX parameters and at-
ment 492 NOZERO option tributes 421
NOHEADING option BAR statement 760 ODS RTF statement, graphics in Microsoft
BLOCK statement 792 HBAR and VBAR statements 810 Word (example) 393
PIE and DONUT statements 827, 832 NOZEROREF option, CHART statement 1192 ODS USEGOPT statement 493
STAR statement 839, 842 NPARENT= macro argument 542 PARAMETERS= statement for applet parame-
NOHEX option, GFONT procedure 945 NPW= macro argument 542 ters 477
NOIMAGEPRINT GOPTIONS statement 120, NR option, GFONT procedure 945 ODS styles 94, 488
319 NROW= and NROWS= options, CHART state- offset
NOIMAGEPRINT graphics option 120, 319 ment 1193 angle of rotation 222
NOJSOOBJECT= parameter, JAVA 434 NSCBACK= macro argument 542 axes 130
NOKEYMAP option, GFONT procedure 945, NSCTEXT= macro argument 542 between Bitstream font letters 295
949 NSDATA= macro argument 542 between display area and graphic 360
NOLABEL option NSFNTNAM= macro argument 542 between displayed area and graph 314
PLOT statement, G3D procedure 1303 NSFNTSIZ= macro argument 542 between fill lines 292
SCATTER statement, G3D procedure 1307 NSFNTSTY= macro argument 542 between graphs and display 314, 360
NOLEGEND option NSHAPE= macro argument 542 contour plot labels 904
BLOCK statement, GCHART procedure 793 NSID= macro argument 542 fonts 948, 951, 960, 961
BLOCK statement, GMAP procedure 1015 NSIZE= macro argument 543 legend 154, 163
CHORO statement 1022 NSPW= macro argument 543 legends 154, 163
HBAR and VBAR statements 810 NSTYLE= macro argument 543 text in graphics output 216, 221
PIE and DONUT statements 827 NSWHERE= macro argument 543 OFFSET= option
PLOT statement, GCONTOUR procedure 897 NTEXTCOL= macro argument 543 AXIS statement options 130
PLOT statement, GPLOT procedure 1111 NTIP= macro argument 543 LEGEND statement options 154, 163
PRISM statement 1028 NTIPFMT= macro argument 543 OFFSHADOW= graphics option 326
NOLINE option, PLOT statement 767 NUMBER= option, AXIS statement options 140 online help, locations for 385
NOLIST option, GOPTIONS procedure 1078, numeric bar variables 742, 743 open destinations, ODS 489
1079 numeric chart variables 779, 780, 781 OPENGRAPH function (DSGI) 1428
NOLOG option, GOPTIONS procedure 1078 charting in star chart (example) 881 OPENMODE= argument, META2HTM
NOMARKER option, PLOT statement 767 numeric map variables 1004 macro 564
non-roman alphabet fonts 85 NUMGRAPH function (DSGI) 1428 OPENMODE= macro argument 545
NONE font 77 NURL= macro argument 543 OPTION= option, GOPTIONS procedure 1078
NONEEDLE option, SCATTER statement 1308 NVALUE= macro argument 544 OPTIONS statement 28
NONINTERLACED GDEVICE procedure 321 NWHERE= macro argument 544 ORDER= option
NONINTERLACED GOPTIONS statement 321 NX=, NY= macro arguments 544 AXIS statement options 130, 135, 747, 816,
NOPIEFILL GDEVICE procedure 334 LEGEND statement options 155
NOPIEFILL GOPTIONS statement 334 ORDERACROSS= option, CHART state-
NOPLANE option, AXIS statement options 130 O ment 1193
NOPROMPT= graphics option 50, 310 ordering
NOROMAN option, GFONT procedure 945 O option, GPRINT procedure 1150 axis values 130
1580 Index
slice colors and patterns 831 PLOT2 statement, GPLOT procedure 1115 polygon-fill capability, device 336
slice labels and formatting 830, 873 ActiveX and Java support for 1530 polygon fonts 941
statistic and group headings 827, 832 different scales of values (example) 1138 POLYGONCLIP= graphics option 335
subgrouping in (example) 848 matching PLOT statements 1117 POLYGONFILL= graphics option 336
sum statistic, specifying (example) 842 plots POLYGONFILL= option, GDEVICE proce-
terms used with 778 basics of 1085 dure 336
pie-fill capability, device 334 box plots 185, 187, 201, 233 polygons
PIE function, Annotate facility classification variables with 1083 clipped (intersecting) 331, 335
ActiveX and Java support for 1542 connecting plot data points (example) 1129 drawing with Annotate facility 634
pie slices, drawing with Annotation facil- different scales of values in (example) 1138 drawing with DSGI 1451
ity 628 drill-down functionality (example) 1141 map data sets, creating 1041
PIE statement, BY statement with 144 filling areas in overlay plot (example) 1134 testing ability to draw 1287
PIECNTR function, Annotate facility 1542 generating overlay plot (example) 1131 vertices, maximum drawn 324
PIEFILL GDEVICE procedure 334 generating simple bubble plots (exam- %POP macro, Annotate facility 690
PIEFILL GOPTIONS statement 334 ple) 1121 portability 40
PIEXY function, Annotate facility 1543 high-low plots 8, 189 portrait orientation 34, 332, 344, 349
%PIEXY macro, Annotate facility 688 interpolation methods 1085 ports, how output is written to 306
PLAY function (DSGI) 1460 labeling and sizing plot bubbles (exam- POSITION= option
plot data sets 1086 ple) 1122 AXIS statement options 138
plot lines 196, 207 missing values 1087, 1112 LEGEND statement options 155, 159, 162,
filling area between plot lines (example) 236 needle plots 191 163
type of 196 out-of-range variables 747 POINTLABEL= specification 198
PLOT statement overlay plots 1111, 1131, 1134 POSITION variable, Annotate facility 656
contour levels, specifying (example) 908 patterns 1120 positioning
labels for contour lines (example) 906 plotting three variables (example) 1135 Annotate graphics 596, 597
patterns and joins in contour plots (exam- plotting two variables (example) 1126 axis labels 127, 133, 135, 138
ple) 910 regression analysis 192 BY lines 143
simple contour plot, generating (example) 904 regression analysis plots 192 donut chart labels 830
PLOT statement, G3D procedure 1301 right vertical axis to bubble plot (exam- graphics element 39
ActiveX and Java support for 1537 ple) 1124 graphics output, imported 976
generating default surface plot (exam- standard deviations 194 legend label 153
ple) 1314 step plots 196 legend text 159
rotating surface plot (example) 1316 symbols in 1114, 1120 legends 155, 162
tilting surface plots (example) 1317 three variables and legend 1118 pie and donut chart slice labels 830, 873
PLOT statement, GBARLINE procedure 765 two variables 1082 plot point labels 198
ActiveX and Java support for 1519 two vertical axes 1084, 1119, 1124 prism map light sources 1028
syntax and options 765 with multiple variables 1113 star chart slice labels 840
PLOT statement, GCONTOUR procedure plotters text in graphics output 221
ActiveX and Java support for 1526 active pens or colors 333 titles and footnotes, ODS output 492
syntax and options 889 drawing elements in color order 333 POSTGEPILOG= graphics option 336
PLOT statement, GPLOT procedure 1101 paper size 328 POSTGRAPH= graphics option 337
ActiveX and Java support for 1530 pen speed 352 POSTGRAPH= option, GDEVICE proce-
connecting plot data points (example) 1129 PNG device driver 382 dure 337
different scales of values (example) 1138 ACTXIMG, JAVAIMG vs. 440 pound sign #, variables as plot point labels 198
filling areas in overlay plot (example) 1134 data tips for 568 PPD file, location of 338
generating overlay plot (example) 1131 developing web presentations 443 PPDFILE= graphics option 338
matching PLOT2 statements 1117 drill-down links in images 571 predefined color names 97, 99
plots with drill-down for Web (example) 1141 HTML files, generating 445 predefined graph styles (ODS) 489
plotting three variables (example) 1135 names for image output files 445 PREGEPILOG= graphics option 338
plotting two variables (example) 1126 PNG presentations 377 PREGPROLOG= graphics option 339
plot symbols 1114, 1120 developing Web presentations 442 PREGRAPH= graphics option 339
altering or canceling 203 POINT function, Annotate facility 1543 PREGRAPH= option, GDEVICE procedure 339
bar line charts 768 POINTLABEL= option, SYMBOL state- PRESENTATION option, GREPLAY proce-
built-in drawing capability 354 ment 197, 1517 dure 1245
colors for 93, 185, 206, 275 points, drawing with Annotate facility 633 PRESENTATION window (GREPLAY) 1265
colors for, rotating through (example) 231 points, plot PREVIEW statement, GREPLAY proce-
default 209 labels for 197 dure 1256
displaying with DSGI 1454 specifying for plot points 199 previewing device output 356
fonts of 186 symbols for, specifying 199, 205 previewing output 52
in Annotate graphics output 640 POLELAT= option, GPROJECT proce- printing 51
interpolation 321 dure 1170, 1177 automatic 263
scatter plots 1308, 1320 POLELONG= option, GPROJECT proce- collating output 271
size of 187, 201 dure 1170, 1177 copies to print 298
specifying for plot points 205 %POLY, %POLY2 macro, Annotate facility 689 duplex 287
plot variables 741, 745 POLY function, Annotate facility 1543 duplex, binding edge for 265
chart statistics 745 POLYCONT function, Annotate facility 1544 flow control 311
out of range 747 %POLYCONT macro, Annotate facility 689 graph orientation 349
1582 Index
RESOURCESFONTNAME= graphics op- running programs 31 HBAR and VBAR statements 812
tion 477 LEGEND statement options 156
response axis, bar charts 815 SCATTER statement, G3D procedure 1308,
response axis, bar line charts 763 1310, 1320
response data sets 1003
S shapes in scatter plots 1308, 1320
assigning formats to response variables, block S option, GOPTIONS procedure 1078 SHORT option, GOPTIONS procedure 1078,
map (example) 1049 sample programs 21 1079
identification variables 1005 SAS Color Naming Scheme (CNS) 97, 99 SHOWALL option, GFONT procedure 946
merging feature tables with 1001 SAS/GRAPH software installation, testing 1285, SHOWBACKDROP= parameter, JAVA 435
response levels 1291 SHOWLEGEND= parameter, JAVA 436
maps 1004 SAS Maps Online 1006 SHOWLINKS= macro argument 551
specifying in block maps (example) 1047 SAS output 48, 1150 SHOWROMAN option, GFONT procedure 946,
specifying midpoints in prism map (exam- SASPOWER= macro argument 554 950, 962
ple) 1065 SCALABLE= option, GDEVICE procedure 351 SIDE option, PLOT statement 1303
RESPSTAT= option, HBAR and VBAR state- %SCALE macro, Annotate facility 692 SIMFONT= graphics option 351
ments 729 SCALE statement, GIMPORT procedure 975, simple plot lines 7
RETAIN statement 600 979 SIMPLEDEPTHSORT= parameter, JAVA 436
return characters at record ends 300 %SCALET macro, Annotate facility 693 SIMPLETHRESHOLD= parameter, JAVA 436
return codes 305, 1501 SCALEX= and SCALEY= options, TDEF state- SIMULATE font 77
REVEAL suboption, AUTOLABEL= op- ment 1261 SINGULAR= option, POINTLABEL= specifica-
tion 898 scaling tion 199
REVERSE= graphics option 349 dash length in lines 278 singularities, checking for 199
reversing black and white 353 graphs with DSGI windows 1388 size
RF= option, GFONT procedure 945 hardware fonts 274, 350, 351 aspect ratio 263, 1152
RGB color scheme 95 scatter plots 7, 9, 1296 axis labels 127, 133, 135, 136
converting to HLS 103 appearance of points 1310 axis tick marks 129, 139, 140
%RGB macro 102 axes, controlling 1299 axis values 136
%RGB2HLS macro 103 axes, reversing values on 1312 boxes in box plots 185
RH= option, GFONT procedure 946 connecting plot data points (example) 1129 bubbles in bubble plots 1092
RIGHTMARGIN= option, GDEVICE proce- data ranges 1298 BY lines 143, 312
dure 316 generating simple scatter plot (example) 1318 character cells 37, 38, 265
RIGHTMARGIN= option, GOPTIONS state- input data sets 1298 contour labels 187
ment 316 plotting three variables (example) 1135 contour lines 201
roles 411 plotting two variables (example) 1126 contour plot labels 903
Roman alphabet text fonts 84 rotating and tilting 1299 dash length in lines 278
ROMCOL= option, GFONT procedure 945 rotating (example) 1323 display, in lines 308
ROMFONT= option, GFONT procedure 945 shapes in (example) 1320 donut chart labels 829
ROMHEX= option, GFONT procedure 946, 951 simulating overlaid scatter plots 1310 enlarging graph areas with DSGI windows (ex-
ROMHT= option, GFONT procedure 946 three-dimensional, syntax for 1305 ample) 1391
ROTATE= graphics option 349 SCATTER statement, G3D procedure 1305 errors in sizing 40
ROTATE= option ActiveX and Java support for 1537 fonts 269
GDEVICE procedure 349 generating simple scatter plot (example) 1318 GRAPH window 50
LABEL= option, DONUT statement 830 rotating scatter plot (example) 1323 graphics output 1150
PLOT statement, G3D procedure 1303 shapes in (example) 1320 graphics output, imported 975
SCATTER statement, G3D procedure 1308, SCLNKWT= macro argument 550 graphics output text 316
1312 SCLWIDTH= macro argument 550 legend frame 153
SURFACE statement 1032, 1068 SCNSIZE= macro argument 550 legend frame drop shadows 326
TDEF statement, GREPLAY procedure 1260 Script drill-down mode, Java 400, 413, 572 legend label 153
TITLE, FOOTNOTE, and NOTE state- example 416 legend values 156, 157
ments 222 searching device catalogs 917 line thickness, default 323
ROTATE variable, Annotate facility 659 SEGMENT variable (font data sets) 956 paper 328
rotating graphs for printing 349 SEGMENT variable (map data sets) 1000 paper feed increments 327
rotating plot symbols through colors (exam- SELECT statement, MAPIMPORT proce- plot bubbles (example) 1122
ple) 231 dure 1349 plot print labels 197
ROTATION= option, GDEVICE procedure 350 SELIFUNC= macro argument 550 plot symbols 187, 201
rows SELLFUNC= macro argument 550 record length, to GSF 305
in graphics output area 36, 323, 350, 361 SELUFUNC= macro argument 551 scatter plot points 1309, 1310
legends 153 SEPCLASS= macro argument 554 splines in star charts 1196
ROWS= option, GDEVICE procedure 350 SEPLOC= macro argument 554 text in graphics output 218
RSTAT= option, HBAR and VBAR state- SEPTYPE= macro argument 554 titles and footnotes 317, 493
ments 729, 735 %SEQUENCE macro, Annotate facility 695 units of measurement 38, 310
RUN-group processing 33 server graphs vs. client graphs 584 size, graphics output area 316, 361, 363, 364,
GSLIDE procedure 1281 shadow color, legends 153 columns in 36, 274, 315, 322, 3
ODS and 490 shadowing, legend frames 326 rows in 36, 323, 350, 361
RUN statement 26, 144 shape, legend values 156 SIZE= option, SCATTER statement 1309, 1310
run-time controls in presentations 471 SHAPE= option SIZE variable, Annotate facility 660
RUNMODE= macro argument 545, 565 BLOCK statement, GMAP procedure 1015 SKIPMISS option, PLOT statement 1112
1584 Index
%SLICE macro, Annotate facility 695 spline interpolation 194, 205, 1330 developing presentations with GIF, JPEG,
SLICE= option GRID statement (example) 1339, 1342, 1343 PNG 443
PIE and DONUT statements 828 SPLINE option, GRID statement 1330, 1335, presentations developed with ACTXIMG,
STAR statement 839, 840 1339 JAVAIMG 442
SLIDECTL= option, META2HTM macro 473, spline smoothing 1331, 1339 sample programs for 447
565 splines in star charts static images in presentations 370, 371, 376
SLIDESHOWCONTROLENABLED= graphics axis definitions 1210 statistic heading
option 477 colors 1188, 1208 pie and donut charts 827, 832
SLIDESHOWENABLED parameter, ODS state- labels for 1193 star charts 839, 842
ments 473 line types 1191, 1208 step codes 305
smooth line fit 193 size 1196 STEP= option, SYMBOL statement 199, 904
SMOOTH= option, GRID statement 1329, SPLIT= option, AXIS statement options 134 step plots 196
1331, 1335, 13 SPREAD= macro argument 551 stock market high, low, close data 189
smoothing plot lines 190 SR option, GFONT procedure 946, 950 storing
software fonts 76, 351 SSFILE1=, ..., SSFILE5= macro arguments 555 Annotate graphics (example) 713
listing available 76 SSFREF1=, ..., SSFREF5= macro argu- clipped polygons 331
open at one time 290 ments 555 DSGI graphs 1357
rendering 353 SSHREF1=, ..., SSHREF5= macro argu- fonts 77
resolution 293 ments 555 graphics catalogs 53, 55, 59, 70
where stored 82 SSMEDIA1=, ..., SSMEDIA5= macro argu- graphics files 51, 60
sorting ments 555 graphics output as files 64, 66, 68, 291
grouped observations 142 SSREL1=, ..., SSREL5= macro arguments 555 Java archive 399
map data set observations 1227 SSREV1=, ..., SSREV5= macro arguments 556 Java plug-in 424
plot data set observations 1087 SSTITLE1=, ..., SSTITLE5= macro argu- online help 385
space data sets 960 ments 556 PPD file 338
variables for, list of 960 SSTYPE1=, ..., SSTYPE5= macro argu- rendered font files 346, 347
SPACE= option ments 556 strings
STACKED= parameter, JAVA 436 appending to graphics data records 300
BAR statement 762
STACKPERCENT= parameter, JAVA 436 prefixing output records 309
GFONT procedure 951
standard deviations 194 sending to devices or files 301, 303
SPACEDATA= option, GFONT procedure 951,
STAR statement, GCHART procedure stroked fonts 940
961
BY statement with 144 STYLE= option, AXIS statement options 134
spacing
discrete numeric variables, charting (exam- STYLE= option, ODS statements 489
angle of rotation 222
ple) 881 style variable, annotate facility 660
between Bitstream font letters 295
star chart with sum statistic (example) 879 styles, ODS 488
between display area and graphic 360
syntax and options 833 stylesheets, macro arguments for 554
between displayed area and graph 314
STARAXES= option, CHART statement 1193 SUBGROUP= option
between fill lines 292
STARAXIS= option, CHART statement 1193, BLOCK statement 793, 795
contour plot labels 904
1210 HBAR and VBAR statements 729, 733, 735,
fonts 948, 951, 960, 961 813
STARCIRCLE= option, CHART statement 1194
legends 154, 163 STARCIRCLES= option, CHART state- PIE and DONUT statements 828
text in graphics output 216, 221 ment 1194 SUBGROUP variable, Annotate facility 664
SPCLASS= macro argument 554 STARFILL= option, CHART statement 1194, subgrouping
special characters 81 1204 block chart (example) 844
HTML entities 582 STARINRADIUS= option, CHART state- pie charts (example) 877
Special font 89 ment 1194 pie or donut chart (example) 848
special plot symbols 200 STARLEGEND= option, CHART state- vertical bar chart (example) 848
SPEED= graphics option 352 ment 1194, 1201 subsetting map data sets 1039, 1173, 1178, 12
speed of plotter pens 352 STARLEGENDLAB= option, CHART state- example of 1178
SPEED= option, GDEVICE procedure 352 ment 1194, 1201 reducing map of Canada (example) 1220
spherical coordinates, converting to Carte- STARMAX= option, STAR statement 839 substitution strings
sian 1161 STARMIN= option, STAR statement 839 drill-down tags as 411
basic usage of GPROJECT procedure 1172 STAROUTRADIUS= option, CHART state- removing blanks from data values 414
clipping map areas (example) 1178 ment 1194 variables as 410
default projection specifications, using (exam- stars, drawing circle of (example) 609 success factor diagrams
ple) 1174 STARSTART= option, CHART statement 1195 drill-down functionality 573
emphasizing map areas (example) 1177 STARTYPE= option, CHART statement 1195, DS2CSF macro 527, 528
ID statement, GPROJECT procedure 1172 1207 hotspots 532
input map data sets 1163 STATE function (DSGI) 1430 sample diagrams 530
projecting an Annotate data set (exam- state map data (U.S.) 1003 SUM option
ple) 1180 removing U.S. state boundaries (exam- BAR statement 762
syntax and options, GPROJECT proce- ple) 1228 HBAR and VBAR statements 813
dure 1168 statement options 46 sum statistic 746, 783
types of map projections 1165 statements, SAS/GRAPH 123 bar chart (example) 846
SPIDER option, CHART statement 1193 global 14, 27, 33, 123 block chart (example) 842
SPIDERWEB option, CHART statement 1193 static graphics 439 pie chart (example) 842
SPKLABEL= option, CHART statement 1193 creating with ODS 440 star chart (example) 879
Index 1585
SUMLABEL= option, HBAR and VBAR state- SYMBOL statement 27, 124, 183 TEXFONT function (DSGI) 1434, 1489
ments 813 ActiveX and Java support for 1516 TEXHEIGHT function (DSGI) 1435, 1490
SUMVAR= option altering or canceling 203 TEXINDEX function (DSGI) 1436, 1491
bar chart with sum statistic (example) 846 box plots, modifying (example) 233 TEXPATH function (DSGI) 1437, 1491
BAR statement 762 GBARLINE procedure 740, 768 TEXREP function (DSGI) 1437, 1492
block chart with sum statistic (example) 842 GCONTOUR procedure 903 text 1456
BLOCK statement 793 GPLOT procedure 1114, 1120 adjusting character size in output (exam-
CHART statement, GRADAR procedure 1195 internationalization 392 ple) 1156
HBAR and VBAR statements 814 Java applets, internationalization and 400 angle of 330
PIE and DONUT statements 828 rotating plot symbols through colors (exam- as axis values 131, 134
pie chart with sum statistic (example) 842 ple) 231 as legend values 155, 157
PLOT statement 745, 767 SYMBOLS= option, GDEVICE procedure 354 axis text, formatting 135
star chart with sum statistic (example) 879 syntax conventions 17 block charts 795
STAR statement 839 system fonts 76 BY lines 143
suppressing axes %SYSTEM macro, Annotate facility 696 contour plot labels, specifying 904
BAR statement 760 donut chart labels 829
BUBBLE statement 1097 HTML entities 582
HBAR and VBAR statements 810 in Annotate graphics output 626
PLOT statement, G3D procedure 1303
T reading direction, changing (example) 1384
PLOT statement, GCONTOUR procedure 897 T= option, AXIS statement options 138 specifying color text in output (exam-
PLOT statement, GPLOT procedure 1111 T option, GOPTIONS procedure 1078 ple) 1153
SCATTER statement, G3D procedure 1307 T= option, LEGEND statement options 160 text color 276
surface maps 12, 998, 1030 tables of contents 495, 497 text files, converting to graphics output 1147
axes, controlling 1299 tables of pages 496, 497 adjusting character size in output (exam-
identification variables 1005 TARGETDEVICE= graphics option 52, 72, ple) 1156
predefined formats for 1035 105, 354 adjusting output size 1150
producing simple surface map (example) 1066 TC option external text files, about 1148
response levels 1004 ? statement, GREPLAY procedure 1246 fonts 1152
rotating and tilting 1299 LIST statement, GREPLAY procedure 1254 specifying color text in output (exam-
rotating and tilting surface map (exam- TC= option, GREPLAY procedure 1245 ple) 1153
ple) 1068 TC statement, GREPLAY procedure 1258 syntax and options, GPRINT procedure 1149
surface plots 9, 1295 TCOPY statement, GREPLAY procedure 1258 text slides for presentations 12, 13, 1277
appearance of surface 1304 TDEF statement, GREPLAY procedure 1259 Annotate graphics, displaying 1278, 1283
data ranges 1298 TDELETE statement, GREPLAY proce- multiple graphs on same slide 13
input data sets 1298 dure 1262 producing (example) 1282
rotating (example) 1316 TEMPLATE DESIGN window (GRE- slide-show control 473
three-dimensional, syntax for 1301 PLAY) 1265 TEXT variable, Annotate facility 666
tilting (example) 1317 TEMPLATE option TEXUP function (DSGI) 1438, 1493
surface plots, three-dimensional, processing data ? statement, GREPLAY procedure 1246 three-dimensional plots 9
for 887, 1327 LIST statement, GREPLAY procedure 1254 tick marks, axes 129, 138
controlling observations in output data TEMPLATE= option, GREPLAY proce- formatting 139
set 1336 dure 1245 offset 130
GRID statement, G3GRID procedure 1333 TEMPLATE statement, GREPLAY proce- scatter plots 1310
interpolation methods 1329 dure 1262 suboptions, list of 1509
simple contour plot, generating (example) 905 templated graphs 13 surface plots 1304
spline interpolation, partial (example) 1342 templates 1239 with datetime values (example) 226
spline interpolation, with smoothed spline (ex- copying or duplicating 1258 TICK= option, AXIS statement options 138
ample) 1339 creating 1268, 1270 TICK= option, LEGEND statement options 160
spline interpolation (example) 1343 defining or modifying in catalogs 1259 TILELEGEND= option, CHART state-
syntax and options, G3GRID procedure 1332 deleting 1262 ment 1195
using default interpolation method (exam- panel outlines for, displaying 1256 TILELEGLABEL= option, CHART state-
ple) 1337 printing contents of 1254 ment 1195
SURFACE statement, GMAP procedure 1030 relaying graphics output in templates 1272 tiling radar charts (example) 1201
producing simple surface map (example) 1066 replaying graphics output in 1270 TILT= option
rotating and tilting surface map (exam- specifying/assigning 1258, 1262 PLOT statement, G3D procedure 1303
ple) 1068 transporting 58 SCATTER statement, G3D procedure 1309
SURFACESIDECOLOR= parameter, JAVA 436 temporary data sets 29 SURFACE statement 1032, 1068
SWAP function, Annotate facility 639 terminating drivers 286 tilting
SWAP= graphics option 353 test pattern, GTESTIT procedure 1286 surface and scatter plots 1299, 1317
%SWAP macro, Annotate facility 696 testing installation of SAS/GRAPH soft- surface maps (example) 1068
SWAP= option, GDEVICE procedure 353 ware 1285 TIPBACKCOLOR= parameter, JAVA 436
SWFONTRENDER= graphics option 353 managing colors list for device driver (exam- TIPBORDERCOLOR= parameter, JAVA 436
SYMBOL definitions, BY statement with 145 ple) 1291 TIPMODE= parameters, JAVA and ActiveX 437
symbol fonts, creating figures for 964 testing GOPTIONS statement (example) 1291 TIPS= macro argument 551
SYMBOL function, Annotate facility 1544 TEXALIGN function (DSGI) 1430, 1486 TIPS= parameters, JAVA and ActiveX 437
SYMBOL= graphics option 354, 1078 TEXCOLOR function (DSGI) 1431, 1488 TIPSTEMSIZE= parameters, JAVA and Ac-
SYMBOL= option, GDEVICE procedure 354 TEXEXTENT function (DSGI) 1433 tiveX 437
1586 Index
TIPTEXTCOLOR= parameters, JAVA and Ac- TRANSLATE statement, GIMPORT proce- UNIFORM option
tiveX 437 dure 976 GFONT procedure 951
TIPTYPE= argument, META2HTM macro 565 adjusting graphics output (example) 979 GPLOT procedure 144, 1089
TIPTYPE= macro argument 551 translation table, ASCII-to-EBCDIC 358 uninstalling ActiveX Control 390
TITLE graphics option 1078, 1079 TRANSNO function (DSGI) 1439, 1496 unit area (maps) 1005
TITLE statement 27, 124, 210, 224 transparency, image 357 units of measurement 38, 310
ActiveX and Java support for 1517 TRANSPARENCY GOPTIONS statement 357 Annotate graphics 597
BY statement with 145 TRANSPARENCY= graphics option 459 unmatched area boundaries
displaying with GOPTIONS procedure (exam- transporting and converting graphics output 56 GREDUCE procedure and 1215
ple) 1079 TRANTAB= graphics option 358 GREMOVE procedure and 1225
enhancing titles (example) 238 TRANTAB= option, GDEVICE procedure 358 UPDATE function (DSGI) 1461
titles 211, 224 tray, paper 329 URL drill-down mode, Java 401, 409, 572
angle of rotation 213, 219 TREEDIR= macro argument 551 example 417
TREESPAN= macro argument 552 URL= option, ODS HTML statement 167
boxes around 215, 216
Treeview applet 372, 503 URX= and URY= options, TDEF state-
colors for 215, 216, 276
data tips with 569 ment 1261
default characteristics, setting 225
drill-down functionality 572 U.S. city map data 1003
defining text of 222, 226
DS2TREE macro with 505 U.S. state map data 1003
enhancing (example) 238 removing U.S. state boundaries (exam-
fonts 295 enhancing presentations for 506
hotspots 510 ple) 1228
fonts, color, and size (ODS output) 493 user-defined control characters, device 359
fonts for 217 when to use 504
XML embedded in HTML file (example) 507 user input, enabling 360
hyperlinks for 220 USERFMT= parameters, JAVA and ActiveX 437
justification 218 XML written to external file (example) 509
USERINPUT= graphics option 459
TREPLAY statement, GREPLAY proce-
ODS output 492
dure 1263
positioning 39, 221
relaying graphics output in templates 1270,
size of 218, 316, 317
spacing around 221
1272 V
troubleshooting
text breaks 225 V= option, SYMBOL statement 199, 205
Annotate data sets 604
underlining 223 V6COMP graphics option 362, 749, 785
SAS/GRAPH software installation 1285
titles macro, arguments for 556 patterns 181
Web output 579
TO variable (GKEYMAP data set) 987 VALUE= option
trueness of color 105
tokens, GDDM 299 TTAG= macro argument 556 AXIS statement 134, 1509
TOLANGLE= suboption, AUTOLABEL= op- two-dimensional bar charts 116 LEGEND statement 1515
tion 899 two-sided printing 265, 287 PATTERN statement 171
TOLEN variable (GKEYMAP data set) 988 PIE and DONUT statements 829
TXT2CNTL function, Annotate facility 642
traditional map data sets 999 STAR statement 840
%TXT2CNTL macro, Annotate facility 697
creating 1041 SYMBOL statement 199, 205, 904
TYPE= option
identification variables 1005 VALUEPOS= macro argument, DS2CSF
BAR statement 762
lakes, displaying 1041 macro 564
BLOCK statement 794
projecting 1040 values on axes 134
GDEVICE procedure 358
response data sets with 1003 order of 130
GKEYMAP procedure 989
subsetting or reducing (clipping) 1039, 1173, splitting (multiline) 134
HBAR and VBAR statements 814
1178, 12 values on legends
PIE and DONUT statements 828
traditional map data sets, projecting coordinates order of 155
PLOT statement 767
from spherical to Cartesian 1161 size and shape of 156
STAR statement 839 VAR= macro argument, DS2CSF macro 562
basic usage of GPROJECT procedure 1172
variable roles 411
clipping map areas (example) 1178
variables
default projection specifications, using (exam-
ple) 1174 U Annotate facility 591, 599, 602, 642
as substitution strings 410
emphasizing map areas (example) 1177 U option, GFONT procedure 951 bar variables 741, 742, 745
ID statement, GPROJECT procedure 1172 U= option, TITLE, FOOTNOTE, and NOTE chart variables 778, 779, 780
input map data sets 1163 statements 223, 225 classification, plotting 1083
projecting an Annotate data set (exam- UCC= graphics option 359 contour variables 885
ple) 1180 UCC= option, GDEVICE procedure 359 declaring as plot point labels 198
syntax and options, GPROJECT proce- UCC values 359 font data sets 952
dure 1168 ULX= and ULY= options, TDEF state- GKEYMAP data sets 987
types of map projections 1165 ment 1261 identification variables 1005
TRAILER= option, GDEVICE procedure 356 unclipped polygons, storing 331 identification variables, maps 1005
TRAILER records 356, 357 UNDERFLOWCOLOR= parameters, JAVA and kern data sets 959
TRAILERFILE= option, GDEVICE proce- ActiveX 437 link and enhancement variables in presenta-
dure 357 UNDERLIN= option, TITLE, FOOTNOTE, and tions 574
trailers, animation 458 NOTE statements 223, 225 macro variable names 566
TRANLIST= macro argument 561 underlining in titles, footnotes, and notes 223 multiple classification variables in radar charts
TRANS function (DSGI) 1439 Unicode references for character data 561 (example) 1202
transformations, DSGI 1378 uniform fonts 940, 951 plot variables 741, 745, 747
Index 1587
If you have comments or suggestions about SAS/GRAPH® 9.1 Reference, please send
them to us on a photocopy of this page, or send us electronic mail.
For comments about this book, please return the photocopy to
SAS Publishing
SAS Campus Drive
Cary, NC 27513
E-mail: [email protected]