12 SAS/ACCESS Naming Examples Chapter 2
Table 2.3 SAS Variable Names to DBMS Column Names When Creating Tables
SAS Variable Name as Input Desired DBMS Column Name Options
Any SAS variable name, such as
Miles
Default DBMS column name
(normalized to follow the DBMS’s
naming conventions), such as MILES
PRESERVE_COL_NAMES=NO
A case-sensitive SAS variable name,
such as Miles
Case-sensitive DBMS column name,
such as Miles
PRESERVE_COL_NAMES=YES
A SAS variable name with
characters that are not valid in a
normalized SAS name, such as
Miles-to-Go
Case-sensitive DBMS column name
that matches the SAS name, such as
Miles-to-Go
PROC SQL DQUOTE=ANSI and
PRESERVE_COL_NAMES=YES or,
in a DATA or PROC step, use a
SAS name literal and
PRESERVE_COL_NAMES=YES
and VALIDVARNAME=ANY
Table 2.4 SAS Data Set Names to DBMS Table Names
SAS Data Set Name as Input Desired DBMS Table Name Options
Any SAS data set name, such as
Payroll
Default DBMS table name
(normalized to follow the DBMS’s
naming conventions), such as
PAYROLL
PRESERVE_TAB_NAMES=NO
A case-sensitive SAS data set name,
such as Payroll
Case-sensitive DBMS table name,
such as Payroll
PRESERVE_TAB_NAMES=YES
A case-sensitive SAS data set name
with characters that are not valid in
a normalized SAS name, such as
Payroll-for-QC
Case-sensitive DBMS table name
that matches the SAS name, such as
Payroll-for-QC
PROC SQL DQUOTE=ANSI and
PRESERVE_TAB_NAMES=YES or,
in a DATA or PROC step, use a SAS
name literal and
PRESERVE_TAB_NAMES=YES
SAS/ACCESS Naming Examples
This section contains examples that demonstrate SAS/ACCESS naming behavior.
Replacing Unsupported Characters
In the following example, a view, MYVIEW, is created from the Oracle table
MYTABLE.
proc sql;
connect to oracle (user=testuser password=testpass);
create view myview as
select * from connection to oracle
(select "Amount Budgeted$", "Amount Spent$"
from mytable);
quit;