A SERVICE OF

logo

8 SAS Name Literals Chapter 2
macros and macro variables.
The following SAS language elements have a maximum length of 8 characters:
librefs and filerefs
SAS engine names
names of SAS/ACCESS access descriptors and view descriptors
variable names in SAS/ACCESS access descriptors and view descriptors.
For a complete description of SAS naming conventions, see the SAS Language
Reference: Dictionary.
When SAS encounters mixed-case or case-sensitive names in SAS code, it stores and
displays the names as they are specified. If the SAS variables Flight and dates are
defined in mixed case, for example,
input Flight $3. +3 dates date9.;
then SAS displays the variable names as defined. Note how the column headings
appear as defined:
Output 2.1 Mixed-Case Names Displayed in Output
SAS System
Obs Flight dates
1 114 01MAR2000
2 202 01MAR2000
3 204 01MAR2000
Although SAS stores variable names as they are defined, it recognizes variables for
processing without regard to case. For example, SAS processes these variables as
FLIGHT and DATES. Likewise, renaming the Flight variable to "flight" or "FLIGHT"
would result in the same processing.
SAS Name Literals
A SAS name literal is a name token that is expressed as a quoted string, followed by
the letter
n. Name literals enable you to use special characters or blanks that are not
otherwise allowed in SAS names when you specify a SAS data set or variable. Name
literals are especially useful for expressing database column and tables names that
contain special characters.
Examples of name literals are
data mydblib.’My Staff Table’n;
and
data Budget_for_1999;
input ’$ Amount Budgeted’n ’Amount Spent’n;
Name literals are subject to certain restrictions:
You can use a name literal only for SAS variable and data set names, statement
labels, and DBMS column and table names.
You can use name literals only in a DATA step or in the SQL procedure.