232 CONNECT Statement Chapter 12
Up to 32 mixed-case alphanumeric characters are allowed.
Names must begin with an alphabetic character or an underscore.
Characters that are not permitted 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.
When VALIDVARNAME=V6 is speciļ¬ed, the SAS/ACCESS engine for the
DBMS truncates column names to eight characters, as it did in Version 6. If
required, numbers are appended to the ends of the truncated names to make
them unique. Setting this option overrides the value of the SAS system
option, VALIDVARNAME= during (and only during) the Pass-Through
connection.
The following example shows how the Pass-Through Facility uses
VALIDVARNAME=V6 as a connection argument. Using this option causes
the output to show the DBMS column "Amount Budgeted$" as AMOUNT_B
and "Amount Spent$" as AMOUNT_S.
proc sql;
connect to oracle (user=gloria password=teacher
validvarname=v6)
create view budget2000 as
select amount_b, amount_s
from connection to oracle
(select "Amount Budgeted$", "Amount Spent$"
from annual_budget);
quit;
proc contents data=budget2000;
run;
For this example, if you
omit VALIDVARNAME=V6 as a connection
argument, you must add it in an OPTIONS= statement in order for PROC
CONTENTS to work:
options validvarname=v6;
proc contents data=budget2000;
run;
Thus, using it as a connection argument saves you coding later.
Note: In addition to the arguments listed here, several other LIBNAME
options are available for use with the CONNECT statement. See the section on
the Pass-Through Facility in the documentation for your SAS/ACCESS interface to
determine which LIBNAME options are available in the Pass-Through Facility for
your DBMS. When used with the Pass-Through Facility CONNECT statement,
these options have the same effect as they do in a LIBNAME statement.
CONNECT Statement Example
The following example connects to a SYBASE server and assigns the alias SYBCON1
to it. SYBASE is a case sensitive database; therefore, the database objects are in
uppercase, as they were created.
proc sql;
connect to sybase as sybcon1
(server=SERVER1 database=PERSONNEL
user=testuser password=testpass