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_COL_NAMES= LIBNAME Option 167DBMS support: Aster nCluster, DB2 under UNIX and PC Hosts, DB2 under z/OS,Greenplum, HP Neoview, In<strong>for</strong>mix, Microsoft SQL Server, MySQL, Netezza, ODBC,OLE DB, Oracle, Sybase IQ, TeradataSyntaxPRESERVE_COL_NAMES=YES | NOSyntax DescriptionNOspecifies that column names that are used to create DBMS tables are derived from<strong>SAS</strong> variable names (VALIDVARNAME= system option) by using the <strong>SAS</strong> variablename normalization rules. However, the database applies its DBMS-specificnormalization rules to the <strong>SAS</strong> variable names when creating the DBMS columnnames.The use of N-Literals to create column names that use database keywords orspecial symbols other than the underscore character might be illegal when DBMSnormalization rules are applied. To include nonstandard <strong>SAS</strong> symbols or databasekeywords, specify PRESERVE_COL_NAMES=YES.NO is the default <strong>for</strong> most DBMS interfaces.YESspecifies that column names that are used in table creation are passed to the DBMSwith special characters and the exact, case-sensitive spelling of the name preserved.DetailsThis option applies only when you use <strong>SAS</strong>/<strong>ACCESS</strong> to create a new DBMS table. Whenyou create a table, you assign the column names by using one of the following methods:3 To control the case of the DBMS column names, specify variables using the casethat you want and set PRESERVE_COL_NAMES=YES. If you use special symbolsor blanks, you must set VALIDVARNAME= to ANY and use N-Literals. For morein<strong>for</strong>mation, see the <strong>SAS</strong>/<strong>ACCESS</strong> naming topic in the DBMS-specific referencesection <strong>for</strong> your interface in this document and also the system options section in<strong>SAS</strong> Language <strong>Reference</strong>: Dictionary.3 To enable the DBMS to normalize the column names according to its namingconventions, specify variables using any case and setPRESERVE_COLUMN_NAMES= NO.When you use <strong>SAS</strong>/<strong>ACCESS</strong> to read from, insert rows into, or modify data in anexisting DBMS table, <strong>SAS</strong> identifies the database column names by their spelling.There<strong>for</strong>e, when the database column exists, the case of the variable does not matter.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.To use column names in your <strong>SAS</strong> program that are not valid <strong>SAS</strong> names, you mustuse one of the following techniques:3 Use the DQUOTE= option in PROC SQL and then reference your columns usingdouble quotation marks. For example:proc sql dquote=ansi;select "Total$Cost" from mydblib.mytable;

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

Saved successfully!

Ooh no, something went wrong!