A SERVICE OF

logo

SAS Names and Support for DBMS Names Using DBMS Data to Create a DBMS Table 17
create view myview as
select "Amount Budgeted$", "Amount Spent$"
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$ remains Amount
Budgeted$ and Amount Spent$ remains Amount Spent$.
Using Name Literals
In the following example, you create a table using name literals. You must specify
the SAS option VALIDVARNAME=ANY in order to use name literals. Use PROC SQL
to print the new DBMS table because name literals work only with PROC SQL and the
DATA step. PRESERVE_COLUMN_NAMES=YES is required
only because the table is
being created with non-standard SAS column names.
options ls=64 validvarname=any nodate;
libname mydblib oracle user=testuser password=testpass path=’ora8servr’
preserve_col_names=yes preserve_tab_names=yes ;
data mydblib.’Sample Table’n;
’EmpID#’n=12345;
Lname=’Chen’;
’Salary in $’n=63000;
proc sql;
title "Sample Table";
select * from mydblib.’Sample Table’n;
Output 2.6 DBMS Table to Test Column Names
Sample Table
Salary
EmpID# Lname in $
-------------------------
12345 Chen 63000
Using DBMS Data to Create a DBMS Table
In the following example, you use PROC SQL to create a DBMS table based on data
from other DBMS tables. You preserve the case sensitivity of the aliased column names
by using PRESERVE_COL_NAMES=YES. A partial output is displayed after the code.
libname mydblib oracle user=testuser password=testpass
path=’hrdata99’ schema=personnel preserve_col_names=yes;
proc sql;
create table mydblib.gtforty as