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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to OLE DB 4 Naming Conventions <strong>for</strong> OLE DB 703You can use the same MDX statement with the MDX_DESCRIBE:: identifier to seethe full description of each column:proc sql noerrorstop;connect to oledb (provider=msolap prompt=yes);select * from connection to oledb( MDX_DESCRIBE::select {[Measures].[Units Shipped],[Measures].[Units Ordered]} on columns,NON EMPTY [Store].[Store Name].members on rowsfrom Warehouse );The next example creates a view of the OLAP data, which is then accessed using thePRINT procedure:proc sql noerrorstop;connect to oledb(provider=msolapprops=(’data source’=sqlserverdb’user id’=myuserid password=mypassword));create view work.myview asselect * from connection to oledb( MDX::select {[MEASURES].[Unit Sales]} on columns,order(except([Promotion Media].[Media Type].members,{[Promotion Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rowsfrom Sales );proc print data=work.myview;run;In this example, full connection in<strong>for</strong>mation is provided in the CONNECT statement,so the user is not prompted. The SQL view can be used in other PROC SQL statements,the DATA step, or in other procedures, but you cannot modify (that is, insert, update, ordelete a row in) the view’s underlying multidimensional data.Naming Conventions <strong>for</strong> OLE DBFor general in<strong>for</strong>mation about this feature, see Chapter 2, “<strong>SAS</strong> Names and Support<strong>for</strong> DBMS Names,” on page 11.Because OLE DB is an application programming interface (API), data source names<strong>for</strong> files, tables, and columns are determined at run time. Since <strong>SAS</strong> 7, most <strong>SAS</strong>names can be up to 32 characters long. <strong>SAS</strong>/<strong>ACCESS</strong> Interface to OLE DB alsosupports file, table, and column names up to 32 characters long. If DBMS columnnames are longer than 32 characters, they are truncated to 32 characters. If truncatinga name results in identical names, then <strong>SAS</strong> generates unique names by replacing thelast character with a number. For more in<strong>for</strong>mation, see Chapter 2, “<strong>SAS</strong> Names andSupport <strong>for</strong> DBMS Names,” on page 11.The PRESERVE_COL_NAMES= and PRESERVE_TAB_NAMES= LIBNAME optionsdetermine how <strong>SAS</strong>/<strong>ACCESS</strong> Interface to OLE DB handles case sensitivity, spaces, andspecial characters. (For in<strong>for</strong>mation about these options, see “Overview of theLIBNAME Statement <strong>for</strong> <strong>Relational</strong> <strong>Databases</strong>” on page 87.) The default value <strong>for</strong> bothoptions is NO <strong>for</strong> most data sources. The default value is YES <strong>for</strong> Microsoft Access,Microsoft Excel, and Microsoft SQL Server.

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

Saved successfully!

Ooh no, something went wrong!