This option applies
only when you create a new table. When you create a table, you assign
the column names by using one of the following methods:
-
To control the case of the column
names, specify columns using the desired case and set PRESERVE_COL_NAMES=YES.
If you use special symbols or blanks, you must set VALIDVARNAME= to
ANY and use N-Literals.
-
To enable the DBMS to normalize
the column names according to its naming conventions, specify columns
using any case and set PRESERVE_COLUMN_NAMES= NO.
Note: When you read from, insert
rows into, or modify data in an existing DBMS table, SAS identifies
the database column names by their spelling. Therefore, when the database
column exists, the case of the column name does not matter.
Specify the alias PRESERVE_NAMES=
if you plan to specify both the PRESERVE_COL_NAMES= and PRESERVE_TAB_NAMES=
options in your LIBNAME statement. Using this alias saves you some
time when coding.
To use column names
in your SAS program that are not valid SAS names, you must use one
of the following techniques:
-
Use the DQUOTE= option in PROC
SQL and then reference your columns using double quotation marks.
For example:
proc sql dquote=ansi;
select "Total$Cost" from mydblib.mytable;
-
Specify the global system option
VALIDVARNAME=ANY and use name literals in the SAS language. For example:
proc print data=mydblib.mytable;
format 'Total$Cost'n 22.2;
If you are creating
a table in PROC SQL, you must also include the PRESERVE_COL_NAMES=YES
option in your LIBNAME statement. For example:
libname mydblib fedsvr server="d1234.us.company.com"
port=2171 user=user1 pwd=pass1
dsn=oradsn dsnuid=orauser dsnpwd=orapwd
preserve_col_names=yes;
proc sql dquote=ansi;
create table mydblib.mytable ("my$column" int);
PRESERVE_COL_NAMES=
does not apply to the pass-through facility.