This section explains the conventions this book uses for text, SAS language syntax, and file and library references. The book uses the following terms in discussing syntax:
keyword | is a literal that is a primary part of the SAS language. (A literal must be spelled exactly as shown, although it can be entered in uppercase or lowercase letters .) Keywords in this book are procedure names, statement names, macro names, routine names, and function names . |
argument | is an element that follows a keyword. It is either literal, or it is user -supplied . It has a built-in value (for example, NODISPLAY), or it has a value assigned to it (for example, COLOR = text-color ). Arguments that you must use are required arguments . Other arguments are optional arguments , or simply options . |
value | is an element that follows an equal sign. It assigns a value to an argument. It may be a literal, or it may be a user-supplied value. |
parameter | is a value assigned to an argument that itself takes a value, for example, the COLOR= parameter of the LABEL= option in a LEGEND statement, as shown in the following statement: legend label=(color=blue); |
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
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 brackets) | identify optional arguments. Any argument not enclosed in angle 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>;
PROC GANNO is in uppercase because it is a SAS keyword, the name of a statement. The remaining elements are arguments for the statement.
ANNOTATE= is not enclosed in angle brackets because it is a required argument. It is in uppercase to indicate that it is a literal and must be spelled as shown.
Annotate-data-set is in italic because it is a value that you must supply; in this case, the value must be a data set name.
DATASYS is enclosed in angle brackets because it is an optional argument. It is in uppercase to indicate that it is a literal and must be spelled as shown.
The ending semicolon (;) is required because it is outside the angle brackets for the option.
SYMBOL <1 . . . 99>
<COLOR= symbol-color >
<MODE=EXCLUDE INCLUDE>
< appearance-options >;
SYMBOL is in uppercase because it is a SAS keyword, the name of a statement. The numbers 1 . . . 99 are in angle brackets because they are optional. The ellipsis indicates that you choose one from the range of numbers 1 through 99. The remaining elements are arguments for the statement.
COLOR= is enclosed in angle brackets because it is an optional argument.
Symbol-color is in italics because it represents a value that you specify.
MODE= is enclosed in angle brackets because it is an optional argument.
EXCLUDE and INCLUDE are in uppercase because they are literal values and must be spelled exactly as shown. They are separated by a vertical bar (an or bar) because you use one or the other but not both.
Appearance-options is in italics because it is a generic name for a list of options that can be used in the SYMBOL statement.
HBAR chart-variable < . . . chart-variable-n >
</ <PATTERNID=BY GROUP MIDPOINT SUBGROUP>
< statistic-options >>;
Chart-variable is italic because it is an argument that you supply. It is required because it is not in angle brackets.
Chart-variable-n is enclosed in angle brackets because additional user-supplied arguments are optional. The ellipsis before the argument indicates that it can be repeated as many times as desired.
PATTERNID= is a literal option. The values BY, GROUP, MIDPOINT, and SUBGROUP are literal values that are mutually exclusive. You can use only one, and it must be spelled as shown.
Statistic-options is in italics because it is the generic name of a list of options that affect the chart statistics.
When you are using an option, a statement, or a procedure whose syntax shows arguments or values in italics, you must supply the argument or value. When the argument or value is a font, color, or variable name, SAS/GRAPH software expects valid font names, color names, and variable names. Consider the following four syntax samples:
FONT= font
COLOR= color
COLOR= text-color
PIE chart-variable < . . . chart-variable-n >;
Font must be a valid SAS font name. (See Chapter 5, SAS/GRAPH Fonts, on page 75 for details.)
Color and text-color must be valid SAS/GRAPH colors. (See Chapter 6, SAS/ GRAPH Colors and Images, on page 91 for details.)
Chart-variable must be a valid SAS variable name. (See SAS Language Reference: Dictionary for details.)
Most of the chapters in this book include examples that illustrate some of the features of a procedure or its statements. Each example contains
a description of the highlights of the example
the program statements that produce the output
the actual output from the example
an explanation of the features of the example.
The output that is shown for the examples in this book was generated in an HP-UX operating environment, using the default XCOLOR display device. If you are using a different operating environment or display device, you may need to make some minor adjustments to the example programs.
The dimensions of the graphics output area vary across devices and when using the GRAPH windows . The dimensions may affect aspects of the graphics output “ for example, the appearance of axes or the position of graphics elements that use explicit coordinates in units other than percent. You may need to adjust the dimensions of your graphics output area or the size of graphics elements to correct any differences you see. Most of the examples in this book used a GOPTIONS statement to set the graphics output area to 7 inches by 5 inches, which proved to be a good dimension for generating output displays for this book:
goptions hsize=7in vsize=5in;
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.
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.