Overview

Introduction

A PROC SQL view is a stored query expression that reads data values from its underlying files, which can include SAS data files, DATA step views, other PROC SQL views, or DBMS data.
You can refer to views in queries as if they were tables. The view derives its data from the tables or views that are listed in its FROM clause. The data that is accessed by a view is a subset or superset of the data that is in its underlying table(s) or view(s).
proc sql;
   create view sasuser.raisev as
      select empid, jobcode, 
             salary format=dollar12.2, 
             salary/12 as MonthlySalary
             format=dollar12.2
         from payrollmaster;
   select *
      from sasuser.raisev
      where jobcode in ('PT2','PT3');
PROC SQL views
  • can be used in SAS programs in place ...

Get SAS Certification Prep Guide, 4th 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.