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.

<strong>SAS</strong> Names and Support <strong>for</strong> DBMS Names 4 Using DQUOTE=ANSI 21title "International Delays";select * from mydblib."International Delays";Notice that you use single quotation marks to specify the data value <strong>for</strong> London(int.dest=’LON’) in the WHERE clause. Because of the preserve name LIBNAMEoptions, using double quotation marks would cause <strong>SAS</strong> to interpret this data value asa column name.Output 2.4DBMS Table with Nonstandard Column NamesInternational DelaysFLIGHTNUMBER DATES ORIGIN DESTINATION DELAY-----------------------------------------------------------219 01MAR1998:00:00:00 LGA LON 18219 02MAR1998:00:00:00 LGA LON 18219 03MAR1998:00:00:00 LGA LON 18219 04MAR1998:00:00:00 LGA LON 18219 05MAR1998:00:00:00 LGA LON 18219 06MAR1998:00:00:00 LGA LON 18219 07MAR1998:00:00:00 LGA LON 18219 01MAR1998:00:00:00 LGA LON 18219 02MAR1998:00:00:00 LGA LON 18219 03MAR1998:00:00:00 LGA LON 18If you query a DBMS table and use a label to change the FLIGHT NUMBER columnname to a standard <strong>SAS</strong> name (Flight_Number), a label (enclosed in single quotationmarks) changes the name only in the output. Because this column name and the tablename, International Delays, each have a space in their names, you have to enclose thenames in double quotation marks. A partial output follows the example.options linesize=64 nodate;libname mydblib oracle user=testuser password=testpass path=’airdata’schema=airport preserve_names=yes;proc sql dquote=ansi outobs=5;title "Query from International Delays";select "FLIGHT NUMBER" label=’Flight_Number’, dates, delayfrom mydblib."International Delays";Output 2.5Query Renaming a Nonstandard Column to a Standard <strong>SAS</strong> NameQuery from International DelaysFlight_Number DATES DELAY--------------------------------------219 01MAR1998:00:00:00 18219 02MAR1998:00:00:00 18219 03MAR1998:00:00:00 18219 04MAR1998:00:00:00 18219 05MAR1998:00:00:00 18You can preserve special characters by specifying DQUOTE=ANSI and using doublequotation marks around the <strong>SAS</strong> names in your SELECT statement.

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

Saved successfully!

Ooh no, something went wrong!