Chapter 27
SAS Views
Definition of SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
Benefits of Using SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
When to Use SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
DATA Step Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Definition of a DATA Step View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Creating DATA Step Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
What Can You Do with a DATA Step View? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Differences between DATA Step Views and Stored Compiled
DATA Step Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Restrictions and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
Example 1: Merging Data to Produce Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
Example 2: Producing Additional Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
PROC SQL Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
Comparing DATA Step and PROC SQL Views . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
SAS/ACCESS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Definition of SAS Views
A SAS view is a type of SAS data set that retrieves data values from other files. A SAS
view contains only descriptor information such as the data types and lengths of the
variables (columns). A SAS view also contains information that is required for retrieving
data values from other SAS data sets or from files that are stored in other software
vendors' file formats. SAS views are of member type VIEW. In most cases, you can use
a SAS view as if it were a SAS data file.
There are two general types of SAS views:
native view
is a SAS view that is created either with a DATA step or with PROC SQL.
interface view
is a SAS view that is created with SAS/ACCESS software. An interface view can
read data from or write data to a database management system (DBMS) such as DB2
or ORACLE. Interface views are also referred to as SAS/ACCESS views. In order to
use SAS/ACCESS views, you must have a license for SAS/ACCESS software.
645

Get SAS 9.4 Language Reference, 3rd 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.