VALIDVARNAME= System Option

Controls the type of SAS variable names that can be used or created during a SAS session.
Valid in: configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Category: Files: SAS files
Default: V7
See: Introduction to SAS/ACCESS Naming

Syntax

VALIDVARNAME=V7 | UPCASE | ANY

Required Arguments

VALIDVARNAME=V7
indicates that a DBMS column name is changed to a valid SAS name, following these rules. This is the default value for SAS 7 and later.
  • Up to 32 mixed-case alphanumeric characters are allowed.
  • Names must begin with an alphabetic character or an underscore.
  • Invalid characters are changed to underscores.
  • Any column name that is not unique when it is normalized is made unique by appending a counter (0,1,2,…) to the name.
VALIDVARNAME=UPCASE
indicates that a DBMS column name is changed 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 the equal sign (=) and the asterisk (*), must be contained in a 'variable-name'n construct. You must use ANY whenever you want to read DBMS column names that do not follow the SAS naming conventions.

Example

This example shows how the SQL pass-through facility works with VALIDVARNAME=V6.
options validvarname=v7;
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;
Output from this example would show that "Amount Budgeted$" becomes AMOUNT_B and "Amount Spent$" becomes AMOUNT_S.