SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Accessing Other Vendors' DBMS Data
DBMS Access Using the LIBNAME Statement


Preserving Table and Column Names

When you read data from or pass data to a DBMS, you may want to preserve spaces, special characters, and case sensitivity in column or table names. You can use the SAS/ACCESS LIBNAME options PRESERVE_COL_NAMES= and PRESERVE_TAB_NAMES= to preserve column names and table names, respectively.


General form, PRESERVE_COL_NAMES= and PRESERVE_TAB_NAMES= options:
PRESERVE_COL_NAMES=NO | YES

PRESERVE_TAB_NAMES=NO | YES


For example, in the program below, specifying the value YES for the PRESERVE_COL_NAMES= option retains the case of the column names in the ORACLE data accessed through Oraclib.Staff.
     libname oraclib oracle
             user=kilroy password=washere
             path=oracpath preserve_col_names=yes;
     proc sql;
        create table oraclib.emps as
           (select IDnum, LName, FName
               from oraclib.staff
               where City="STAMFORD");
     quit;


The default values of these options depend on the DBMS that you are using.


For details on using these options, see the following:

Note: If you want to use column or table names that are nonstandard to SAS variable naming conventions, you will need to use either the PROC SQL option DQUOTE=ANSI or the SAS System option VALIDVARNAME=ANY. For details about these options, see SAS Names and Support for DBMS Names in SAS/ACCESS Software for Realtional Databases. To learn more about the SQL procedure, see SAS Procedures Guide.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement