Base SAS Language Elements

Shared Language Statements

The following Base SAS language statements are also part of SAS/GRAPH:
FORMAT statement
assigns a format to a variable. SAS/GRAPH procedures use formatted values to determine such aspects of the graph as midpoints, axis labels, tick-mark values, and legend entries.
FILENAME
associates a SAS fileref with an external text file or output device. See FILENAME Statement for a more detailed description of this statement.
RUN statement see line 7 in Figure: Typical SAS Program
executes the statements in the PROC step.
LABEL statement
assigns a descriptive text string (a “label”) to a variable. The label appears in place of the variable name on the axis and legend.
LIBNAME
associates a libref with a SAS library. See LIBNAME Statement for a more detailed description of this statement.
ODS statements
control the output of SAS/GRAPH procedures, where the output is sent (destination), the appearance of the output (STYLE=), and the output file type (DEVICE=). See Overview of Devices, ODS Destinations, and ODS Styles for information about using ODS with SAS/GRAPH procedures.
OPTIONS statement
changes the value of one or more SAS system options.
QUIT statement see line 8 in Figure: Typical SAS Program
executes any statements that have not executed and ends the procedure. It also ends a procedure that is using RUN-GROUP processing.
WHERE statement
specifies observations from SAS data sets that meet a particular condition. You can use a WHERE statement to easily subset your data.
For a complete description of these statements, see SAS Statements: Reference.

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 do the following tasks:
  • point to a text file that you want to use for data input or output.
  • 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 Exporting Your Output for information about 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 that you want to reference. For details about specifying the physical names of external files, see the SAS documentation for your operating environment.

LIBNAME Statement

The LIBNAME statement associates a libref with a SAS library. A SAS library can be either temporary or permanent. Typically, SAS libraries used with SAS/GRAPH contain the following items:
  • SAS files for data input and output.
  • SAS catalogs that contain SAS/GIS maps, fonts, GRSEG, CMAP, TEMPLATE, or device entries.
  • SAS catalogs that contain graphics output. These catalogs are often stored in permanent libraries. See Controlling Where Your Output Is Stored for information about storing graphics output in a permanent catalog.
The LIBNAME statement has this general form:
LIBNAME libref 'SAS-library';
libref
is any SAS name.
SAS-library
is the physical name for the SAS library on your host system. For details about specifying SAS-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.