|
On Jan 29, 9:19 pm, j...@STANFORDALUMNI.ORG (Jack Hamilton) wrote:
> On Jan 29, 2010, at 8:48 am, Fehd, Ronald J. (CDC/CCHIS/NCPHI) wrote:
>
> > sashelp.views are deprecated
>
> Where does SAS Institute say that sashelp views are deprecated?
>
I never heard that term per se, but it's clear from the V9
documentation that they encourage use of SQL (using Tables) over non-
SQL (using Views). Back in the V6 days, when the Tables were
introduced, Nancy Michal (now Nancy Cole) and I wrote a paper
describing the structure and uses of some of the Tables. We also did
some comparisons of efficiency running VMS, Unix, Windows, and OS/2,
comparing timings of creating a report from CATALOGS using SQL, a DATA
step, PROC PRINT, etc. The SQL-based scenario (create a WORK dataset,
then use PRINT) ran, on average, in 1/4 the time of the next-fastest
approach.
Here's an excerpt from the V9.1 documentation:
DICTIONARY Tables and Performance
When you query a DICTIONARY table, SAS gathers information that is
pertinent to that table. Depending on the DICTIONARY table that is
being queried, this process can include searching libraries, opening
tables, and executing views. Unlike other SAS procedures and the DATA
step, PROC SQL can improve this process by optimizing the query before
the select process is launched. Therefore, although it is possible to
access DICTIONARY table information with SAS procedures or the DATA
step by using the SASHELP views, it is often more efficient to use
PROC SQL instead.
For example, the following programs both produce the same result, but
the PROC SQL step runs much faster because the WHERE clause is
processed prior to opening the tables that are referenced by the
SASHELP.VCOLUMN view:
data mytable;
set sashelp.vcolumn;
where libname='WORK' and memname='SALES';
run;
proc sql;
create table mytable as
select * from sashelp.vcolumn
where libname='WORK' and memname='SALES';
quit;
Note: SAS does not maintain DICTIONARY table information between
queries. Each query of a DICTIONARY table launches a new discovery
process.
If you are querying the same DICTIONARY table several times in a row,
you can get even faster performance by creating a temporary SAS data
set (with the DATA step SET statement or PROC SQL CREATE TABLE AS
statement) with the information that you desire and run your query
against that data set.
|