Macro Variables and System Options for Relational Databases |
Controls the type of SAS variable names that can be used or created
during a SAS session.
Default value: |
V7
|
Valid in: |
configuration file, SAS invocation, OPTIONS
statement, SAS System Options window
|
VALIDVARNAME= V7 | UPCASE | ANY
|
VALIDVARNAME= 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. Here are the valid settings.
-
VALIDVARNAME=V7
-
indicates that a DBMS column name is changed
to a valid SAS name by using these rules:
-
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.
This is the default value for SAS 7 and
later.
-
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.
This example shows how the 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;
Output from this example would show that "Amount Budgeted$"
becomes AMOUNT_B and "Amount Spent$" becomes
AMOUNT_S.
Introduction to SAS/ACCESS Naming
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.