O'Reilly logo

SAS 9.4 SQL Procedure User's Guide, Fourth Edition, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

In general, indexing on a column with a small number (less than 6 or 7) of distinct
values does not result in a performance gain.
You can use the same column in a simple index and in a composite index. However,
for tables that have a primary key integrity constraint, do not create more than one
index that is based on the same column as the primary key.
Deleting Indexes
To delete an index from a table, use the DROP INDEX statement. The following DROP
INDEX statement deletes the index Places from NewCountries:
proc sql;
drop index places from sql.newcountries;
Deleting a Table
To delete a PROC SQL table, use the DROP TABLE statement:
proc sql;
drop table sql.newcountries;
Using SQL Procedure Tables in SAS Software
Because PROC SQL tables are SAS data files, you can use them as input to a DATA step
or to other SAS procedures. For example, the following PROC MEANS step calculates
the mean for Area for all countries that are in the Countries table:
proc means data=sql.countries mean maxdec=2;
title "Mean Area for All Countries";
var area;
run;
Output 4.12 Using a PROC SQL Table in PROC MEANS
128 Chapter 4 Creating and Updating Tables and Views

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required