13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The LIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong> 4 PRESERVE_TAB_NAMES= LIBNAME Option 169normalization rules do not appear in the output. In <strong>SAS</strong> line mode, here is how <strong>SAS</strong>indicates the number of tables that do not display from PROC DATASETS because ofthis restriction:Note: "Due to the PRESERVE_TAB_NAMES=NO LIBNAME option setting, 12table(s) have not been displayed." 4You do not get this warning when using <strong>SAS</strong> Explorer.<strong>SAS</strong> Explorer displays DBMS table names in capitalized <strong>for</strong>m whenPRESERVE_TAB_NAMES=NO. This is now how the tables are represented in theDBMS.NO is the default <strong>for</strong> most DBMS interfaces.YESspecifies that table names are read from and passed to the DBMS with specialcharacters, and the exact, case-sensitive spelling of the name is preserved.DetailsFor more in<strong>for</strong>mation, see the <strong>SAS</strong>/<strong>ACCESS</strong> naming topic in the DBMS-specificreference section <strong>for</strong> your interface in this document.To use table names in your <strong>SAS</strong> program that are not valid <strong>SAS</strong> names, use one ofthese techniques.3 Use the PROC SQL option DQUOTE= and place double quotation marks aroundthe table name. The libref must specify PRESERVE_TAB_NAMES=YES. Forexample:libname mydblib oracle user=testuser password=testpasspreserve_tab_names=yes;proc sql dquote=ansi;select * from mydblib."my table";3 Use name literals in the <strong>SAS</strong> language. The libref must specifyPRESERVE_TAB_NAMES=YES. For example:libname mydblib oracle user=testuser password=testpass preserve_tab_names=yes;proc print data=mydblib.’my table’n;run;To save some time when coding, specify the PRESERVE_NAMES= alias if you planto specify both the PRESERVE_COL_NAMES= and PRESERVE_TAB_NAMES= optionsin your LIBNAME statement.Oracle: Unless you specify PRESERVE_TAB_NAMES=YES, the table name that youenter <strong>for</strong> SCHEMA= LIBNAME option or <strong>for</strong> the DBINDEX= data set option isconverted to uppercase.ExampleIf you use PROC DATASETS to read the table names in an Oracle database thatcontains three tables, My_Table, MY_TABLE, and MY TABLE. The results differdepending on the setting of PRESERVE_TAB_NAMES.If the libref specifies PRESERVE_TAB_NAMES=NO, then the PROC DATASETSoutput is one table name, MY_TABLE. This is the only table name that is in Oraclenormalized <strong>for</strong>m (uppercase letters and a valid symbol, the underscore). My_Table doesnot display because it is not in a <strong>for</strong>m that is normalized <strong>for</strong> Oracle, and MY TABLE isnot displayed because it is not in <strong>SAS</strong> member normalized <strong>for</strong>m (the embedded space isa nonstandard <strong>SAS</strong> character).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!