Chapter Contents

Previous

Next
VALIDVARNAME

VALIDVARNAME



Controls the type of SAS variable names that can be used and/or created during a SAS session

Default: V7 (for Version 7 and later)
Valid in: configuration file, SAS invocation, OPTIONS statement, OPTIONS window.


Syntax
SAS/ACCESS Specific Details
Example

Syntax

VALIDVARNAME=V7 | V6 | UPCASE | ANY


SAS/ACCESS Specific Details

VALIDVARNAME is a SAS system option that interacts with SAS/ACCESS applications. It enables you to control which rules apply for SAS variable names. For more information about the VALIDVARNAME= system option, see the SAS Language Reference: Dictionary. The settings are as follows:

VALIDVARNAME=V7
indicates that a DBMS column name will be mapped to a valid SAS name by using the following rules:

V7 is the default value for Version 7 and later of SAS software.

VALIDVARNAME=V6
indicates that only those variable names considered valid SAS variable names in Version 6 are considered valid. When V6 is specified in SQL Pass-Through code, the DBMS engine truncates column names to 8 characters as it did in Version 6. If required, numbers are appended to the end of the truncated name to make it unique.

VALIDVARNAME=UPCASE
indicates that a DBMS column name will be mapped to a valid SAS name as described in VALIDVARNAME=V7 except that variable names are in uppercase.

VALIDVARNAME=ANY
allows any characters in DBMS column names to appear as valid characters in SAS variable names. Symbols, such as "=" and "*", must be contained in a 'varname'n construct. ANY is required whenever you want to read DBMS column names that don't follow the SAS naming conventions.

For more information on SAS naming conventions, see SAS Names and Support for DBMS Names and system options in the SAS Language Reference: Dictionary.


Example

The following example shows how the PROC SQL Pass-Through Facility works with VALIDVARNAME=V6.

options validvarname=v6;
proc sql;
   connect to oracle (user=testuser pass=testpass);
   create view myview as
     select amount_b, amount_s
     from connection to oracle
       (select "Amount Budgeted$", "Amount Spent$"
         from mytable);
quit;

proc contents data=myview;
run;

The output from this example would show that "Amount Budgeted$" becomes AMOUNT_B and "Amount Spent$" becomes AMOUNT_S.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.