DATA step views
SAS data files
other PROC SQL views
SAS/ACCESS views
DB2, ORACLE, or other DBMS data
For complete documentation on how to create and use PROC SQL views, see “SQL
Procedure” in SAS SQL Procedure User’s Guide.
For information about using PROC SQL views created in an earlier release, see Chapter
35, “SAS 9.4 Compatibility with SAS Files from Earlier Releases,” on page 725.
Comparing DATA Step and PROC SQL Views
To help you decide between a DATA step view and a PROC SQL view, consider the
characteristics of each type of SAS view:
DATA step views
DATA step views are versatile because they use DATA step processing, including
DO loops and IF-THEN/ELSE statements.
DATA step views do not have Update capability. That is, they cannot directly
change the data that they access.
There is no way to qualify the data in a DATA step view before using it.
Therefore, even if you need only part of the data in your SAS view, you must
load into memory the entire DATA step view and discard everything that you do
not need.
When a WHERE clause is applied to a DATA step view, the WHERE clause is
evaluated by the DATA step view engine.
PROC SQL views
PROC SQL views can combine data from many different file formats.
PROC SQL views can both read and update the data that they reference.
PROC SQL supports more types of WHERE clauses than are available in DATA
step processing and has a CONNECT TO component that enables you to easily
send SQL statements and pass data to a DBMS by using the pass-through facility.
You can also use the SQL language to subset your data before processing it. This
capability saves memory when you have a large SAS view, but need to select
only a small portion of the data contained in the view.
PROC SQL views do not use DATA step programming.
When a WHERE clause is applied to a PROC SQL view, the WHERE clause
might be evaluated by the PROC SQL view engine, or the WHERE clause might
be evaluated by the underlying library's engine.
682 Chapter 29 SAS Views

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.