Previous Page | Next Page

SAS Names and Support for DBMS Names

SAS Naming Conventions


Length of Name

SAS naming conventions allow long names for SAS data sets and SAS variables. For example, MYDB.TEMP_EMPLOYEES_QTR4_2000 is a valid two-level SAS name for a data set.

The names of the following SAS language elements can be up to 32 characters in length:

The following SAS language elements have a maximum length of eight characters:

For a complete description of SAS naming conventions, see the SAS Language Reference: Dictionary.


Case Sensitivity

When SAS encounters mixed-case or case-sensitive names in SAS code, SAS 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:

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.

Here are two examples of name literals:

data mydblib.'My Staff Table'n; 

data Budget_for_1999;
input '$ Amount Budgeted'n 'Amount Spent'n;

Name literals are subject to certain restrictions.

Previous Page | Next Page | Top of Page